From: Peter Mamonov <pmamonov@gmail.com>
To: Alexander Aring <alex.aring@gmail.com>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: [RFC] device probe order
Date: Thu, 24 Dec 2015 16:42:25 +0300 [thread overview]
Message-ID: <20151224164225.25665d7f@berta> (raw)
In-Reply-To: <20151224124837.0fcc6fce@berta>
On Thu, 24 Dec 2015 12:48:37 +0300
Peter Mamonov <pmamonov@gmail.com> wrote:
> On Wed, 23 Dec 2015 18:04:43 +0100
> Alexander Aring <alex.aring@gmail.com> wrote:
>
> > On Wed, Dec 23, 2015 at 07:56:44PM +0300, Peter Mamonov wrote:
> > > On Wed, 23 Dec 2015 17:35:51 +0100
> > > Alexander Aring <alex.aring@gmail.com> wrote:
> > >
> > > > On Wed, Dec 23, 2015 at 07:10:58PM +0300, Peter Mamonov wrote:
> > > > > Dear All,
> > > > >
> > > > > I've ported an UHCI driver from the u-boot to the barebox
> > > > > (WIP). To interoperate with the EHCI driver, the UHCI driver
> > > > > should be probed ater the EHCI driver. Both drivers are binded
> > > > > via the device tree mechanism. How can i achieve the correct
> > > > > probe order?
> > > > >
> > > >
> > > > Normally this should done by returning "-EPROBE_DEFER" inside
> > > > the probe function. There was some RFC last years for supporting
> > > > EPROBE_DEFER [0] and it seems these are mainline.
> > > >
> > > > However you need some bool which indicates that the EHCI driver
> > > > is probed.
> > >
> > > Thanks, Alex. As i understand, this is the linux-way solution.
> > >
> > > Sasha, is it ok to add a global variable to indicate the EHCI
> > > presence? Or should we follow the way proposed by the mentioned
> > > RFCs, i.e. introduce dependencies between drivers?
> > >
> >
> > mhhh, maybe a simple "get_device_by_name" works here.
> >
> > If returning NULL then return -EPROBE_DEFER. Don't know if this is a
> > good solution, name need to be unique then.
> >
> >
> > btw:
> > Just found that "of_find_device_by_node" returns -EPROBE_DEFER when
> > nothing was found. This was introduced by the patch series.
>
> I like this approach better, than introducing a global variable.
> Will look further into it.
Unfortunately of_find_device_by_node() returns a valid pointer to
the device before the device probe function is called. I guess
get_device_by_name() behaves in the same way.
>
> >
> > Maybe it helps to look how the current use-cases deals with
> > -EPROBE_DEFER or get_device_by_name is enough.
> >
> > - Alex
> >
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-12-24 13:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 16:10 [RFC] device probe order Peter Mamonov
2015-12-23 16:35 ` Alexander Aring
2015-12-23 16:56 ` Peter Mamonov
2015-12-23 17:04 ` Alexander Aring
2015-12-24 9:48 ` Peter Mamonov
2015-12-24 13:42 ` Peter Mamonov [this message]
2016-01-04 8:56 ` Sascha Hauer
2015-12-23 19:46 ` Sascha Hauer
2015-12-24 10:46 ` Peter Mamonov
2015-12-24 14:35 ` Alexander Aring
2015-12-24 16:10 ` Peter Mamonov
2015-12-25 10:21 ` Alexander Aring
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=20151224164225.25665d7f@berta \
--to=pmamonov@gmail.com \
--cc=alex.aring@gmail.com \
--cc=barebox@lists.infradead.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 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.