]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
PCI: aardvark: Fix support for bus mastering and PCI_COMMAND on emulated bridge
authorPali Rohár <pali@kernel.org>
Thu, 25 Nov 2021 00:26:12 +0000 (01:26 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 3 Feb 2022 17:56:53 +0000 (18:56 +0100)
commit075f553a7817db22d6f1391459f540f8b6db3b1c
treeacc2d42c7b3c3d12a2460107be9775cba84fef50
parentfad6d51d7ea512fd687c2a3face7406b23a0abc4
PCI: aardvark: Fix support for bus mastering and PCI_COMMAND on emulated bridge

BugLink: https://bugs.launchpad.net/bugs/1956380
commit 771153fc884f566a89af2d30033b7f3bc6e24e84 upstream.

>From very vague, ambiguous and incomplete information from Marvell we
deduced that the 32-bit Aardvark register at address 0x4
(PCIE_CORE_CMD_STATUS_REG), which is not documented for Root Complex mode
in the Functional Specification (only for Endpoint mode), controls two
16-bit PCIe registers: Command Register and Status Registers of PCIe Root
Port.

This means that bit 2 controls bus mastering and forwarding of memory and
I/O requests in the upstream direction. 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 setup of the Aardvark
driver.

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

Link: https://lore.kernel.org/r/20211028185659.20329-5-kabel@kernel.org
Fixes: 8a3ebd8de328 ("PCI: aardvark: Implement emulated root PCI bridge config space")
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # b2a56469d550 ("PCI: aardvark: Add FIXME comment for PCIE_CORE_CMD_STATUS_REG access")
Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/pci/controller/pci-aardvark.c