This message is from the T13 list server.


Please forward to implementors of Serial ATA host controllers (HBAs).

I am currently implementing bits of Native Command Queueing (NCQ) on
Linux, with the help of several device and HBA vendors (thanks!).

Serial ATA (SActive) itself, AHCI and certain other controllers (for
which I have under NDA, but cannot name names) use a 32-bit bitmap
for purposes such as indicating which queued commands are active.

This is a problem because when the HBA is hot-unplugged from PCI or
Cardbus, all I/O reads from the address space where the HBA previous
existed will return all 1's.  In the case of a 32-bit read from
I/O space, this means the OS driver returns a 0xffffffff.

An OS driver may behave incorrectly if all 32 tags are active, and
some sort of hardware fault or hardware unplug occurs.

Linux will therefore limit queueing to a maximum of 31 active commands,
to guarantee that SActive and various hardware registers always have at
least one zero bit on all register reads.  I recommend that other OS's
follow suit, to ensure 100% stable operation.

HBA implementors would be wise to guarantee there is _always_ at least
one zero bit in their HBA's Interrupt Status register(s), for this same
reason.  "All interrupts asserted" cannot be distinguished from
"hardware is not there", if all 32 bits are used.

If someone is interested in more details, feel free to contact me.

        Jeff



Reply via email to