Commit e33bb65b authored by Jiaxun Yang's avatar Jiaxun Yang Committed by Khalid Elmously

PCI: Don't disable decoding when mmio_always_on is set

BugLink: https://bugs.launchpad.net/bugs/1884564

[ Upstream commit b6caa1d8 ]

Don't disable MEM/IO decoding when a device have both non_compliant_bars
and mmio_always_on.

That would allow us quirk devices with junk in BARs but can't disable
their decoding.
Signed-off-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
Acked-by: default avatarBjorn Helgaas <helgaas@kernel.org>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent be7a420a
......@@ -1243,7 +1243,7 @@ int pci_setup_device(struct pci_dev *dev)
/* device class may be changed after fixup */
class = dev->class >> 8;
if (dev->non_compliant_bars) {
if (dev->non_compliant_bars && !dev->mmio_always_on) {
pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
dev_info(&dev->dev, "device has non-compliant BARs; disabling IO/MEM decoding\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment