Re: PCI hotplug problems: how to debug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 16, 2009 at 11:54 AM, Ira W. Snyder <iws@xxxxxxxxxxxxxxxx> wrote:
> On Mon, Nov 16, 2009 at 11:45:53AM -0800, Yinghai Lu wrote:
>
> [ big snip ]
>
>> >
>> > So I know how many resources I've consumed so far. The same dev->bus
>> > structure is given to me for both host bridges. I wanted to keep track
>> > of which dev->bus->resource[i] files I'd filled in so far.
>> >
>> > Should I try and figure out which ones are not used so far?
>>
>> please check the one in intel_bus.c
>>
>
> Here is what I tried, using the code from intel_bus.c and amd_bus.c as
> examples. I've lost *ALL* of my PCI devices by using that code. But the
> kernel doesn't panic.
>
> Bjorn, you'll notice that the x86_pci_root_bus_res_quirks() function is
> called now. It seems to be called by the PCI layer if it is defined. It
> is normally a weak symbol on x86_32.
>
> Here is the patch I used, and output:
>
> From a3a9b51cc08912e4205a6f6225dd42ec59f38412 Mon Sep 17 00:00:00 2001
> From: Ira W. Snyder <iws@xxxxxxxxxxxxxxxx>
> Date: Mon, 16 Nov 2009 08:42:39 -0800
> Subject: [PATCH] PCI: read memory ranges out of Broadcom CNB20LE host bridge
>
> Read the memory ranges behind the Broadcom CNB20LE host bridge out of the
> hardware. This allows PCI hotplugging to work, since we know which memory
> range to allocate PCI BAR's from.

[    0.564036] pci 0000:00:05.0: BAR 0: reserving [mem
0xfe2bd000-0xfe2bdfff flags 0x20200] (d=0, p=0)
[    0.568013] pci 0000:00:05.0: no compatible bridge window for [mem
0xfe2bd000-0xfe2bdfff]
[    0.572012] pci 0000:00:05.0: can't reserve [mem 0xfe2bd000-0xfe2bdfff]
[    0.576013] pci 0000:00:05.0: BAR 1: reserving [io  0xde80-0xdebf
flags 0x20101] (d=0, p=0)
[    0.580012] pci 0000:00:05.0: no compatible bridge window for [io
0xde80-0xdebf]
[    0.584011] pci 0000:00:05.0: can't reserve [io  0xde80-0xdebf]
[    0.588014] pci 0000:00:05.0: BAR 2: reserving [mem
0xfcf00000-0xfcffffff flags 0x20200] (d=0, p=0)
[    0.592012] pci 0000:00:05.0: no compatible bridge window for [mem
0xfcf00000-0xfcffffff]
[    0.596011] pci 0000:00:05.0: can't reserve [mem 0xfcf00000-0xfcffffff]
[    0.600022] pci 0000:00:06.0: BAR 0: reserving [mem
0xfe2be000-0xfe2befff flags 0x20200] (d=0, p=0)
[    0.604012] pci 0000:00:06.0: no compatible bridge window for [mem
0xfe2be000-0xfe2befff]
[    0.608011] pci 0000:00:06.0: can't reserve [mem 0xfe2be000-0xfe2befff]
[    0.612013] pci 0000:00:06.0: BAR 1: reserving [io  0xdf00-0xdf3f
flags 0x20101] (d=0, p=0)
[    0.616012] pci 0000:00:06.0: no compatible bridge window for [io
0xdf00-0xdf3f]
[    0.620011] pci 0000:00:06.0: can't reserve [io  0xdf00-0xdf3f]
[    0.624014] pci 0000:00:06.0: BAR 2: reserving [mem
0xfe100000-0xfe1fffff flags 0x20200] (d=0, p=0)
[    0.628012] pci 0000:00:06.0: no compatible bridge window for [mem
0xfe100000-0xfe1fffff]
[    0.632011] pci 0000:00:06.0: can't reserve [mem 0xfe100000-0xfe1fffff]
[    0.636021] pci 0000:00:07.0: BAR 0: reserving [mem
0xfd000000-0xfdffffff flags 0x20200] (d=0, p=0)
[    0.640012] pci 0000:00:07.0: no compatible bridge window for [mem
0xfd000000-0xfdffffff]
[    0.644011] pci 0000:00:07.0: can't reserve [mem 0xfd000000-0xfdffffff]
[    0.648028] pci 0000:00:0f.1: BAR 0: reserving [io  0x01f0-0x01f7
flags 0x110] (d=0, p=0)
[    0.652012] pci 0000:00:0f.1: no compatible bridge window for [io
0x01f0-0x01f7]
[    0.656011] pci 0000:00:0f.1: can't reserve [io  0x01f0-0x01f7]
[    0.660013] pci 0000:00:0f.1: BAR 1: reserving [io  0x03f6 flags
0x110] (d=0, p=0)
[    0.664011] pci 0000:00:0f.1: no compatible bridge window for [io  0x03f6]
[    0.668011] pci 0000:00:0f.1: can't reserve [io  0x03f6]
[    0.672013] pci 0000:00:0f.1: BAR 2: reserving [io  0x0170-0x0177
flags 0x110] (d=0, p=0)
[    0.676012] pci 0000:00:0f.1: no compatible bridge window for [io
0x0170-0x0177]
[    0.680011] pci 0000:00:0f.1: can't reserve [io  0x0170-0x0177]
[    0.684013] pci 0000:00:0f.1: BAR 3: reserving [io  0x0376 flags
0x110] (d=0, p=0)
[    0.688011] pci 0000:00:0f.1: no compatible bridge window for [io  0x0376]
[    0.692011] pci 0000:00:0f.1: can't reserve [io  0x0376]
[    0.696014] pci 0000:00:0f.1: BAR 4: reserving [io  0xffa0-0xffaf
flags 0x20101] (d=0, p=0)
[    0.700012] pci 0000:00:0f.1: no compatible bridge window for [io
0xffa0-0xffaf]
[    0.704011] pci 0000:00:0f.1: can't reserve [io  0xffa0-0xffaf]
[    0.708021] pci 0000:00:0f.2: BAR 0: reserving [mem
0xfe2bf000-0xfe2bffff flags 0x20200] (d=0, p=0)
[    0.712012] pci 0000:00:0f.2: no compatible bridge window for [mem
0xfe2bf000-0xfe2bffff]
[    0.716012] pci 0000:00:0f.2: can't reserve [mem 0xfe2bf000-0xfe2bffff]

you may need to let bus 00: to have left range like

[TOM, 4G) subract the bus 01 is going to use.

amd_bus.c have some code to those subtraction...

YH
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux