linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* ARM Versatile defconfig PCI io out of range?
@ 2012-05-30 18:02 Richard Maw
  2012-05-30 19:19 ` Rob Herring
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Maw @ 2012-05-30 18:02 UTC (permalink / raw)
  To: linux-arm-kernel

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:00
pci_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?

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

* ARM Versatile defconfig PCI io out of range?
  2012-05-30 18:02 ARM Versatile defconfig PCI io out of range? Richard Maw
@ 2012-05-30 19:19 ` Rob Herring
  2012-05-31  9:32   ` Arnd Bergmann
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2012-05-30 19:19 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/30/2012 01:02 PM, Richard Maw wrote:
> 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:00
> pci_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?
> 

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

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

* ARM Versatile defconfig PCI io out of range?
  2012-05-30 19:19 ` Rob Herring
@ 2012-05-31  9:32   ` Arnd Bergmann
  2012-05-31 10:48     ` Richard Maw
  2012-05-31 13:07     ` Rob Herring
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2012-05-31  9:32 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 30 May 2012, Rob Herring wrote:
> On 05/30/2012 01:02 PM, Richard Maw wrote:

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

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

diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index 4ae4fc8..aeb7b60 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -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);

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

* ARM Versatile defconfig PCI io out of range?
  2012-05-31  9:32   ` Arnd Bergmann
@ 2012-05-31 10:48     ` Richard Maw
  2012-05-31 13:07     ` Rob Herring
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Maw @ 2012-05-31 10:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, May 31, 2012 at 09:32:50AM +0000, Arnd Bergmann wrote:
> 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
> 
> diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
> index 4ae4fc8..aeb7b60 100644
> --- a/arch/arm/mach-versatile/pci.c
> +++ b/arch/arm/mach-versatile/pci.c
> @@ -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.

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

* ARM Versatile defconfig PCI io out of range?
  2012-05-31  9:32   ` Arnd Bergmann
  2012-05-31 10:48     ` Richard Maw
@ 2012-05-31 13:07     ` Rob Herring
  2012-05-31 20:40       ` Arnd Bergmann
  1 sibling, 1 reply; 6+ messages in thread
From: Rob Herring @ 2012-05-31 13:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/31/2012 04:32 AM, Arnd Bergmann wrote:
> On Wednesday 30 May 2012, Rob Herring wrote:
>> On 05/30/2012 01:02 PM, Richard Maw wrote:
> 
>>>
>>> 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?
>>>
>>
>> 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.
> 
> 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?

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

> 
> 	Arnd
> 
> diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
> index 4ae4fc8..aeb7b60 100644
> --- a/arch/arm/mach-versatile/pci.c
> +++ b/arch/arm/mach-versatile/pci.c
> @@ -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);
> 

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

* ARM Versatile defconfig PCI io out of range?
  2012-05-31 13:07     ` Rob Herring
@ 2012-05-31 20:40       ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2012-05-31 20:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 31 May 2012, Rob Herring wrote:
> 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.

It was only my fault for not pushing the patches enough. I think they should
really go in now. 

	Arnd

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

end of thread, other threads:[~2012-05-31 20:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 18:02 ARM Versatile defconfig PCI io out of range? Richard Maw
2012-05-30 19:19 ` Rob Herring
2012-05-31  9:32   ` Arnd Bergmann
2012-05-31 10:48     ` Richard Maw
2012-05-31 13:07     ` Rob Herring
2012-05-31 20:40       ` Arnd Bergmann

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