Lines 175-180
int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
Link Here
|
175 |
u16 orig_cmd; |
175 |
u16 orig_cmd; |
176 |
struct pci_bus_region region, inverted_region; |
176 |
struct pci_bus_region region, inverted_region; |
177 |
bool bar_too_big = false, bar_too_high = false, bar_invalid = false; |
177 |
bool bar_too_big = false, bar_too_high = false, bar_invalid = false; |
|
|
178 |
bool bar_readonly = false; |
178 |
|
179 |
|
179 |
mask = type ? PCI_ROM_ADDRESS_MASK : ~0; |
180 |
mask = type ? PCI_ROM_ADDRESS_MASK : ~0; |
180 |
|
181 |
|
Lines 213-218
int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
Link Here
|
213 |
if (type == pci_bar_unknown) { |
214 |
if (type == pci_bar_unknown) { |
214 |
res->flags = decode_bar(dev, l); |
215 |
res->flags = decode_bar(dev, l); |
215 |
res->flags |= IORESOURCE_SIZEALIGN; |
216 |
res->flags |= IORESOURCE_SIZEALIGN; |
|
|
217 |
if (l == sz) |
218 |
res->flags |= IORESOURCE_PCI_FIXED; |
216 |
if (res->flags & IORESOURCE_IO) { |
219 |
if (res->flags & IORESOURCE_IO) { |
217 |
l &= PCI_BASE_ADDRESS_IO_MASK; |
220 |
l &= PCI_BASE_ADDRESS_IO_MASK; |
218 |
mask = PCI_BASE_ADDRESS_IO_MASK & (u32) IO_SPACE_LIMIT; |
221 |
mask = PCI_BASE_ADDRESS_IO_MASK & (u32) IO_SPACE_LIMIT; |
Lines 305-310
out:
Link Here
|
305 |
(orig_cmd & PCI_COMMAND_DECODE_ENABLE)) |
308 |
(orig_cmd & PCI_COMMAND_DECODE_ENABLE)) |
306 |
pci_write_config_word(dev, PCI_COMMAND, orig_cmd); |
309 |
pci_write_config_word(dev, PCI_COMMAND, orig_cmd); |
307 |
|
310 |
|
|
|
311 |
if (bar_readonly) |
312 |
dev_info(&dev->dev, FW_BUG "reg 0x%x: read-only; can't determine actual size and can't move it\n", |
313 |
pos); |
308 |
if (bar_too_big) |
314 |
if (bar_too_big) |
309 |
dev_err(&dev->dev, "reg 0x%x: can't handle BAR larger than 4GB (size %#010llx)\n", |
315 |
dev_err(&dev->dev, "reg 0x%x: can't handle BAR larger than 4GB (size %#010llx)\n", |
310 |
pos, (unsigned long long) sz64); |
316 |
pos, (unsigned long long) sz64); |