RFC: Only deal with apple fix if res is memory

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Jan 12 09:03:35 EST 2008


On Fri, 2008-01-11 at 10:38 -0600, Kumar Gala wrote:
> Ben,
> 
> Will this impact the apple fix?  I'm getting some _IO cases hitting this.

No, your fix is right, it's a bug to compare against pci_mem_offset and
not check if it's a memory resource in the first place. I would suggest
that you do the res->flags test first in the if () statement for clarity
though.

Cheers,
Ben.
 
> - k
> 
> diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
> index d394d41..42a9dab 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -807,6 +807,7 @@ static void __devinit __pcibios_fixup_bus(struct pci_bus *bus)
>  			 * their size is smaller than 1M.
>  			 */
>  			if (res->start == hose->pci_mem_offset &&
> +			    res->flags & IORESOURCE_MEM &&
>  			    res->end < 0x100000) {
>  				printk(KERN_INFO
>  				       "PCI: Closing bogus Apple Firmware"




More information about the Linuxppc-dev mailing list