Skip to content

Commit fd3a683

Browse files
committed
ata: libata-core: Fix ata_pci_shutdown_one()
This reverts commit 5b6fba5. Commit 5b6fba5 ("ata: libata-core: Detach a port devices on shutdown") modified the function ata_pci_shutdown_one() to stop (suspend) devices attached to the ports of a PCI AHCI adapter to ensure that drives are spun down before shutting down a system. However, this is done only for PCI adapters and not for other types of adapters. This limitation was addressed with commit 24eca2d ("scsi: sd: Introduce manage_shutdown device flag"). With this, all ATA disks are spun down on system shutdown, which make the changes introduced with 5b6fba5 useless. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
1 parent 13d88ac commit fd3a683

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

drivers/ata/libata-core.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6180,24 +6180,10 @@ EXPORT_SYMBOL_GPL(ata_pci_remove_one);
61806180
void ata_pci_shutdown_one(struct pci_dev *pdev)
61816181
{
61826182
struct ata_host *host = pci_get_drvdata(pdev);
6183-
struct ata_port *ap;
6184-
unsigned long flags;
61856183
int i;
61866184

6187-
/* Tell EH to disable all devices */
6188-
for (i = 0; i < host->n_ports; i++) {
6189-
ap = host->ports[i];
6190-
spin_lock_irqsave(ap->lock, flags);
6191-
ap->pflags |= ATA_PFLAG_UNLOADING;
6192-
ata_port_schedule_eh(ap);
6193-
spin_unlock_irqrestore(ap->lock, flags);
6194-
}
6195-
61966185
for (i = 0; i < host->n_ports; i++) {
6197-
ap = host->ports[i];
6198-
6199-
/* Wait for EH to complete before freezing the port */
6200-
ata_port_wait_eh(ap);
6186+
struct ata_port *ap = host->ports[i];
62016187

62026188
ap->pflags |= ATA_PFLAG_FROZEN;
62036189

0 commit comments

Comments
 (0)