linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux PCI bus numbering algorithm
@ 2010-02-24  3:39 Rajat Jain
  2010-02-24  3:44 ` Greg KH
  2010-02-24  3:52 ` Rajat Jain
  0 siblings, 2 replies; 3+ messages in thread
From: Rajat Jain @ 2010-02-24  3:39 UTC (permalink / raw)
  To: linux-hotplug

Hi,

I want to understand the algorithm Linux uses to enumerate and assign
the PCI bus numbers on a HOT-PLUGGABLE system with DUMB FIRMWARE that
has not done any PCI enumeration / resource allocation (Thus Linux needs
to do it).

1) Does Linux reserve & leave apart certain bus numbers at each PCI
bridge -in anticipation of new PCI cards (containing PCI bridges) to be
hot-lugged later on to that location? If yes, how many bus numbers does
it reserve at each bridge? 

2) Or is it totally dynamic i.e. no reserved (unused) bus numbers are
available with any bridge. Hence when a PCI card (with PCI bridges on
it) is hot-plugged, then new bus numbers are allocated for it, and then
all the PCI bridges upstream are "fixed up" so as to include this bus
numbers in their range. If yes, then wouldn't this mean renumbering
buses (perhaps leading to resource reconfiguration / reassignment?) for
existing devices, thus possible interfering with the PCI devices already
in use? 

3) I also have similar question for resource assignment. Are they also
reserved for hot-plug?

Thanks in Advance,

Rajat Jain

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

* Re: Linux PCI bus numbering algorithm
  2010-02-24  3:39 Linux PCI bus numbering algorithm Rajat Jain
@ 2010-02-24  3:44 ` Greg KH
  2010-02-24  3:52 ` Rajat Jain
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2010-02-24  3:44 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Feb 24, 2010 at 08:57:41AM +0530, Rajat Jain wrote:
> Hi,
> 
> I want to understand the algorithm Linux uses to enumerate and assign
> the PCI bus numbers on a HOT-PLUGGABLE system with DUMB FIRMWARE that
> has not done any PCI enumeration / resource allocation (Thus Linux needs
> to do it).

What specific platform is this?  Have you looked at the kernel code that
does this?

> 1) Does Linux reserve & leave apart certain bus numbers at each PCI
> bridge -in anticipation of new PCI cards (containing PCI bridges) to be
> hot-lugged later on to that location? If yes, how many bus numbers does
> it reserve at each bridge? 

No, this is up to the BIOS/PCI controller interface (like ACPI).  See
the PCI spec for details as to why this is so.

> 2) Or is it totally dynamic i.e. no reserved (unused) bus numbers are
> available with any bridge. Hence when a PCI card (with PCI bridges on
> it) is hot-plugged, then new bus numbers are allocated for it, and then
> all the PCI bridges upstream are "fixed up" so as to include this bus
> numbers in their range. If yes, then wouldn't this mean renumbering
> buses (perhaps leading to resource reconfiguration / reassignment?) for
> existing devices, thus possible interfering with the PCI devices already
> in use? 

No pci devices are renumbered.

> 3) I also have similar question for resource assignment. Are they also
> reserved for hot-plug?

No.

good luck :)

greg k-h

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

* RE: Linux PCI bus numbering algorithm
  2010-02-24  3:39 Linux PCI bus numbering algorithm Rajat Jain
  2010-02-24  3:44 ` Greg KH
@ 2010-02-24  3:52 ` Rajat Jain
  1 sibling, 0 replies; 3+ messages in thread
From: Rajat Jain @ 2010-02-24  3:52 UTC (permalink / raw)
  To: linux-hotplug


Hello Greg,

> What specific platform is this?  Have you looked at the kernel code
that
> does this?

This is a customized MPC8572 platform for which I'll be doing the
firmware. I need to do these PCI bus numberings, and thus want to know
how would have Linux have done it. Trusting that the Linux PCI bus
numbering would have been arrived at using a good algorithm, I plan to
borrow same idea in my code...

> > 1) Does Linux reserve & leave apart certain bus numbers at each PCI
> > bridge -in anticipation of new PCI cards (containing PCI bridges) to
be
> > hot-lugged later on to that location? If yes, how many bus numbers
does
> > it reserve at each bridge?
> 
> No, this is up to the BIOS/PCI controller interface (like ACPI).  See
> the PCI spec for details as to why this is so.
>

This would be a PPC platform on which there is no BIOS or the ACPI...
:-(

Thanks,

Rajat Jain


> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> Sent: Wednesday, February 24, 2010 9:15 AM
> To: Rajat Jain
> Cc: linux-pci@vger.kernel.org; linux-hotplug@vger.kernel.org
> Subject: Re: Linux PCI bus numbering algorithm
> 
> On Wed, Feb 24, 2010 at 08:57:41AM +0530, Rajat Jain wrote:
> > Hi,
> >
> > I want to understand the algorithm Linux uses to enumerate and
assign
> > the PCI bus numbers on a HOT-PLUGGABLE system with DUMB FIRMWARE
that
> > has not done any PCI enumeration / resource allocation (Thus Linux
needs
> > to do it).
> 
> What specific platform is this?  Have you looked at the kernel code
that
> does this?
> 
> > 1) Does Linux reserve & leave apart certain bus numbers at each PCI
> > bridge -in anticipation of new PCI cards (containing PCI bridges) to
be
> > hot-lugged later on to that location? If yes, how many bus numbers
does
> > it reserve at each bridge?
> 
> No, this is up to the BIOS/PCI controller interface (like ACPI).  See
> the PCI spec for details as to why this is so.
> 
> > 2) Or is it totally dynamic i.e. no reserved (unused) bus numbers
are
> > available with any bridge. Hence when a PCI card (with PCI bridges
on
> > it) is hot-plugged, then new bus numbers are allocated for it, and
then
> > all the PCI bridges upstream are "fixed up" so as to include this
bus
> > numbers in their range. If yes, then wouldn't this mean renumbering
> > buses (perhaps leading to resource reconfiguration / reassignment?)
for
> > existing devices, thus possible interfering with the PCI devices
already
> > in use?
> 
> No pci devices are renumbered.
> 
> > 3) I also have similar question for resource assignment. Are they
also
> > reserved for hot-plug?
> 
> No.
> 
> good luck :)
> 
> greg k-h

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

end of thread, other threads:[~2010-02-24  3:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24  3:39 Linux PCI bus numbering algorithm Rajat Jain
2010-02-24  3:44 ` Greg KH
2010-02-24  3:52 ` Rajat Jain

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