]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting()
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 16 Sep 2022 12:28:32 +0000 (14:28 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 Nov 2022 13:24:38 +0000 (14:24 +0100)
commit8cc921fe1d0273188c3548ea8812435d8b39e021
treec3e9163d3d68c1d0a81446134553c92e7dd76c5c
parent75fa7ba39db9e6d2520378f7b6beda88f62f52d2
ata: fix ata_id_sense_reporting_enabled() and ata_id_has_sense_reporting()

BugLink: https://bugs.launchpad.net/bugs/1996825
[ Upstream commit 690aa8c3ae308bc696ec8b1b357b995193927083 ]

ACS-5 section
7.13.6.41 Words 85..87, 120: Commands and feature sets supported or enabled
states that:

If bit 15 of word 86 is set to one, bit 14 of word 119 is set to one,
and bit 15 of word 119 is cleared to zero, then word 119 is valid.

If bit 15 of word 86 is set to one, bit 14 of word 120 is set to one,
and bit 15 of word 120 is cleared to zero, then word 120 is valid.

(This text also exists in really old ACS standards, e.g. ACS-3.)

Currently, ata_id_sense_reporting_enabled() and
ata_id_has_sense_reporting() both check bit 15 of word 86,
but neither of them check that bit 14 of word 119 is set to one,
or that bit 15 of word 119 is cleared to zero.

Additionally, make ata_id_sense_reporting_enabled() return false
if !ata_id_has_sense_reporting(), similar to how e.g.
ata_id_flush_ext_enabled() returns false if !ata_id_has_flush_ext().

Fixes: e87fd28cf9a2 ("libata: Implement support for sense data reporting")
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/linux/ata.h