PCI: mvebu: Fix support for bus mastering and PCI_COMMAND on emulated bridge
authorPali Rohár <pali@kernel.org>
Thu, 25 Nov 2021 12:45:56 +0000 (13:45 +0100)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 4 Jan 2022 14:58:43 +0000 (14:58 +0000)
commite42b85583719adb87ab88dc7bcd41b38011f7d11
treeea4fa8ca12294177ba9221785bee835186ddba02
parent319e6046bd5a59e09c1a08fd6f6929df4ae9a1dc
PCI: mvebu: Fix support for bus mastering and PCI_COMMAND on emulated bridge

According to PCI specifications bits [0:2] of Command Register, this should
be by default disabled on reset. So explicitly disable these bits at early
beginning of driver initialization.

Also remove code which unconditionally enables all 3 bits and let kernel
code (via pci_set_master() function) to handle bus mastering of PCI Bridge
via emulated PCI_COMMAND on emulated bridge.

Adjust existing functions mvebu_pcie_handle_iobase_change() and
mvebu_pcie_handle_membase_change() to handle PCI_IO_BASE and PCI_MEM_BASE
registers correctly even when bus mastering on emulated bridge is disabled.

Link: https://lore.kernel.org/r/20211125124605.25915-7-pali@kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/controller/pci-mvebu.c