diff options
author | 2023-06-05 08:16:32 +0900 | |
---|---|---|
committer | 2023-06-05 21:33:47 +0900 | |
commit | 12980c1f2f8a926dd634e27c700014b3246a99ec (patch) | |
tree | d15293ff704acb0bf6cea28c439c9900d335c088 /drivers/ata | |
parent | ata: libata-sata: Improve ata_change_queue_depth() (diff) | |
download | linux-12980c1f2f8a926dd634e27c700014b3246a99ec.tar.gz linux-12980c1f2f8a926dd634e27c700014b3246a99ec.tar.bz2 linux-12980c1f2f8a926dd634e27c700014b3246a99ec.zip |
ata: libata-eh: Use ata_ncq_enabled() in ata_eh_speed_down()
In ata_eh_speed_down(), instead of hard-coding the test on the device
flags to detect if NCQ is supported and enabled, use ata_ncq_enabled().
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-eh.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c7336a0a884d..b80e68000dd3 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1817,9 +1817,7 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev, verdict = ata_eh_speed_down_verdict(dev); /* turn off NCQ? */ - if ((verdict & ATA_EH_SPDN_NCQ_OFF) && - (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ | - ATA_DFLAG_NCQ_OFF)) == ATA_DFLAG_NCQ) { + if ((verdict & ATA_EH_SPDN_NCQ_OFF) && ata_ncq_enabled(dev)) { dev->flags |= ATA_DFLAG_NCQ_OFF; ata_dev_warn(dev, "NCQ disabled due to excessive errors\n"); goto done; |