Re: [PATCH] Register PCI host bridge resource earlier

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

 



On Sun, Apr 08, 2007 at 08:58:42PM +0400, Sergei Shtylyov wrote:
> >request_resource will fail, because the range is already taken by
> >sni_io_resource, while insert_region inserts the resource into 
> >sni_io_resource.
> 
>    No, it shouldn't according to what I'm seeing in the code.  Perhaps I'm 
> missing something and need to actually try executing alike code a see...

after startup there is ioport_resource, which is 0x0000-IO_SPACE_LIMIT.
My change in register_pci_controller will request the PCI IO space
from 0x0000 to 0x3bffff (the maximum the PCI host bridge could address).
request_resource from ioport_resource, which i8259.c tried to do, will
fail now in that range, because it'ss taken by the PCI bridge. Therefore
anybody wanting IO space in that range, must take it from the PCI 
IO space. So doing request_region (&sni_io_resource, &pci1_io_resource);
would have worked as well. But the code right now doesn't have a
handle for the parent resource. insert_region() on the other side
searches for the parent resource over the whole given resource and
plugs the wanted resource to the right sub resource. Fine for simple
house keeping, which is IMHO ok in that place.

> >The problem is that init_i8259 doesn't have the right
> >resource for doing the request_resource, if ioport_resource starting from
> >0x0000 is already taken by a PCI host bridge.
> 
>    I'm not at all sure that giving out I/O addresses from 0 to PCI is a 
>    great idea -- is it indeed necessary?

I'm feeling like an oldtimer right now. Ever heard of ISA busses ? The
address space there starts from 0x0000. There is this infamous DMA
controller waiting exactly at IO address 0x0000-0x001f. Floppy DMA
needs to use that for example. Of course this would work even without
the silly resource stuff (inb/outb don't care), EISA code wants to see
0x0000 as base address of the PCI/EISA bridge.

Oh, and addresses for PCI devices (bridges are a different story) will start
at PCIBIOS_MIN_IO. So there will be no PCI device resource starting at 0x0000.

> >I could probably write a
> >patch, which adds a parameter to init_i8259 for the resource, where the
> >request_resource is correct. No idea, whether this is worth the efford.
> 
> >Opions ?
> 
>    Did you mean options, opinions, or something else? :-)

I wanted to know from someone, who knows what I talking about, if my
current code is acceptable or needs more workout.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux