summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorNiklas Cassel <niklas.cassel@wdc.com>2022-09-16 14:28:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-26 13:17:05 +0200
commitea6cb925cc48839686104816f3cd12b5ac650c9a (patch)
treeacec8a489ee2988dcc92078747e8682e219168a7 /include/linux
parentab0d14822232a5773c4e9f0396614d70856fc46d (diff)
downloadlinux-stable-ea6cb925cc48839686104816f3cd12b5ac650c9a.tar.gz
linux-stable-ea6cb925cc48839686104816f3cd12b5ac650c9a.tar.bz2
linux-stable-ea6cb925cc48839686104816f3cd12b5ac650c9a.zip
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index c2beacc9e522..641545929efb 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -583,6 +583,10 @@ struct ata_bmdma_prd {
((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
((id)[ATA_ID_FEATURE_SUPP] & (1 << 8)))
+#define ata_id_has_ncq_autosense(id) \
+ ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \
+ ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
+ ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7)))
#define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10))
#define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11))
#define ata_id_u32(id,n) \
@@ -595,8 +599,6 @@ struct ata_bmdma_prd {
#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
#define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4))
-#define ata_id_has_ncq_autosense(id) \
- ((id)[ATA_ID_FEATURE_SUPP] & (1 << 7))
static inline bool ata_id_has_hipm(const u16 *id)
{