linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* RFC: Only deal with apple fix if res is memory
@ 2008-01-11 16:38 Kumar Gala
  2008-01-11 22:03 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2008-01-11 16:38 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

Ben,

Will this impact the apple fix?  I'm getting some _IO cases hitting this.

- 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"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: RFC: Only deal with apple fix if res is memory
  2008-01-11 16:38 RFC: Only deal with apple fix if res is memory Kumar Gala
@ 2008-01-11 22:03 ` Benjamin Herrenschmidt
  2008-01-12 23:05   ` Kumar Gala
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2008-01-11 22:03 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev


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"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: RFC: Only deal with apple fix if res is memory
  2008-01-11 22:03 ` Benjamin Herrenschmidt
@ 2008-01-12 23:05   ` Kumar Gala
  0 siblings, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2008-01-12 23:05 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev


On Jan 11, 2008, at 4:03 PM, Benjamin Herrenschmidt wrote:

>
> 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.

ok, will clean up the patch and resend.

- k

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-12 23:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11 16:38 RFC: Only deal with apple fix if res is memory Kumar Gala
2008-01-11 22:03 ` Benjamin Herrenschmidt
2008-01-12 23:05   ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).