Re: Machine crashes right *after* ~successful resume

From: Yinghai Lu
Date: Fri Oct 31 2014 - 22:11:21 EST


On Fri, Oct 31, 2014 at 5:00 PM, Wilmer van der Gaast <wilmer@xxxxxxxxx> wrote:
> Hello,
>
> Patch #1 worked after a simple s/&&/)/. And patch #2 seems to fix the
> problem as well!

updated first #1.
---
drivers/pci/pci.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

Index: linux-2.6/drivers/pci/pci.c
===================================================================
--- linux-2.6.orig/drivers/pci/pci.c
+++ linux-2.6/drivers/pci/pci.c
@@ -1265,6 +1265,24 @@ static void pci_enable_bridge(struct pci
pci_set_master(dev);
}

+static void pci_enable_ite(struct pci_dev *dev)
+{
+ /*
+ * FW enable the bridge already, so call pci_enable_bridge()
+ * to keep enable_cnt consistent, then later we can go through
+ * pci_pm_resume/pci_pm_reenable_device to enable it again.
+ * --- for pci bridge without driver case.
+ */
+ if (!pci_is_enabled(dev)) {
+ u16 cmd;
+
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY))
+ pci_enable_bridge(dev);
+ }
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ITE, 0x8892, pci_enable_ite);
+
static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
{
struct pci_dev *bridge;