2008-01-11 08:30:31

by Kumar Gala

[permalink] [raw]
Subject: PCI Failed to allocate mem for PCI ROM

Greg,

I'm getting the following message from the kernel on an embedded ppc32
system:

PCI: Failed to allocate mem resource #9:100000@e0000000 for 0000:00:00.0

The HW setup is a PCIe host controller and an e1000 NIC card. It
appears that pci_bus_assign_resources() is trying to call
pci_assign_resource() for the ROM and the resource for the ROM is
[100000:1fffff] where the PHB is [c0000000:dfffffff].

It seems like the resno that pci_assign_resource is getting called
with is wrong and thus pci_update_resource() doesn't get called.

any ideas?

- k


2008-01-11 08:41:57

by Jiri Slaby

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM

On 01/11/2008 09:29 AM, Kumar Gala wrote:
> Greg,
>
> I'm getting the following message from the kernel on an embedded ppc32
> system:
>
> PCI: Failed to allocate mem resource #9:100000@e0000000 for 0000:00:00.0
>
> The HW setup is a PCIe host controller and an e1000 NIC card. It
> appears that pci_bus_assign_resources() is trying to call
> pci_assign_resource() for the ROM and the resource for the ROM is
> [100000:1fffff] where the PHB is [c0000000:dfffffff].
>
> It seems like the resno that pci_assign_resource is getting called with
> is wrong and thus pci_update_resource() doesn't get called.
>
> any ideas?

Kernel version, please.

2008-01-11 09:08:09

by Kumar Gala

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM


On Jan 11, 2008, at 2:41 AM, Jiri Slaby wrote:

> On 01/11/2008 09:29 AM, Kumar Gala wrote:
>> Greg,
>> I'm getting the following message from the kernel on an embedded
>> ppc32 system:
>> PCI: Failed to allocate mem resource #9:100000@e0000000 for
>> 0000:00:00.0
>> The HW setup is a PCIe host controller and an e1000 NIC card. It
>> appears that pci_bus_assign_resources() is trying to call
>> pci_assign_resource() for the ROM and the resource for the ROM is
>> [100000:1fffff] where the PHB is [c0000000:dfffffff].
>> It seems like the resno that pci_assign_resource is getting called
>> with is wrong and thus pci_update_resource() doesn't get called.
>> any ideas?
>
> Kernel version, please.

Sorry, its 2.6.24-rc7 + some ppc patches queued for 2.6.25

- k

2008-01-11 09:13:44

by Jiri Slaby

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM

On 01/11/2008 10:07 AM, Kumar Gala wrote:
>
> On Jan 11, 2008, at 2:41 AM, Jiri Slaby wrote:
>
>> On 01/11/2008 09:29 AM, Kumar Gala wrote:
>>> Greg,
>>> I'm getting the following message from the kernel on an embedded
>>> ppc32 system:
>>> PCI: Failed to allocate mem resource #9:100000@e0000000 for 0000:00:00.0
>>> The HW setup is a PCIe host controller and an e1000 NIC card. It
>>> appears that pci_bus_assign_resources() is trying to call
>>> pci_assign_resource() for the ROM and the resource for the ROM is
>>> [100000:1fffff] where the PHB is [c0000000:dfffffff].
>>> It seems like the resno that pci_assign_resource is getting called
>>> with is wrong and thus pci_update_resource() doesn't get called.
>>> any ideas?
>>
>> Kernel version, please.
>
> Sorry, its 2.6.24-rc7 + some ppc patches queued for 2.6.25

Could you try this patch?
http://git.kernel.org/?p=linux/kernel/git/gregkh/patches.git;a=blob_plain;f=pci/pci-remove-default-pci-expansion-rom-memory-allocation.patch

Greg: is this 2.6.25 material, please? We need this for SP2.

thanks,
--
Jiri Slaby
Faculty of Informatics, Masaryk University
Suse Labs

2008-01-11 15:41:36

by Kumar Gala

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM


On Jan 11, 2008, at 3:13 AM, Jiri Slaby wrote:

> On 01/11/2008 10:07 AM, Kumar Gala wrote:
>> On Jan 11, 2008, at 2:41 AM, Jiri Slaby wrote:
>>> On 01/11/2008 09:29 AM, Kumar Gala wrote:
>>>> Greg,
>>>> I'm getting the following message from the kernel on an embedded
>>>> ppc32 system:
>>>> PCI: Failed to allocate mem resource #9:100000@e0000000 for
>>>> 0000:00:00.0
>>>> The HW setup is a PCIe host controller and an e1000 NIC card. It
>>>> appears that pci_bus_assign_resources() is trying to call
>>>> pci_assign_resource() for the ROM and the resource for the ROM is
>>>> [100000:1fffff] where the PHB is [c0000000:dfffffff].
>>>> It seems like the resno that pci_assign_resource is getting
>>>> called with is wrong and thus pci_update_resource() doesn't get
>>>> called.
>>>> any ideas?
>>>
>>> Kernel version, please.
>> Sorry, its 2.6.24-rc7 + some ppc patches queued for 2.6.25
>
> Could you try this patch?
> http://git.kernel.org/?p=linux/kernel/git/gregkh/patches.git;a=blob_plain;f=pci/pci-remove-default-pci-expansion-rom-memory-allocation.patch
>
> Greg: is this 2.6.25 material, please? We need this for SP2.

I saw that patch, but if you notice that its just x86 specific and I'm
having the issue on a powerpc 32-bit system.

- k

2008-01-11 16:52:19

by Jiri Slaby

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM

Kumar Gala napsal(a):
> I saw that patch, but if you notice that its just x86 specific and I'm
> having the issue on a powerpc 32-bit system.

My bad, sorry.

2008-01-11 17:50:38

by Greg KH

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM

On Fri, Jan 11, 2008 at 10:13:23AM +0100, Jiri Slaby wrote:
> On 01/11/2008 10:07 AM, Kumar Gala wrote:
>> On Jan 11, 2008, at 2:41 AM, Jiri Slaby wrote:
>>> On 01/11/2008 09:29 AM, Kumar Gala wrote:
>>>> Greg,
>>>> I'm getting the following message from the kernel on an embedded ppc32
>>>> system:
>>>> PCI: Failed to allocate mem resource #9:100000@e0000000 for 0000:00:00.0
>>>> The HW setup is a PCIe host controller and an e1000 NIC card. It
>>>> appears that pci_bus_assign_resources() is trying to call
>>>> pci_assign_resource() for the ROM and the resource for the ROM is
>>>> [100000:1fffff] where the PHB is [c0000000:dfffffff].
>>>> It seems like the resno that pci_assign_resource is getting called with
>>>> is wrong and thus pci_update_resource() doesn't get called.
>>>> any ideas?
>>>
>>> Kernel version, please.
>> Sorry, its 2.6.24-rc7 + some ppc patches queued for 2.6.25
>
> Could you try this patch?
> http://git.kernel.org/?p=linux/kernel/git/gregkh/patches.git;a=blob_plain;f=pci/pci-remove-default-pci-expansion-rom-memory-allocation.patch
>
> Greg: is this 2.6.25 material, please? We need this for SP2.

Yes, this is queued up for 2.6.25, and I have no objection to adding it
for SLE10 SP2 if needed. But I think there is another patch in the
series that also goes with this, ask IBM, they know what is needed here.

thanks,

greg k-h

2008-01-11 17:50:52

by Greg KH

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM

On Fri, Jan 11, 2008 at 02:29:28AM -0600, Kumar Gala wrote:
> Greg,
>
> I'm getting the following message from the kernel on an embedded ppc32
> system:
>
> PCI: Failed to allocate mem resource #9:100000@e0000000 for 0000:00:00.0
>
> The HW setup is a PCIe host controller and an e1000 NIC card. It appears
> that pci_bus_assign_resources() is trying to call pci_assign_resource() for
> the ROM and the resource for the ROM is [100000:1fffff] where the PHB is
> [c0000000:dfffffff].
>
> It seems like the resno that pci_assign_resource is getting called with is
> wrong and thus pci_update_resource() doesn't get called.
>
> any ideas?

Nope, sorry, any help debugging this is appreciated, pci resource
allocation is "tricky" :)

thanks,

greg k-h

2008-01-11 20:27:33

by Kumar Gala

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM


On Jan 11, 2008, at 11:50 AM, Greg KH wrote:

> On Fri, Jan 11, 2008 at 02:29:28AM -0600, Kumar Gala wrote:
>> Greg,
>>
>> I'm getting the following message from the kernel on an embedded
>> ppc32
>> system:
>>
>> PCI: Failed to allocate mem resource #9:100000@e0000000 for
>> 0000:00:00.0
>>
>> The HW setup is a PCIe host controller and an e1000 NIC card. It
>> appears
>> that pci_bus_assign_resources() is trying to call
>> pci_assign_resource() for
>> the ROM and the resource for the ROM is [100000:1fffff] where the
>> PHB is
>> [c0000000:dfffffff].
>>
>> It seems like the resno that pci_assign_resource is getting called
>> with is
>> wrong and thus pci_update_resource() doesn't get called.
>>
>> any ideas?
>
> Nope, sorry, any help debugging this is appreciated, pci resource
> allocation is "tricky" :)

I'm happy to debug, is the fact that the resno == 9 ok or does that
seem wrong?

- k

2008-01-12 07:27:31

by Grant Grundler

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM

On Fri, Jan 11, 2008 at 02:27:16PM -0600, Kumar Gala wrote:
>>> I'm getting the following message from the kernel on an embedded ppc32
>>> system:
>>>
>>> PCI: Failed to allocate mem resource #9:100000@e0000000 for 0000:00:00.0
>>>
>>> The HW setup is a PCIe host controller and an e1000 NIC card.
...
> I'm happy to debug, is the fact that the resno == 9 ok or does that seem
> wrong?

That is fine for the Bridge. See include/linux/pci.h :
#define PCI_ROM_RESOURCE 6
#define PCI_BRIDGE_RESOURCES 7
#define PCI_NUM_RESOURCES 11

IIRC, Bridges may have two 32-bit or one 64-bit BAR, Expansion ROM BAR and
three "range" registers: IO Port, MMIO (Prefetchable and non-prefetchable).
The BRIDGE_RESOURCES (7-10) are what failed to be assigned for some reason.

Looking at setup-bus.c:pci_bridge_check_ranges(), I'm concluding that:
[7] is IO Range.
[8] is MMIO
[9] is Prefetchable MMIO
[10] no clue...maybe used by host PCI bus controllers.

0x100000 is 1MB and would be the minimum MMIO range that can be allocated.
So that looks right too. Probably need to find out what is allocating
0xe0000000 instead.

hth,
grant

2008-01-12 15:11:59

by Ivan Kokshaysky

[permalink] [raw]
Subject: Re: PCI Failed to allocate mem for PCI ROM

On Sat, Jan 12, 2008 at 12:27:05AM -0700, Grant Grundler wrote:
> Looking at setup-bus.c:pci_bridge_check_ranges(), I'm concluding that:
> [7] is IO Range.
> [8] is MMIO
> [9] is Prefetchable MMIO
> [10] no clue...maybe used by host PCI bus controllers.

#10 is for cardbus bridges, IIRC.

> 0x100000 is 1MB and would be the minimum MMIO range that can be allocated.
> So that looks right too. Probably need to find out what is allocating
> 0xe0000000 instead.

I believe that the setup-bus code just tried to allocate 1M ROM of some
device using prefetchable window of the bridge 0000:00:00.0. That failed,
probably because there is no MEM space left on the root bus, which is
perfectly OK. Then, the ROM might be successfully allocated in the
non-prefetchable MMIO space.

So, I don't see any problem in this situation. The only thing I could
suggest is to lower the log level in that message from KERN_ERR to
KERN_WARNING...

Ivan.