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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:35 +0000 (19:12 +0100)
commit4396c507a8f8022e6f5bde4cf4728cab0f50cff8
treed7b5c475b06fbe08c0dcb6707973e26a579d5abd
parentbc988b1261344c4254dbc46fa7d2b98890931ff2
PCI: mvebu: Fix support for bus mastering and PCI_COMMAND on emulated bridge

[ Upstream commit e42b85583719adb87ab88dc7bcd41b38011f7d11 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pci-mvebu.c