All of lore.kernel.org
 help / color / mirror / Atom feed
* downstream pci walk
@ 2014-07-16 21:58 Amerei Acuna
  2014-07-17  4:47 ` Valdis.Kletnieks at vt.edu
  0 siblings, 1 reply; 4+ messages in thread
From: Amerei Acuna @ 2014-07-16 21:58 UTC (permalink / raw)
  To: kernelnewbies

Hello

I'm writing a custom PCI driver for a hobby endpoint. Due to some
"special", possibly unique, circumstance, I need to determine if two
devices form a pair. As I'm using a PCI switch to connect these two
devices, I'm thinking on the possibility of checking if the two devices
share a common pci-pci bridge (or finding the least common ancestor in a
directed graph).

Basically, I'm trying to implement pci/bus.c::pci_walk_bus(), only, in a
downstream direction (from end point to bridge). I could use
pci_bus_upstream_bridge() to do my reverse walk but I noticed it uses a
semaphore pci_bus_sem that is only made available via internal "pci.h" e.g.
not available to outside modules.

Along with my study, I would like to ask for advice and a push in the right
direction on how can I achieve a reverse PCI walk - if that is possible.

Thank you in advance for your help.

~amerei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140717/496430d2/attachment.html 

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

* downstream pci walk
  2014-07-16 21:58 downstream pci walk Amerei Acuna
@ 2014-07-17  4:47 ` Valdis.Kletnieks at vt.edu
  2014-07-17  6:37   ` Amerei Acuna
  0 siblings, 1 reply; 4+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-07-17  4:47 UTC (permalink / raw)
  To: kernelnewbies

On Thu, 17 Jul 2014 05:58:03 +0800, Amerei Acuna said:

> I'm writing a custom PCI driver for a hobby endpoint. Due to some
> "special", possibly unique, circumstance, I need to determine if two
> devices form a pair. As I'm using a PCI switch to connect these two
> devices, I'm thinking on the possibility of checking if the two devices
> share a common pci-pci bridge (or finding the least common ancestor in a
> directed graph).

What happens if your two devices and a totally unrelated PCI device
are all three downstream of the same PCI bridge?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140717/f2a4c533/attachment.bin 

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

* downstream pci walk
  2014-07-17  4:47 ` Valdis.Kletnieks at vt.edu
@ 2014-07-17  6:37   ` Amerei Acuna
  2014-07-17  7:40     ` Amerei Acuna
  0 siblings, 1 reply; 4+ messages in thread
From: Amerei Acuna @ 2014-07-17  6:37 UTC (permalink / raw)
  To: kernelnewbies

Hi,

Thank you for taking interest. I see no chance of that happening as I'm
only two down stream ports of my pci switch. Upstream, I only use one port
to connect the host pci bridge. Internally, it divides into multiple
bridges. I'm thinking of walking downstream only _up_to_ the entry pci
bridge of the switch and not any further.

Please see chart for clearer explanation of topology I'm working on.

http://www.electronicproducts.com/images2/FAJH_PLX_3_Nov2008.gif


~amerei


On Thu, Jul 17, 2014 at 12:47 PM, <Valdis.Kletnieks@vt.edu> wrote:

> On Thu, 17 Jul 2014 05:58:03 +0800, Amerei Acuna said:
>
> > I'm writing a custom PCI driver for a hobby endpoint. Due to some
> > "special", possibly unique, circumstance, I need to determine if two
> > devices form a pair. As I'm using a PCI switch to connect these two
> > devices, I'm thinking on the possibility of checking if the two devices
> > share a common pci-pci bridge (or finding the least common ancestor in a
> > directed graph).
>
> What happens if your two devices and a totally unrelated PCI device
> are all three downstream of the same PCI bridge?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140717/acc3ea82/attachment.html 

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

* downstream pci walk
  2014-07-17  6:37   ` Amerei Acuna
@ 2014-07-17  7:40     ` Amerei Acuna
  0 siblings, 0 replies; 4+ messages in thread
From: Amerei Acuna @ 2014-07-17  7:40 UTC (permalink / raw)
  To: kernelnewbies

sorry typo. TAKE 2!

Hi,

Thank you for taking interest. I see no chance of that happening as I'm
only _using_ two down stream ports of my pci switch. Upstream, I only use
one port to connect the host pci bridge. Internally, it divides into
multiple bridges. I'm thinking of walking upstream only _up_to_ the entry
pci bridge of the switch and not any further.


On Thu, Jul 17, 2014 at 2:37 PM, Amerei Acuna <amerei@gmail.com> wrote:

> Hi,
>
> Thank you for taking interest. I see no chance of that happening as I'm
> only two down stream ports of my pci switch. Upstream, I only use one port
> to connect the host pci bridge. Internally, it divides into multiple
> bridges. I'm thinking of walking downstream only _up_to_ the entry pci
> bridge of the switch and not any further.
>
> Please see chart for clearer explanation of topology I'm working on.
>
> http://www.electronicproducts.com/images2/FAJH_PLX_3_Nov2008.gif
>
>
> ~amerei
>
>
> On Thu, Jul 17, 2014 at 12:47 PM, <Valdis.Kletnieks@vt.edu> wrote:
>
>> On Thu, 17 Jul 2014 05:58:03 +0800, Amerei Acuna said:
>>
>> > I'm writing a custom PCI driver for a hobby endpoint. Due to some
>> > "special", possibly unique, circumstance, I need to determine if two
>> > devices form a pair. As I'm using a PCI switch to connect these two
>> > devices, I'm thinking on the possibility of checking if the two devices
>> > share a common pci-pci bridge (or finding the least common ancestor in a
>> > directed graph).
>>
>> What happens if your two devices and a totally unrelated PCI device
>> are all three downstream of the same PCI bridge?
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140717/b1ee6608/attachment-0001.html 

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

end of thread, other threads:[~2014-07-17  7:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-16 21:58 downstream pci walk Amerei Acuna
2014-07-17  4:47 ` Valdis.Kletnieks at vt.edu
2014-07-17  6:37   ` Amerei Acuna
2014-07-17  7:40     ` Amerei Acuna

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.