NCR5380_poll_politely2(9)
π 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 firstbit1β the bitmask to check against itval1β the value we're hoping to seereg2β the second 5380 register to poll. yes, two at once, she's multitasking πbit2β the second bitmask to checkval2β the second expected valuewaitβ time-out in jiffies π°οΈ and listen:0means 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:
- Kernel file
./drivers/scsi/NCR5380.cβinitialize_SCp(9),NCR5380_print(9),NCR5380_print_phase(9),NCR5380_info(9),NCR5380_init(9),NCR5380_maybe_reset_bus(9),NCR5380_exit(9),complete_cmd(9),NCR5380_queue_command(9),dequeue_next_cmd(9),NCR5380_main(9),NCR5380_intr(9),NCR5380_select(9),NCR5380_transfer_pio(9),do_reset(9),do_abort(9),list_find_cmd(9),NCR5380_abort(9),NCR5380_host_reset(9)
π 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms