Don't enable I/O or memory mode in a device's command register if the BAR
we are processing has a base address of zero. Note that this will only change behavior for devices where all the BARs of a given type have a base address of 0 since we will enable the appropriate access when we encounter the first BAR with a base that is not 0. Specifically, this allows certain Toshiba laptops to no longer require 'hw.pci.enable_io_modes=0' to avoid hangs during boot. PR: kern/20040 PR: i386/63776 (possibly) PR: i386/68900 (possibly) PR: i386/74532 (possibly) MFC after: 1 week
This commit is contained in:
parent
71ed2c3c59
commit
4081108643
@ -822,6 +822,13 @@ pci_add_map(device_t pcib, device_t bus, device_t dev,
|
||||
printf(", enabled\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* If base is 0, then we have problems. It is best to ignore
|
||||
* such entires for the moment. These will be allocated later if
|
||||
* the driver specifically requests them.
|
||||
*/
|
||||
if (base == 0)
|
||||
return 1;
|
||||
/*
|
||||
* This code theoretically does the right thing, but has
|
||||
* undesirable side effects in some cases where peripherals
|
||||
@ -847,13 +854,6 @@ pci_add_map(device_t pcib, device_t bus, device_t dev,
|
||||
if (type == SYS_RES_MEMORY && !pci_memen(pcib, b, s, f))
|
||||
return (1);
|
||||
}
|
||||
/*
|
||||
* If base is 0, then we have problems. It is best to ignore
|
||||
* such entires for the moment. These will be allocated later if
|
||||
* the driver specifically requests them.
|
||||
*/
|
||||
if (base == 0)
|
||||
return 1;
|
||||
|
||||
start = base;
|
||||
end = base + (1 << ln2size) - 1;
|
||||
|
Loading…
Reference in New Issue
Block a user