diff options
author | Niklas Cassel <niklas.cassel@wdc.com> | 2022-09-16 15:28:35 +0300 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2022-09-21 05:18:28 +0300 |
commit | 630624cb1b5826d753ac8e01a0e42de43d66dedf (patch) | |
tree | 6efce9e51a27f2cd88dd92056228883eac713de6 /drivers/ata | |
parent | a5fb6bf853148974dbde092ec1bde553bea5e49f (diff) | |
download | linux-630624cb1b5826d753ac8e01a0e42de43d66dedf.tar.xz |
ata: fix ata_id_has_dipm()
ACS-5 section
7.13.6.36 Word 78: Serial ATA features supported
states that:
If word 76 is not 0000h or FFFFh, word 78 reports the features supported
by the device. If this word is not supported, the word shall be cleared
to zero.
(This text also exists in really old ACS standards, e.g. ACS-3.)
The problem with ata_id_has_dipm() is that the while it performs a
check against 0 and 0xffff, it performs the check against
ATA_ID_FEATURE_SUPP (word 78), the same word where the feature bit
is stored.
Fix this by performing the check against ATA_ID_SATA_CAPABILITY
(word 76), like required by the spec. The feature bit check itself
is of course still performed against ATA_ID_FEATURE_SUPP (word 78).
Additionally, move the macro to the other ATA_ID_FEATURE_SUPP macros
(which already have this check), thus making it more likely that the
next ATA_ID_FEATURE_SUPP macro that is added will include this check.
Fixes: ca77329fb713 ("[libata] Link power management infrastructure")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'drivers/ata')
0 files changed, 0 insertions, 0 deletions