ARM Versatile defconfig PCI io out of range?
Subsystems (4)
When I build from f9369910a6225b8d4892c3f20ae740a711cd5ace with versatile_defconfig, after making the changes described in
http://fedoraproject.org/wiki/Architectures/ARM/HowToQemu#Build_Kernel_Image_From_Source
Enabling PCI and the SYM53C8XX scsi disk driver, which aren't in the defconfig.
QEMU is run with the command
qemu-system-arm -M versatilepb \
-drive file=$diskimage,if=scsi \
-kernel linux/arch/arm/boot/zImage -append root=/dev/sda1
The system fails to find the scsi disk, due to the controller failing to request the IO resource.
It gives the following on the console
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.4.0+ (richardmaw at aegir) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #14 Wed May 30 16:54:55 BST 2012
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177
CPU: VIVT data cache, VIVT instruction cache
Machine: ARM-Versatile PB
Memory policy: ECC disabled, Data cache writeback
--SNIP--
PCI core found (slot 11)
PCI host bridge to bus 0000:00pci_bus 0000:00: root bus resource [io 0x44000000-0x4fffffff] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff pref]
PCI: bus0: Fast back to back transfers disabled
pci 0000:00:0c.0: BAR 2: assigned [mem 0x50000000-0x50001fff] pci 0000:00:0c.0: BAR 1: assigned [mem 0x50002000-0x500023ff] pci 0000:00:0c.0: BAR 0: assigned [io 0x44000000-0x440000ff]
bio: create slab <bio-0> at 0
--SNIP--
brd: module loaded
PCI: enabling device 0000:00:0c.0 (0100 -> 0103)
sym53c8xx 0000:00:0c.0: pci_request_regions called
sym53c8xx 0000:00:0c.0: BAR 0: can't reserve [io 0x44000000-0x440000ff] --SNIP--
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)
[<c0019360>] (unwind_backtrace+0x0/0xf0) from [<c02876e8>] (panic+0x74/0x1a8)
[<c02876e8>] (panic+0x74/0x1a8) from [<c035fc50>] (mount_block_root+0x178/0x22c)
[<c035fc50>] (mount_block_root+0x178/0x22c) from [<c035fee4>] (mount_root+0xe4/0x10c)
[<c035fee4>] (mount_root+0xe4/0x10c) from [<c036006c>] (prepare_namespace+0x160/0x1b8)
[<c036006c>] (prepare_namespace+0x160/0x1b8) from [<c035f908>] (kernel_init+0x198/0x1d8)
[<c035f908>] (kernel_init+0x198/0x1d8) from [<c0014510>] (kernel_thread_exit+0x0/0x8)
QEMU: Terminated
We've tried to track down the problem, but we couldn't get much further than finding out that the IO_SPACE_LIMIT in kernel/resource.c is 0xffff, which is lower than the required 0x44000000.
We're not sure whether this is a problem with it not being allocated enough space, or that it is not being translated properly.
Is this a known issue, I did a quick google for the "sym53c8xx
can't reserve io" error, but nothing turned up.
If not, does anyone have any pointers to how this could be fixed?
Quoted 63 lines · Richard Maw
When I build from
f9369910a6225b8d4892c3f20ae740a711cd5acewithversatile_defconfig, after making the changes described in
http://fedoraproject.org/wiki/Architectures/ARM/HowToQemu#Build_Kernel_Image_From_Source
Enabling PCI and the SYM53C8XX scsi disk driver, which aren't in the defconfig.QEMU is run with the command
qemu-system-arm -M versatilepb \
-drive file=$diskimage,if=scsi \
-kernel linux/arch/arm/boot/zImage -append root=/dev/sda1The system fails to find the scsi disk, due to the controller failing to request the IO resource.
It gives the following on the console
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.4.0+ (richardmaw at aegir) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #14 Wed May 30 16:54:55 BST 2012
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00093177
CPU: VIVT data cache, VIVT instruction cache
Machine: ARM-Versatile PB
Memory policy: ECC disabled, Data cache writeback
--SNIP--
PCI core found (slot 11)
PCI host bridge to bus 0000:00pci_bus0000:00: root bus resource [io 0x44000000-0x4fffffff]pci_bus0000:00: root bus resource [mem 0x50000000-0x5fffffff]pci_bus0000:00: root bus resource [mem 0x60000000-0x6fffffff pref]
PCI: bus0: Fast back to back transfers disabled
pci 0000:00:0c.0: BAR 2: assigned [mem 0x50000000-0x50001fff] pci 0000:00:0c.0: BAR 1: assigned [mem 0x50002000-0x500023ff] pci 0000:00:0c.0: BAR 0: assigned [io 0x44000000-0x440000ff]
bio: create slab <bio-0> at 0
--SNIP--
brd: module loaded
PCI: enabling device 0000:00:0c.0 (0100 -> 0103)
sym53c8xx 0000:00:0c.0:pci_request_regionscalled
sym53c8xx 0000:00:0c.0: BAR 0: can't reserve [io 0x44000000-0x440000ff] --SNIP--
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 Please append a correct "root=" boot option; here are the available partitions:Kernel panic - not syncing: VFS: Unable to mount root fs onunknown-block(0,0)
[<c0019360>] (unwind_backtrace+0x0/0xf0) from [<c02876e8>] (panic+0x74/0x1a8)
[<c02876e8>] (panic+0x74/0x1a8) from [<c035fc50>] (mount_block_root+0x178/0x22c)
[<c035fc50>] (mount_block_root+0x178/0x22c) from [<c035fee4>] (mount_root+0xe4/0x10c)
[<c035fee4>] (mount_root+0xe4/0x10c) from [<c036006c>] (prepare_namespace+0x160/0x1b8)
[<c036006c>] (prepare_namespace+0x160/0x1b8) from [<c035f908>] (kernel_init+0x198/0x1d8)
[<c035f908>] (kernel_init+0x198/0x1d8) from [<c0014510>] (kernel_thread_exit+0x0/0x8)
QEMU: TerminatedWe've tried to track down the problem, but we couldn't get much further than finding out that the
IO_SPACE_LIMITinkernel/resource.cis0xffff, which is lower than the required0x44000000.
Quoted 7 lines
We're not sure whether this is a problem with it not being allocated enough space, or that it is not being translated properly.
Is this a known issue, I did a quick google for the "sym53c8xx
can't reserve io" error, but nothing turned up.
If not, does anyone have any pointers to how this could be fixed?
I believe this is the same issue:
http://www.gossamer-threads.com/lists/linux/kernel/1543569
In looking at various PCI platforms and for a qemu platform with PCI to test PCI changes, I had concluded (wrongly I guess) that Versatile PCI was broken. This patch which has never gone upstream also played a part in my conclusion:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-July/021035.html
The simple fix is to restore io.h for Versatile, but I'm looking for a better way.
Rob
Quoted 24 lines · Rob Herring
Quoted 5 lines · Richard Maw
We've tried to track down the problem, but we couldn't get much further than finding out that the
IO_SPACE_LIMITinkernel/resource.cis0xffff, which is lower than the required0x44000000.Quoted 7 lines
We're not sure whether this is a problem with it not being allocated enough space, or that it is not being translated properly.
Is this a known issue, I did a quick google for the "sym53c8xx
can't reserve io" error, but nothing turned up.
If not, does anyone have any pointers to how this could be fixed?I believe this is the same issue:
http://www.gossamer-threads.com/lists/linux/kernel/1543569
In looking at various PCI platforms and for a qemu platform with PCI to test PCI changes, I had concluded (wrongly I guess) that Versatile PCI was broken. This patch which has never gone upstream also played a part in my conclusion:
Quoted 4 lines
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-July/021035.html
The simple fix is to restore
io.hfor Versatile, but I'm looking for a better way.
It looks like it's a simple bug in pci.c, which puts the wrong thing into the pcibios_min_io variable.
Does the below patch fix it?
Arnd
arch/arm/mach-versatile/pci.c +1 -1
@@ -305,7 +305,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)void __init pci_versatile_preinit (void ) { - pcibios_min_io =0x44000000 ; + pcibios_min_io =0x100 ; pcibios_min_mem =0x50000000 ;__raw_writel (VERSATILE_PCI_MEM_BASE0 >>28 ,PCI_IMAP0 );
Quoted 13 lines · Arnd Bergmann
It looks like it's a simple bug in
pci.c, which puts the wrong thing into thepcibios_min_iovariable.Does the below patch fix it?
Arnd
arch/arm/mach-versatile/pci.c +0
-0
arch/arm/mach-versatile/pci.c int __init pci_versatile_setup(int nr, struct pci_sys_data *sys) · line 311
Quoted 8 lines
arch/arm/mach-versatile/pci.c +1
-1@@ -305,7 +305,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)void __init pci_versatile_preinit (void ) { - pcibios_min_io =0x44000000 ; + pcibios_min_io =0x100 ; pcibios_min_mem =0x50000000 ;__raw_writel (VERSATILE_PCI_MEM_BASE0 >>28 ,PCI_IMAP0 );
Sadly it is still not working. sym53c8xx is still requesting the range 0x44000000-0x440000ff, which is beyond the 0x0000-0xffff specified by the ioport_resource.
Quoted 27 lines · Arnd Bergmann
Quoted 26 lines · Rob Herring
Quoted 5 lines · Richard Maw
We've tried to track down the problem, but we couldn't get much further than finding out that the
IO_SPACE_LIMITinkernel/resource.cis0xffff, which is lower than the required0x44000000.Quoted 7 lines
We're not sure whether this is a problem with it not being allocated enough space, or that it is not being translated properly.
Is this a known issue, I did a quick google for the "sym53c8xx
can't reserve io" error, but nothing turned up.
If not, does anyone have any pointers to how this could be fixed?I believe this is the same issue:
http://www.gossamer-threads.com/lists/linux/kernel/1543569
In looking at various PCI platforms and for a qemu platform with PCI to test PCI changes, I had concluded (wrongly I guess) that Versatile PCI was broken. This patch which has never gone upstream also played a part in my conclusion:
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-July/021035.html
Quoted 7 lines
Quoted 2 lines
The simple fix is to restore
io.hfor Versatile, but I'm looking for a better way.It looks like it's a simple bug in
pci.c, which puts the wrong thing into thepcibios_min_iovariable.Does the below patch fix it?
I've resurrected your patch from ~2 years ago and that does fix it. Any reason it was never merged? I could go with a more simple fix which just restore IO_SPACE_LIMIT to ~0, but yours is more in the direction we want to go with PCI mappings.
Rob
Quoted 17 lines
Arnd
arch/arm/mach-versatile/pci.c +1
-1@@ -305,7 +305,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)void __init pci_versatile_preinit (void ) { - pcibios_min_io =0x44000000 ; + pcibios_min_io =0x100 ; pcibios_min_mem =0x50000000 ;__raw_writel (VERSATILE_PCI_MEM_BASE0 >>28 ,PCI_IMAP0 );
Quoted 4 lines · Rob Herring
I've resurrected your patch from ~2 years ago and that does fix it. Any reason it was never merged? I could go with a more simple fix which just restore
IO_SPACE_LIMITto ~0, but yours is more in the direction we want to go with PCI mappings.
It was only my fault for not pushing the patches enough. I think they should really go in now.
Arnd