Hello, Mikael Pettersson wrote:
I've started working on NCQ support for sata_promise, and I have a few questions regarding NCQ and libata:
Great.
1. Can I rely not seeing any non-NCQ commands while there are uncompleted NCQ commands on a port? I _believe_, from the comment at ata_std_qc_defer(), that this is the case, but I'd like to get that confirmed.
Yes, you can rely on that.
2. Assuming NCQ and non-NCQ commands cannot be mixed, is there a defined way to detect when a port transitions from non-NCQ to NCQ mode and vice versa, or do I have to detect that myself? The mode affects the programming of the Promise SATA "sequence counter control" registers.
There's no defined way. You'll probably need to add ->last_protocol or ->was_ncq in LLD private structure.
3. Is qc->tag defined (to zero for instance) for non-NCQ commands? For sata_promise NCQ I need to allocate packets and prds from per-port pools indexed by tag. To handle non-NCQ commands it's easiest to assume they map to tag 0, but the code to set a tag conditionally based on qc->tf.protocol is a bit ugly.
For all non-NCQ, non-EH commands, the tag is fixed at 0.
4. What are these "internal commands" that map to ATA_TAG_INTERNAL? Are they NCQ or not? Does the existence of ATA_TAG_INTERNAL limit queue depth for NCQ?
Yeah, it reserves tag 31 for EH commands. We might as well use tag 32 for EH commands and let LLD map it to whatever tag it can use for EH commands but Jeff didn't like using all the tags as it makes 0xffffffff a valid status value.
Note that depending on LLD implementation, you might want to remap tag 31 to different hardware tag. sata_sil24 does this mainly because it made polled execution implementation easier.
Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html