From: Yu, Luming Date: Tue, 25 Apr 2006 07:00:34 +0000 (-0700) Subject: [PATCH] PCI: reverse pci config space restore order X-Git-Tag: v2.6.17~25^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b8c8d280ab2d18fe6e42d671f60d4ffed451cdc;p=platform%2Fkernel%2Flinux-3.10.git [PATCH] PCI: reverse pci config space restore order According to Intel ICH spec, there are several rules that Base Address should be programmed before IOSE (PCICMD register ) enabled. For example ICH7: 12.1.3 SATA : the base address register for the bus master register should be programmed before this bit is set. 11.1.3: PCICMD (USB): The base address register for USB should be programmed before this bit is set. .... To make sure kernel code follow this rule , and prevent unnecessary confusion. I proposal this patch. Signed-off-by: Luming Yu Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d252045..1228627 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -463,7 +463,11 @@ pci_restore_state(struct pci_dev *dev) int i; int val; - for (i = 0; i < 16; i++) { + /* + * The Base Address register should be programmed before the command + * register(s) + */ + for (i = 15; i >= 0; i--) { pci_read_config_dword(dev, i * 4, &val); if (val != dev->saved_config_space[i]) { printk(KERN_DEBUG "PM: Writing back config space on "