[PATCH] mark PCI resource with start 0 as unassigned

Segher Boessenkool segher at kernel.crashing.org
Tue Dec 5 00:05:22 EST 2006


>>> --- a/arch/powerpc/kernel/pci_64.c
>>> +++ b/arch/powerpc/kernel/pci_64.c
>>> @@ -1234,6 +1234,14 @@ static void __devinit fixup_resource(str
>>> 	struct pci_controller *hose = pci_bus_to_host(dev->bus);
>>> 	unsigned long start, end, mask, offset;
>>>
>>> +	/*
>>> +	 * tell the core code that this ressource is unassigned
>>> +	 * fixes p630 winbond IDE with libata
>>> +	 */
>>> +	if (res->start == 0) {
>>> +		res->flags = 0;
>>> +		return;
>>> +	}
>>> 	if (res->flags & IORESOURCE_IO) {
>>> 		offset = (unsigned long)hose->io_base_virt - pci_io_base;
>>
>> Please make this run on pSeries only; on a PowerMac for
>
> I could just match for winbond an start == 0.

Why not fix it properly?  The "0 means unassigned" thing is
something this specific firmware does, it is not a standard
or anything, and certainly not a property of the winbond
hardware (it _will_ react to legacy I/O at address 0).

So make this new code only run when this firmware is used,
too (perhaps do a check in prom_init and remove this BAR
from the assigned addresses property?)


Segher




More information about the Linuxppc-dev mailing list