Skip to content

Commit

Permalink
ARM: cns3xxx: Use actual size reads for PCIe
Browse files Browse the repository at this point in the history
commit 802b7c0 ("ARM: cns3xxx: Convert PCI to use generic config
accessors") reimplemented cns3xxx_pci_read_config() using
pci_generic_config_read32(), which preserved the property of only doing
32-bit reads.

It also replaced cns3xxx_pci_write_config() with pci_generic_config_write(),
so it changed writes from always being 32 bits to being the actual size,
which works just fine.

Given that:

- The documentation does not mention that only 32 bit access is allowed.
- Writes are already executed using the actual size
- Extensive testing shows that 8b, 16b and 32b reads work as intended

Allow read access of any size by replacing pci_generic_config_read32()
with the pci_generic_config_read() accessors.

Fixes: 802b7c0 ("ARM: cns3xxx: Convert PCI to use generic config accessors")
Suggested-by: Bjorn Helgaas <[email protected]>
Signed-off-by: Koen Vandeputte <[email protected]>
[[email protected]: updated commit log]
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Acked-by: Krzysztof Halasa <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
CC: Krzysztof Halasa <[email protected]>
CC: Olof Johansson <[email protected]>
CC: Robin Leblon <[email protected]>
CC: Rob Herring <[email protected]>
CC: Russell King <[email protected]>
CC: Tim Harvey <[email protected]>
  • Loading branch information
Koen Vandeputte authored and bjorn-helgaas committed Jan 31, 2019
1 parent 65dbb42 commit 432dd70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-cns3xxx/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
u32 mask = (0x1ull << (size * 8)) - 1;
int shift = (where % 4) * 8;

ret = pci_generic_config_read32(bus, devfn, where, size, val);
ret = pci_generic_config_read(bus, devfn, where, size, val);

if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
(where & 0xffc) == PCI_CLASS_REVISION)
Expand Down

0 comments on commit 432dd70

Please sign in to comment.