All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libata: disable pdev on all suspend events
       [not found] ` <45D6FE5A.1080603@gmail.com>
@ 2007-02-20  9:14   ` Tejun Heo
  2007-02-20 16:02     ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2007-02-20  9:14 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Jeff Garzik, Greg KH, linux-ide, pavel

libata used disable pdev only on PM_EVENT_SUSPEND while re-enable pdev
unconditionally.  This was okay before ref-counted pdev enable update
but it now makes the pdev pinned after swsusp cycle (enabled twice but
disabled only once) and devres sanity check whines about it.

Fix it by unconditionally disabling pdev on all suspend events.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
Pavel, I took your advice and chose to disable unconditionally rather
than recording the status separately, but I still think it would be
nice if we can tell the status we're waking from from either the mesg
itself (say, PM_EVENT_THAW) or recorded prev state.

Both STM and STD are tested.  Please apply.  Thanks.

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 2cf8251..12bde4b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6001,11 +6001,10 @@ int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits)
 void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
 	pci_save_state(pdev);
+	pci_disable_device(pdev);
 
-	if (mesg.event == PM_EVENT_SUSPEND) {
-		pci_disable_device(pdev);
+	if (mesg.event == PM_EVENT_SUSPEND)
 		pci_set_power_state(pdev, PCI_D3hot);
-	}
 }
 
 int ata_pci_device_do_resume(struct pci_dev *pdev)


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

* Re: [PATCH] libata: disable pdev on all suspend events
  2007-02-20  9:14   ` [PATCH] libata: disable pdev on all suspend events Tejun Heo
@ 2007-02-20 16:02     ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-02-20 16:02 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Andrew Morton, Greg KH, linux-ide, pavel

Tejun Heo wrote:
> libata used disable pdev only on PM_EVENT_SUSPEND while re-enable pdev
> unconditionally.  This was okay before ref-counted pdev enable update
> but it now makes the pdev pinned after swsusp cycle (enabled twice but
> disabled only once) and devres sanity check whines about it.
> 
> Fix it by unconditionally disabling pdev on all suspend events.
> 
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> Pavel, I took your advice and chose to disable unconditionally rather
> than recording the status separately, but I still think it would be
> nice if we can tell the status we're waking from from either the mesg
> itself (say, PM_EVENT_THAW) or recorded prev state.
> 
> Both STM and STD are tested.  Please apply.  Thanks.

applied



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

end of thread, other threads:[~2007-02-20 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20070216213153.f6704ff5.akpm@linux-foundation.org>
     [not found] ` <45D6FE5A.1080603@gmail.com>
2007-02-20  9:14   ` [PATCH] libata: disable pdev on all suspend events Tejun Heo
2007-02-20 16:02     ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.