diff mbox series

[2/3] ata: libata-eh: Use ata_ncq_enabled() in ata_eh_speed_down()

Message ID 20230605013212.573489-3-dlemoal@kernel.org
State New
Headers show
Series Cleanups and improvements | expand

Commit Message

Damien Le Moal June 5, 2023, 1:32 a.m. UTC
Instead of hardconfign the device flag tests to detect if NCQ is
supported and enabled in ata_eh_speed_down(), use ata_ncq_enabled().

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 drivers/ata/libata-eh.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Hannes Reinecke June 5, 2023, 7:57 a.m. UTC | #1
On 6/5/23 03:32, Damien Le Moal wrote:
> Instead of hardconfign the device flag tests to detect if NCQ is
> supported and enabled in ata_eh_speed_down(), use ata_ncq_enabled().
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> ---
>   drivers/ata/libata-eh.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Sergei Shtylyov June 5, 2023, 9:45 a.m. UTC | #2
On 6/5/23 4:32 AM, Damien Le Moal wrote:

> Instead of hardconfign the device flag tests to detect if NCQ is

   Hardcoding?

> supported and enabled in ata_eh_speed_down(), use ata_ncq_enabled().
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
[...]

MBR, Sergey
Damien Le Moal June 5, 2023, 9:47 a.m. UTC | #3
On 6/5/23 18:45, Sergei Shtylyov wrote:
> On 6/5/23 4:32 AM, Damien Le Moal wrote:
> 
>> Instead of hardconfign the device flag tests to detect if NCQ is
> 
>    Hardcoding?

Yes. Will fix. Thanks.

> 
>> supported and enabled in ata_eh_speed_down(), use ata_ncq_enabled().
>>
>> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> [...]
> 
> MBR, Sergey
John Garry June 5, 2023, 12:31 p.m. UTC | #4
On 05/06/2023 02:32, Damien Le Moal wrote:
> Instead of hardconfign the device flag tests to detect if NCQ is
> supported and enabled in ata_eh_speed_down(), use ata_ncq_enabled().
> 
> Signed-off-by: Damien Le Moal<dlemoal@kernel.org>

Reviewed-by: John Garry <john.g.garry@oracle.com>
diff mbox series

Patch

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index a6c901811802..c0993d755e8d 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;