Skip to content

Commit 0f7f2fb

Browse files
nathanlynchpaulusmack
authored andcommitted
[POWERPC] Remove gratuitous reads from powermac pci config space methods
The powermac pci configuration space write methods read the written location immediately after the write is performed, presumably in order to flush the write. However, configuration space writes are not allowed to be posted, making these reads gratuitous. Furthermore, this behavior potentially causes us to violate the PCI PM spec when changing between e.g. D0 and D3 states, because a delay of up to 10ms may be required before the OS accesses configuration space after the write which initiates the transition. Remove the unnecessary reads from macrisc_write_config, u3_ht_write_config, and u4_pcie_write_config. Signed-off-by: Nathan Lynch <ntl@pobox.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent b139f1f commit 0f7f2fb

File tree

1 file changed

+0
-9
lines changed
  • arch/powerpc/platforms/powermac

1 file changed

+0
-9
lines changed

arch/powerpc/platforms/powermac/pci.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,12 @@ static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
209209
switch (len) {
210210
case 1:
211211
out_8(addr, val);
212-
(void) in_8(addr);
213212
break;
214213
case 2:
215214
out_le16(addr, val);
216-
(void) in_le16(addr);
217215
break;
218216
default:
219217
out_le32(addr, val);
220-
(void) in_le32(addr);
221218
break;
222219
}
223220
return PCIBIOS_SUCCESSFUL;
@@ -440,15 +437,12 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
440437
switch (len) {
441438
case 1:
442439
out_8(addr, val);
443-
(void) in_8(addr);
444440
break;
445441
case 2:
446442
out_le16(addr, val);
447-
(void) in_le16(addr);
448443
break;
449444
default:
450445
out_le32((u32 __iomem *)addr, val);
451-
(void) in_le32(addr);
452446
break;
453447
}
454448
return PCIBIOS_SUCCESSFUL;
@@ -545,15 +539,12 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
545539
switch (len) {
546540
case 1:
547541
out_8(addr, val);
548-
(void) in_8(addr);
549542
break;
550543
case 2:
551544
out_le16(addr, val);
552-
(void) in_le16(addr);
553545
break;
554546
default:
555547
out_le32(addr, val);
556-
(void) in_le32(addr);
557548
break;
558549
}
559550
return PCIBIOS_SUCCESSFUL;

0 commit comments

Comments
 (0)