提交 72dc5601 编写于 作者: B Bjorn Helgaas

PCI: Don't convert BAR address to resource if dma_addr_t is too small

If dma_addr_t is too small to represent the BAR value,
pcibios_bus_to_resource() will fail, so just remember the BAR size directly
in the resource.  The resource is already marked UNSET, so we know the
address isn't valid anyway.
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 d1a313e4
...@@ -258,9 +258,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, ...@@ -258,9 +258,10 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
pci_write_config_dword(dev, pos, 0); pci_write_config_dword(dev, pos, 0);
pci_write_config_dword(dev, pos + 4, 0); pci_write_config_dword(dev, pos + 4, 0);
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
region.start = 0; res->start = 0;
region.end = sz64; res->end = sz64;
bar_disabled = true; bar_disabled = true;
goto out;
} else { } else {
region.start = l64; region.start = l64;
region.end = l64 + sz64; region.end = l64 + sz64;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册