ata: fix ata_id_has_ncq_autosense()
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 16 Sep 2022 12:28:34 +0000 (14:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:17:05 +0000 (13:17 +0200)
commitea6cb925cc48839686104816f3cd12b5ac650c9a
treeacec8a489ee2988dcc92078747e8682e219168a7
parentab0d14822232a5773c4e9f0396614d70856fc46d
ata: fix ata_id_has_ncq_autosense()

[ Upstream commit a5fb6bf853148974dbde092ec1bde553bea5e49f ]

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.)

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: 5b01e4b9efa0 ("libata: Implement NCQ autosense")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/ata.h