Scroll to navigation

ATA_WAIT_REGISTER(9) libata Library ATA_WAIT_REGISTER(9)

NAME

ata_wait_register - wait until register value changes

SYNOPSIS

u32 ata_wait_register(struct ata_port * ap, void __iomem * reg, u32 mask, u32 val, unsigned long interval, unsigned long timeout);

ARGUMENTS

struct ata_port * ap

ATA port to wait register for, can be NULL

void __iomem * reg

IO-mapped register

u32 mask

Mask to apply to read register value

u32 val

Wait condition

unsigned long interval

polling interval in milliseconds

unsigned long timeout

timeout in milliseconds

DESCRIPTION

Waiting for some bits of register to change is a common operation for ATA controllers. This function reads 32bit LE IO-mapped register reg and tests for the following condition.

(*reg & mask) != val

If the condition is met, it returns; otherwise, the process is repeated after interval_msec until timeout.

LOCKING: Kernel thread context (may sleep)

RETURN

The final register value.

AUTHOR

Jeff Garzik

Author.

COPYRIGHT

June 2017 Kernel Hackers Manual 4.11