NCR5380_poll_politely2(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ‘‘ NCR5380_poll_politely2 β€” wait for two chip register values

okay bestie, welcome to the Kernel API Manual, section 9, where we talk about NCR5380_poll_politely2 β€” yes that's the whole name, she's named like that, we don't ask questions πŸ’…. This little function is basically the politest way in the whole kernel to be like "hey chip… are you done yet… are you done yet…" without hogging the CPU forever. Iconic behavior honestly.


✨ SYNOPSIS ✨

int NCR5380_poll_politely2 (struct NCR5380_hostdata *hostdata , unsigned
int reg1 , u8 bit1 , u8 val1 , unsigned int reg2 , u8 bit2 , u8 val2 ,
unsigned long wait );

yeah it's a long one, but every single argument is doing her job, don't skip any 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • hostdata β€” the host's private data. the main character's personal diary, essentially πŸ““
  • reg1 β€” the 5380 register we're stalking first
  • bit1 β€” the bitmask to check against it
  • val1 β€” the value we're hoping to see
  • reg2 β€” the second 5380 register to poll. yes, two at once, she's multitasking πŸ’…
  • bit2 β€” the second bitmask to check
  • val2 β€” the second expected value
  • wait β€” time-out in jiffies πŸ•°οΈ and listen: 0 means sleeping is not allowed. no naps. none.

πŸ’– DESCRIPTION πŸ’–

So what she does is poll the chip in a reasonably efficient manner, just vibing and waiting for an event to occur ✨. And the way she does it is lowkey elegant: after a short quick poll she starts to yield the CPU (if possible), because she's not about to sit there and hog it β€” she has manners, fr fr.

⚠️ but bestie, heads up: in irq contexts the time-out is arbitrarily limited. that's just the rules, no cap.

Returns 0 if either or both event(s) occurred β€” literally either one, she's flexible πŸ¦‹ β€” otherwise -ETIMEDOUT πŸ˜­πŸ’€.


🌈 SEE ALSO 🌈

all the siblings, cousins, and extended family, listed here so you can go meet the whole friend group:


πŸ“ quick vibe check before you go: two registers, two bitmasks, two expected values, one time-out in jiffies. that's the whole recipe. slay.

kisses bestie, this page was brought to you by ./drivers/scsi, dated October 2026, living in the Kernel API Manual (section 9 ofc) β€” go read the source, it ate πŸ’œπŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from