pci: pci_mvebu: Fix read_config() with PCI_SIZE_8 or PCI_SIZE_16
authorPali Rohár <pali@kernel.org>
Fri, 22 Oct 2021 14:22:09 +0000 (16:22 +0200)
committerStefan Roese <sr@denx.de>
Wed, 3 Nov 2021 05:45:26 +0000 (06:45 +0100)
commit657177ad8e240ea520eba26da5c0ba47bd935787
tree5619cd3ba138948d2f14bb2b26f3044ecaa5fdb0
parentdaa9bfdb9cff9cc7ff0ad93383bbaf2bd618ab5e
pci: pci_mvebu: Fix read_config() with PCI_SIZE_8 or PCI_SIZE_16

When reading 8 or 16 bits from config space, use appropriate readb() or
readw() calls. This ensures that PCIe controller does not read more bits
from endpoint card as asked by read_config() function.

Technically there should not be an issue with reading data from config
space which are not later used as there are no clear-by-read registers.
But it is better to use correct read operation based on requested size.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/pci/pci_mvebu.c