Skip to content

Commit

Permalink
PCI: Don't convert BAR address to resource if dma_addr_t is too small
Browse files Browse the repository at this point in the history
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: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Bjorn Helgaas committed May 23, 2014
1 parent d1a313e commit 72dc560
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 + 4, 0);
res->flags |= IORESOURCE_UNSET;
region.start = 0;
region.end = sz64;
res->start = 0;
res->end = sz64;
bar_disabled = true;
goto out;
} else {
region.start = l64;
region.end = l64 + sz64;
Expand Down

0 comments on commit 72dc560

Please sign in to comment.