Mark Lord wrote:
Tejun Heo wrote:
Mark Lord wrote:
Maybe it's better to set ATA_TFLAG_LBA48 | ATA_TFLAG_ISADDR |
ATA_TFLAG_DEVICE? After all, all fields are available after that
memcpy().
..
I just did it the same way as the standard version in libata-core
does it.
In this particular case, we know it was NCQ, so we know that the
original
tf->flags have (ATA_TFLAG_LBA48|ATA_TFLAG_ISADDR|ATA_TFLAG_DEVICE) set.
I figured better to copy than just overwrite, because new flags might
come along.
Those flags are to tell which parts of the TF are valid or should be
read in case of TFLAG_LBA48. So, a TF after tf_read should always
have TFLAG_ISADDR and TFLAG_DEVICE. TFLAG_LBA48 works both ways. If
it was set when tf_read is called the higher part of LBA is read and
the resulting tf should have TFLAG_LBA48 set. But yeah the original
code isn't like that. If you can fix it up together with the NCQ
path, it would be great.
..
Actually, the TF after tf_read in this case should have TFLAG_LBA in there
as well. And TFLAG_DEVICE looks unnecessary (but harmless).
Yeah.. right.
Copying from the outgoing tf gets all of those.
Not for all cases tho. There are commands which don't necessarily use
the LBA fields but reading it back on failure is still a good idea.
--
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