From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Parag Warudkar <parag.lkml@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Matt Carlson <mcarlson@broadcom.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: 2.6.29-rc3: tg3 dead after resume
Date: Sat, 31 Jan 2009 01:38:50 +0100 [thread overview]
Message-ID: <200901310138.51214.rjw@sisk.pl> (raw)
In-Reply-To: <alpine.DEB.2.00.0901301924550.5056@parag-desktop>
On Saturday 31 January 2009, Parag Warudkar wrote:
>
> On Sat, 31 Jan 2009, Rafael J. Wysocki wrote:
>
> > > 00:1c.0 PCI bridge: Intel Corporation 631xESB/632xESB/3100 Chipset PCI Express Root Port 1 (rev 09)
> > > - Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
> > > + Control: I/O- Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
> > > Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> > > Latency: 0, Cache Line Size: 64 bytes
> > > Bus: primary=00, secondary=0e, subordinate=0e, sec-latency=0
> >
> > and the PCIe port driver may be at fault.
> >
> > Can you try to remove the pci_save_state(dev) from pcie_port_suspend_late()
> > and see if that helps?
> >
>
> I assume you meant pcie_portdrv_suspend_late in
> drivers/pci/pcie/portdrv_pci.c - that one did not go well.
Yes.
> With that change machine refuses to suspend (comes back after attempting)
> and my keyboard goes dead.
This gets more and more interesting.
Can you test the patch below, please?
Rafael
---
Subject: PCI PCIe portdrv: Implement pm object
From: Rafael J. Wysocki <rjw@sisk.pl>
Implement pm object for the PCI Express port driver in order to use
the new power management framework.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/pci/hotplug/pciehp_core.c | 4 +--
drivers/pci/pcie/aer/aerdrv.c | 6 -----
drivers/pci/pcie/portdrv.h | 4 +--
drivers/pci/pcie/portdrv_core.c | 14 +++++-------
drivers/pci/pcie/portdrv_pci.c | 43 ++++++++++++--------------------------
include/linux/pcieport_if.h | 2 -
6 files changed, 25 insertions(+), 48 deletions(-)
Index: linux-2.6/drivers/pci/pcie/portdrv_pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/pcie/portdrv_pci.c
+++ linux-2.6/drivers/pci/pcie/portdrv_pci.c
@@ -49,33 +49,21 @@ static int pcie_portdrv_restore_config(s
}
#ifdef CONFIG_PM
-static int pcie_portdrv_suspend(struct pci_dev *dev, pm_message_t state)
-{
- return pcie_port_device_suspend(dev, state);
-
-}
+static struct dev_pm_ops pcie_portdrv_pm_ops = {
+ .suspend = pcie_port_device_suspend,
+ .resume = pcie_port_device_resume,
+ .freeze = pcie_port_device_suspend,
+ .thaw = pcie_port_device_resume,
+ .poweroff = pcie_port_device_suspend,
+ .restore = pcie_port_device_resume,
+};
-static int pcie_portdrv_suspend_late(struct pci_dev *dev, pm_message_t state)
-{
- return pci_save_state(dev);
-}
+#define PCIE_PORTDRV_PM_OPS (&pcie_portdrv_pm_ops)
-static int pcie_portdrv_resume_early(struct pci_dev *dev)
-{
- return pci_restore_state(dev);
-}
+#else /* !PM */
-static int pcie_portdrv_resume(struct pci_dev *dev)
-{
- pcie_portdrv_restore_config(dev);
- return pcie_port_device_resume(dev);
-}
-#else
-#define pcie_portdrv_suspend NULL
-#define pcie_portdrv_suspend_late NULL
-#define pcie_portdrv_resume_early NULL
-#define pcie_portdrv_resume NULL
-#endif
+#define PCIE_PORTDRV_PM_OPS NULL
+#endif /* !PM */
/*
* pcie_portdrv_probe - Probe PCI-Express port devices
@@ -291,12 +279,9 @@ static struct pci_driver pcie_portdriver
.probe = pcie_portdrv_probe,
.remove = pcie_portdrv_remove,
- .suspend = pcie_portdrv_suspend,
- .suspend_late = pcie_portdrv_suspend_late,
- .resume_early = pcie_portdrv_resume_early,
- .resume = pcie_portdrv_resume,
-
.err_handler = &pcie_portdrv_err_handler,
+
+ .driver.pm = PCIE_PORTDRV_PM_OPS,
};
static int __init pcie_portdrv_init(void)
Index: linux-2.6/drivers/pci/pcie/portdrv.h
===================================================================
--- linux-2.6.orig/drivers/pci/pcie/portdrv.h
+++ linux-2.6/drivers/pci/pcie/portdrv.h
@@ -36,8 +36,8 @@ extern struct bus_type pcie_port_bus_typ
extern int pcie_port_device_probe(struct pci_dev *dev);
extern int pcie_port_device_register(struct pci_dev *dev);
#ifdef CONFIG_PM
-extern int pcie_port_device_suspend(struct pci_dev *dev, pm_message_t state);
-extern int pcie_port_device_resume(struct pci_dev *dev);
+extern int pcie_port_device_suspend(struct device *dev);
+extern int pcie_port_device_resume(struct device *dev);
#endif
extern void pcie_port_device_remove(struct pci_dev *dev);
extern int __must_check pcie_port_bus_register(void);
Index: linux-2.6/drivers/pci/pcie/portdrv_core.c
===================================================================
--- linux-2.6.orig/drivers/pci/pcie/portdrv_core.c
+++ linux-2.6/drivers/pci/pcie/portdrv_core.c
@@ -280,13 +280,12 @@ int pcie_port_device_register(struct pci
static int suspend_iter(struct device *dev, void *data)
{
struct pcie_port_service_driver *service_driver;
- pm_message_t state = * (pm_message_t *) data;
if ((dev->bus == &pcie_port_bus_type) &&
(dev->driver)) {
service_driver = to_service_driver(dev->driver);
if (service_driver->suspend)
- service_driver->suspend(to_pcie_device(dev), state);
+ service_driver->suspend(to_pcie_device(dev));
}
return 0;
}
@@ -294,11 +293,10 @@ static int suspend_iter(struct device *d
/**
* pcie_port_device_suspend - suspend port services associated with a PCIe port
* @dev: PCI Express port to handle
- * @state: Representation of system power management transition in progress
*/
-int pcie_port_device_suspend(struct pci_dev *dev, pm_message_t state)
+int pcie_port_device_suspend(struct device *dev)
{
- return device_for_each_child(&dev->dev, &state, suspend_iter);
+ return device_for_each_child(dev, NULL, suspend_iter);
}
static int resume_iter(struct device *dev, void *data)
@@ -318,11 +316,11 @@ static int resume_iter(struct device *de
* pcie_port_device_suspend - resume port services associated with a PCIe port
* @dev: PCI Express port to handle
*/
-int pcie_port_device_resume(struct pci_dev *dev)
+int pcie_port_device_resume(struct device *dev)
{
- return device_for_each_child(&dev->dev, NULL, resume_iter);
+ return device_for_each_child(dev, NULL, resume_iter);
}
-#endif
+#endif /* PM */
static int remove_iter(struct device *dev, void *data)
{
Index: linux-2.6/include/linux/pcieport_if.h
===================================================================
--- linux-2.6.orig/include/linux/pcieport_if.h
+++ linux-2.6/include/linux/pcieport_if.h
@@ -59,7 +59,7 @@ struct pcie_port_service_driver {
int (*probe) (struct pcie_device *dev,
const struct pcie_port_service_id *id);
void (*remove) (struct pcie_device *dev);
- int (*suspend) (struct pcie_device *dev, pm_message_t state);
+ int (*suspend) (struct pcie_device *dev);
int (*resume) (struct pcie_device *dev);
/* Service Error Recovery Handler */
Index: linux-2.6/drivers/pci/pcie/aer/aerdrv.c
===================================================================
--- linux-2.6.orig/drivers/pci/pcie/aer/aerdrv.c
+++ linux-2.6/drivers/pci/pcie/aer/aerdrv.c
@@ -41,9 +41,6 @@ MODULE_LICENSE("GPL");
static int __devinit aer_probe (struct pcie_device *dev,
const struct pcie_port_service_id *id );
static void aer_remove(struct pcie_device *dev);
-static int aer_suspend(struct pcie_device *dev, pm_message_t state)
-{return 0;}
-static int aer_resume(struct pcie_device *dev) {return 0;}
static pci_ers_result_t aer_error_detected(struct pci_dev *dev,
enum pci_channel_state error);
static void aer_error_resume(struct pci_dev *dev);
@@ -74,9 +71,6 @@ static struct pcie_port_service_driver a
.probe = aer_probe,
.remove = aer_remove,
- .suspend = aer_suspend,
- .resume = aer_resume,
-
.err_handler = &aer_error_handlers,
.reset_link = aer_root_reset,
Index: linux-2.6/drivers/pci/hotplug/pciehp_core.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/pciehp_core.c
+++ linux-2.6/drivers/pci/hotplug/pciehp_core.c
@@ -468,7 +468,7 @@ static void pciehp_remove (struct pcie_d
}
#ifdef CONFIG_PM
-static int pciehp_suspend (struct pcie_device *dev, pm_message_t state)
+static int pciehp_suspend (struct pcie_device *dev)
{
dev_info(&dev->device, "%s ENTRY\n", __func__);
return 0;
@@ -496,7 +496,7 @@ static int pciehp_resume (struct pcie_de
}
return 0;
}
-#endif
+#endif /* PM */
static struct pcie_port_service_id port_pci_ids[] = { {
.vendor = PCI_ANY_ID,
next prev parent reply other threads:[~2009-01-31 0:39 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-29 0:14 2.6.29-rc3: tg3 dead after resume Parag Warudkar
2009-01-29 1:09 ` Linus Torvalds
2009-01-29 1:49 ` Parag Warudkar
2009-01-29 2:10 ` Linus Torvalds
2009-01-29 2:19 ` Matt Carlson
2009-01-29 22:22 ` Rafael J. Wysocki
2009-01-29 18:42 ` Matt Carlson
2009-01-29 22:06 ` Parag Warudkar
2009-01-29 22:22 ` Matt Carlson
2009-01-29 22:35 ` Parag Warudkar
2009-01-29 23:10 ` Rafael J. Wysocki
2009-01-30 18:40 ` Matt Carlson
2009-01-30 22:50 ` Parag Warudkar
2009-01-30 23:06 ` Linus Torvalds
2009-01-30 23:33 ` Linus Torvalds
2009-01-30 23:45 ` Parag Warudkar
2009-01-30 23:57 ` Linus Torvalds
2009-01-30 23:59 ` Rafael J. Wysocki
2009-01-31 0:28 ` Parag Warudkar
2009-01-31 0:38 ` Rafael J. Wysocki [this message]
2009-01-31 0:44 ` Ingo Molnar
2009-01-31 0:47 ` Rafael J. Wysocki
2009-01-31 1:21 ` Parag Warudkar
2009-01-31 1:37 ` Rafael J. Wysocki
2009-01-31 1:42 ` Parag Warudkar
2009-02-03 9:29 ` Rafael J. Wysocki
2009-02-03 21:27 ` Parag Warudkar
2009-02-03 22:15 ` Rafael J. Wysocki
2009-02-04 0:38 ` Parag Warudkar
2009-02-04 0:41 ` Rafael J. Wysocki
2009-02-07 3:00 ` Linus Torvalds
2009-02-07 18:03 ` Jesse Barnes
2009-01-31 1:46 ` Linus Torvalds
2009-01-31 1:54 ` Parag Warudkar
2009-01-31 2:25 ` Linus Torvalds
2009-01-31 2:40 ` Parag Warudkar
2009-01-31 18:51 ` Rafael J. Wysocki
2009-01-31 2:19 ` Linus Torvalds
2009-01-31 20:45 ` Rafael J. Wysocki
2009-01-31 1:41 ` Linus Torvalds
2009-01-31 21:08 ` Rafael J. Wysocki
2009-01-31 21:42 ` What should PCI core do during suspend-resume? (was: Re: 2.6.29-rc3: tg3 dead after resume) Rafael J. Wysocki
2009-01-31 21:59 ` Linus Torvalds
2009-01-31 23:08 ` Rafael J. Wysocki
2009-01-31 23:27 ` Linus Torvalds
2009-01-31 23:39 ` Linus Torvalds
2009-02-01 0:36 ` Rafael J. Wysocki
2009-02-01 1:06 ` Linus Torvalds
2009-02-01 1:13 ` Linus Torvalds
2009-02-01 1:20 ` Arjan van de Ven
2009-02-01 1:24 ` Rafael J. Wysocki
2009-02-07 9:21 ` Pavel Machek
2009-01-31 21:47 ` 2.6.29-rc3: tg3 dead after resume Linus Torvalds
2009-01-31 22:46 ` Rafael J. Wysocki
2009-01-31 23:01 ` Linus Torvalds
2009-02-01 0:11 ` Rafael J. Wysocki
2009-02-01 0:32 ` Linus Torvalds
2009-02-01 0:41 ` Rafael J. Wysocki
2009-02-01 0:51 ` Linus Torvalds
2009-02-07 3:27 ` Benjamin Herrenschmidt
2009-02-07 3:26 ` Benjamin Herrenschmidt
2009-01-29 23:03 ` Rafael J. Wysocki
2009-01-29 23:41 ` Matt Carlson
2009-01-30 0:10 ` Rafael J. Wysocki
2009-01-30 22:31 ` Parag Warudkar
2009-01-30 22:36 ` Linus Torvalds
2009-01-30 22:54 ` Rafael J. Wysocki
2009-01-30 23:07 ` Linus Torvalds
2009-01-30 23:13 ` Parag Warudkar
2009-01-30 23:31 ` Rafael J. Wysocki
2009-01-30 23:51 ` Linus Torvalds
2009-01-31 0:07 ` Rafael J. Wysocki
2009-01-31 0:34 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200901310138.51214.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mcarlson@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=parag.lkml@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).