Skip to content

Commit 0fecb50

Browse files
committed
ata: libata-eh: Reduce "disable device" message verbosity
There is no point in warning about a device being disabled when we expect it to be, that is, on suspend, shutdown or when detaching the device. Suppress the message "disable device" for these cases by introducing the EH static function ata_eh_dev_disable() and by using it in ata_eh_unload() and ata_eh_detach_dev(). ata_dev_disable() code is modified to call this new function after printing the "disable device" message. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Tested-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 7f95731 commit 0fecb50

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

drivers/ata/libata-eh.c

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,18 @@ void ata_eh_release(struct ata_port *ap)
494494
mutex_unlock(&ap->host->eh_mutex);
495495
}
496496

497+
static void ata_eh_dev_disable(struct ata_device *dev)
498+
{
499+
ata_acpi_on_disable(dev);
500+
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET);
501+
dev->class++;
502+
503+
/* From now till the next successful probe, ering is used to
504+
* track probe failures. Clear accumulated device error info.
505+
*/
506+
ata_ering_clear(&dev->ering);
507+
}
508+
497509
static void ata_eh_unload(struct ata_port *ap)
498510
{
499511
struct ata_link *link;
@@ -517,8 +529,8 @@ static void ata_eh_unload(struct ata_port *ap)
517529
*/
518530
ata_for_each_link(link, ap, PMP_FIRST) {
519531
sata_scr_write(link, SCR_CONTROL, link->saved_scontrol & 0xff0);
520-
ata_for_each_dev(dev, link, ALL)
521-
ata_dev_disable(dev);
532+
ata_for_each_dev(dev, link, ENABLED)
533+
ata_eh_dev_disable(dev);
522534
}
523535

524536
/* freeze and set UNLOADED */
@@ -1211,14 +1223,8 @@ void ata_dev_disable(struct ata_device *dev)
12111223
return;
12121224

12131225
ata_dev_warn(dev, "disable device\n");
1214-
ata_acpi_on_disable(dev);
1215-
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET);
1216-
dev->class++;
12171226

1218-
/* From now till the next successful probe, ering is used to
1219-
* track probe failures. Clear accumulated device error info.
1220-
*/
1221-
ata_ering_clear(&dev->ering);
1227+
ata_eh_dev_disable(dev);
12221228
}
12231229
EXPORT_SYMBOL_GPL(ata_dev_disable);
12241230

@@ -1240,12 +1246,12 @@ void ata_eh_detach_dev(struct ata_device *dev)
12401246

12411247
/*
12421248
* If the device is still enabled, transition it to standby power mode
1243-
* (i.e. spin down HDDs).
1249+
* (i.e. spin down HDDs) and disable it.
12441250
*/
1245-
if (ata_dev_enabled(dev))
1251+
if (ata_dev_enabled(dev)) {
12461252
ata_dev_power_set_standby(dev);
1247-
1248-
ata_dev_disable(dev);
1253+
ata_eh_dev_disable(dev);
1254+
}
12491255

12501256
spin_lock_irqsave(ap->lock, flags);
12511257

0 commit comments

Comments
 (0)