提交 0ebbb379 编写于 作者: J Jiaxun Yang 提交者: Yang Yingliang

PCI: Don't disable decoding when mmio_always_on is set

stable inclusion
from linux-4.19.129
commit 40a94a1ac783b878ec083b87242450949ae26eaf

--------------------------------

[ 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: NJiaxun Yang <jiaxun.yang@flygoat.com>
Acked-by: NBjorn Helgaas <helgaas@kernel.org>
Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 6cf457d1
...@@ -1690,7 +1690,7 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1690,7 +1690,7 @@ int pci_setup_device(struct pci_dev *dev)
/* Device class may be changed after fixup */ /* Device class may be changed after fixup */
class = dev->class >> 8; 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); pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
pci_info(dev, "device has non-compliant BARs; disabling IO/MEM decoding\n"); pci_info(dev, "device has non-compliant BARs; disabling IO/MEM decoding\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册