From d3d0fd7d5e34128054210e257de24f7a954573f6 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Mon, 7 Sep 2020 16:15:14 +0200 Subject: device: Enable bus mastering on system-class devices conditionally Devices of class type "system" are arbitrary devices and it's not clear which of them need bus mastering. Therefore, enable bus mastering conditionally based on Kconfig option PCI_ALLOW_BUS_MASTER_ANY_DEVICE. Change-Id: Ia04e83606a0a081c0758ec59e52627aa1dbd2622 Signed-off-by: Felix Singer Reviewed-on: https://review.coreboot.org/c/coreboot/+/45151 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- src/device/pci_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/device') diff --git a/src/device/pci_device.c b/src/device/pci_device.c index f4608fc7f2..c3f356413f 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -1129,7 +1129,8 @@ struct device *pci_probe_dev(struct device *dev, struct bus *bus, dev->class = class >> 8; /* Architectural/System devices always need to be bus masters. */ - if ((dev->class >> 16) == PCI_BASE_CLASS_SYSTEM) + if ((dev->class >> 16) == PCI_BASE_CLASS_SYSTEM && + CONFIG(PCI_ALLOW_BUS_MASTER_ANY_DEVICE)) dev->command |= PCI_COMMAND_MASTER; /* -- cgit v1.2.3