public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: libata-core: Fix ata_pci_shutdown_one()
@ 2023-11-06  4:16 Damien Le Moal
  2023-11-06  8:47 ` Sergey Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Le Moal @ 2023-11-06  4:16 UTC (permalink / raw)
  To: linux-ide

Commit 5b6fba546da2 ("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 24eca2dce0f8 ("scsi: sd: Introduce
manage_shutdown device flag"). With this, all ATA disks are spun down on
system shutdown.

This reverts commit 5b6fba546da2 as the change introduced is now
useless.

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

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 6fb4e8dc8c3c..09ed67772fae 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6180,24 +6180,10 @@ EXPORT_SYMBOL_GPL(ata_pci_remove_one);
 void ata_pci_shutdown_one(struct pci_dev *pdev)
 {
 	struct ata_host *host = pci_get_drvdata(pdev);
-	struct ata_port *ap;
-	unsigned long flags;
 	int i;
 
-	/* Tell EH to disable all devices */
-	for (i = 0; i < host->n_ports; i++) {
-		ap = host->ports[i];
-		spin_lock_irqsave(ap->lock, flags);
-		ap->pflags |= ATA_PFLAG_UNLOADING;
-		ata_port_schedule_eh(ap);
-		spin_unlock_irqrestore(ap->lock, flags);
-	}
-
 	for (i = 0; i < host->n_ports; i++) {
-		ap = host->ports[i];
-
-		/* Wait for EH to complete before freezing the port */
-		ata_port_wait_eh(ap);
+		struct ata_port *ap = host->ports[i];
 
 		ap->pflags |= ATA_PFLAG_FROZEN;
 
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ata: libata-core: Fix ata_pci_shutdown_one()
  2023-11-06  4:16 [PATCH] ata: libata-core: Fix ata_pci_shutdown_one() Damien Le Moal
@ 2023-11-06  8:47 ` Sergey Shtylyov
  2023-11-06  9:02   ` Damien Le Moal
  0 siblings, 1 reply; 5+ messages in thread
From: Sergey Shtylyov @ 2023-11-06  8:47 UTC (permalink / raw)
  To: Damien Le Moal, linux-ide

Hello!

On 11/6/23 7:16 AM, Damien Le Moal wrote:

> Commit 5b6fba546da2 ("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 24eca2dce0f8 ("scsi: sd: Introduce
> manage_shutdown device flag"). With this, all ATA disks are spun down on
> system shutdown.
> 
> This reverts commit 5b6fba546da2 as the change introduced is now
> useless.

   You didn't use 'git revert'?

> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
[...]

MBR, Sergey

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ata: libata-core: Fix ata_pci_shutdown_one()
  2023-11-06  8:47 ` Sergey Shtylyov
@ 2023-11-06  9:02   ` Damien Le Moal
  2023-11-07 10:06     ` Niklas Cassel
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Le Moal @ 2023-11-06  9:02 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-ide

On 11/6/23 17:47, Sergey Shtylyov wrote:
> Hello!
> 
> On 11/6/23 7:16 AM, Damien Le Moal wrote:
> 
>> Commit 5b6fba546da2 ("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 24eca2dce0f8 ("scsi: sd: Introduce
>> manage_shutdown device flag"). With this, all ATA disks are spun down on
>> system shutdown.
>>
>> This reverts commit 5b6fba546da2 as the change introduced is now
>> useless.
> 
>    You didn't use 'git revert'?

I did, but I wrote a proper commit message.

> 
>> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> [...]
> 
> MBR, Sergey

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ata: libata-core: Fix ata_pci_shutdown_one()
  2023-11-06  9:02   ` Damien Le Moal
@ 2023-11-07 10:06     ` Niklas Cassel
  2023-11-08  1:11       ` Damien Le Moal
  0 siblings, 1 reply; 5+ messages in thread
From: Niklas Cassel @ 2023-11-07 10:06 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Sergey Shtylyov, linux-ide@vger.kernel.org

On Mon, Nov 06, 2023 at 06:02:04PM +0900, Damien Le Moal wrote:
> On 11/6/23 17:47, Sergey Shtylyov wrote:
> > Hello!
> > 
> > On 11/6/23 7:16 AM, Damien Le Moal wrote:
> > 
> >> Commit 5b6fba546da2 ("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 24eca2dce0f8 ("scsi: sd: Introduce
> >> manage_shutdown device flag"). With this, all ATA disks are spun down on
> >> system shutdown.
> >>
> >> This reverts commit 5b6fba546da2 as the change introduced is now
> >> useless.
> > 
> >    You didn't use 'git revert'?
> 
> I did, but I wrote a proper commit message.

I think Sergey's question was because you didn't keep the automatically
generated one liner will the full SHA1 as the first line in your summary
(which is then followed by the reason for the revert), see e.g.:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ac2263b588dffd3a1efd7ed0b156ea6c5aea200d


You have the line as the as final line in the summary, and shortened it
to not have the full SHA1.

Personally, I think I prefer having the full SHA1 as the first line,
as you directly see that it is a revert (without needing the read to
the end).

But I think it is fine either way:
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ata: libata-core: Fix ata_pci_shutdown_one()
  2023-11-07 10:06     ` Niklas Cassel
@ 2023-11-08  1:11       ` Damien Le Moal
  0 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2023-11-08  1:11 UTC (permalink / raw)
  To: Niklas Cassel; +Cc: Sergey Shtylyov, linux-ide@vger.kernel.org

On 11/7/23 19:06, Niklas Cassel wrote:
> Personally, I think I prefer having the full SHA1 as the first line,
> as you directly see that it is a revert (without needing the read to
> the end).
> 
> But I think it is fine either way:
> Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>

I tweaked the commit message to keep the full commit ID, making clear it is a
"git revert". Thanks.

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-08  1:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-06  4:16 [PATCH] ata: libata-core: Fix ata_pci_shutdown_one() Damien Le Moal
2023-11-06  8:47 ` Sergey Shtylyov
2023-11-06  9:02   ` Damien Le Moal
2023-11-07 10:06     ` Niklas Cassel
2023-11-08  1:11       ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox