Skip to content

Commit 40a85d6

Browse files
sumitsemwalgregkh
authored andcommitted
PCI: Decouple IORESOURCE_ROM_ENABLE and PCI_ROM_ADDRESS_ENABLE
From: Bjorn Helgaas <bhelgaas@google.com> [ Upstream commit 7a6d312b50e63f598f5b5914c4fd21878ac2b595 ] Remove the assumption that IORESOURCE_ROM_ENABLE == PCI_ROM_ADDRESS_ENABLE. PCI_ROM_ADDRESS_ENABLE is the ROM enable bit defined by the PCI spec, so if we're reading or writing a BAR register value, that's what we should use. IORESOURCE_ROM_ENABLE is a corresponding bit in struct resource flags. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1278c9f commit 40a85d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/pci/probe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
226226
mask64 = (u32)PCI_BASE_ADDRESS_MEM_MASK;
227227
}
228228
} else {
229-
res->flags |= (l & IORESOURCE_ROM_ENABLE);
229+
if (l & PCI_ROM_ADDRESS_ENABLE)
230+
res->flags |= IORESOURCE_ROM_ENABLE;
230231
l64 = l & PCI_ROM_ADDRESS_MASK;
231232
sz64 = sz & PCI_ROM_ADDRESS_MASK;
232233
mask64 = (u32)PCI_ROM_ADDRESS_MASK;

0 commit comments

Comments
 (0)