From: Chris Packham <Chris.Packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Florian Fainelli
<florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org"
<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
"linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: Associating nodes with phandles for pci devices
Date: Sun, 8 Mar 2015 23:03:26 +0000 [thread overview]
Message-ID: <54FCD53D.7080700@alliedtelesis.co.nz> (raw)
In-Reply-To: <4974230.GyVpHqdJU9@wuerfel>
On 03/09/2015 11:42 AM, Arnd Bergmann wrote:
> On Sunday 08 March 2015 22:01:17 Chris Packham wrote:
>>
>>>
>>> BTW, one thing that is high in my TODO list regarding DSA is to stop
>>> using this platform device/driver architecture and use the actual device
>>> driver model. Your switch driver entry point would be a pci_drive
>>> probe's function where you end-up registering a switch the DSA. This
>>> should solve portions of your problem although this is a long shot as we
>>> need to convert existing drivers as well.
>>>
>>
>> My current problem is that of_find_device_by_node() (called by
>> dsa_of_probe) can't find the device. After a bit of debugging I can see
>> that the populated platform bus only goes as far as
>> /soc/pcie-controller, anything beyond that seems to be missing. I can't
>> see anything obvious in of_platform_bus_create() that would actually
>> stop it from continuing down the pcie-controller branch provided the dts
>> actually enumerates the children.
>>
>> Any suggestions?
>
> The PCI devices are not populated by of_platform_bus_create. Instead,
> pci_scan_device() calls pci_set_of_node() to set the of_node
> pointer for each PCI device.
>
> This would fail for instance if the root bus does not have a correct
> of_node pointer.
>
Hmm. I instrumented pci_set_of_node and I do see my 2 network devices.
devfn = 00000000
of_node = bfff3f90 /soc/pcie-controller/pcie@1,0/tg3@01,0
devfn = 00000001
of_node = bfff4118 /soc/pcie-controller/pcie@1,0/tg3@01,1
So at least that's happening. I guess the problem is that ultimately
they are devices on the pci bus as opposed to the platform bus and
of_find_device_by_node() only looks at the platform bus
dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match);
What I might have to do for now is get the DSA driver code to go looking
on the pci bus if of_find_device_by_node() fails to find the named node.
Florian mentioned making the DSA code use the device driver model which
would help me but I'm kinda stuck with the kernel version I'm using for
now at least.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-03-08 23:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 19:02 Associating nodes with phandles for pci devices Chris Packham
[not found] ` <9bcf67ede60f4567a396c05578cfceb7-5g7mGxlPNYb6GjIOKuZY+ItlCAj8ZROq@public.gmane.org>
2015-01-23 19:15 ` Arnd Bergmann
2015-01-23 19:38 ` Chris Packham
[not found] ` <alpine.DEB.2.10.1501240828280.14228-VJzQ50X1/JKjhWACt5bsBotlCAj8ZROq@public.gmane.org>
2015-01-23 22:40 ` Florian Fainelli
[not found] ` <54C2CDE6.8090400-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2015-03-08 22:01 ` Chris Packham
[not found] ` <54FCC6AC.4030202-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2015-03-08 22:42 ` Arnd Bergmann
2015-03-08 23:03 ` Chris Packham [this message]
[not found] ` <54FCD53D.7080700-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2015-03-09 3:40 ` Florian Fainelli
[not found] ` <CAGVrzcYF266X-mUsfPtAr_jjJ3JW-TTHrKkznsnCCfrCzuf+qw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-09 5:19 ` Chris Packham
2015-01-26 10:57 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54FCD53D.7080700@alliedtelesis.co.nz \
--to=chris.packham-6g8wrflrtwxfdca3tkvle6u/zskkhjvu@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).