Skip to content

Commit

Permalink
[PATCH] PCI: reverse pci config space restore order
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
lumingyu88 authored and gregkh committed Jun 11, 2006
1 parent 04d9c1a commit 8b8c8d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit 8b8c8d2

Please sign in to comment.