From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Tomasz Stanislawski <t.stanislaws@samsung.com>,
Sylwester Nawrocki <snjw23@gmail.com>,
Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>,
Mauro Carvalho Chehab <mchehab@redhat.com>,
devicetree-discuss@lists.ozlabs.org,
linux-media <linux-media@vger.kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Sylwester Nawrocki <s.nawrocki@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Tuukka Toivonen <tuukka.toivonen@intel.com>
Subject: Re: [ANN] Meeting minutes of the Cambourne meeting
Date: Tue, 30 Aug 2011 17:42:55 +0200 [thread overview]
Message-ID: <201108301742.56581.laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <CACxGe6tCLJ6F-Rsf=1ENj98YzXHRm9p9xr4-TAiWTHpQbQVOVA@mail.gmail.com>
On Tuesday 30 August 2011 17:18:31 Grant Likely wrote:
> On Tue, Aug 30, 2011 at 8:03 AM, Guennadi Liakhovetski
>
> <g.liakhovetski@gmx.de> wrote:
> > Hi Grant
> >
> > On Tue, 30 Aug 2011, Grant Likely wrote:
> >> On Tue, Aug 30, 2011 at 02:41:48PM +0100, Mark Brown wrote:
> >> > On Tue, Aug 30, 2011 at 12:20:09AM +0200, Guennadi Liakhovetski wrote:
> >> > > On Mon, 29 Aug 2011, Laurent Pinchart wrote:
> >> > > > My idea was to let the kernel register all devices based on the DT
> >> > > > or board code. When the V4L2 host/bridge driver gets registered,
> >> > > > it will then call a V4L2 core function with a list of subdevs it
> >> > > > needs. The V4L2 core would store that information and react to
> >> > > > bus notifier events to notify the V4L2 host/bridge driver when
> >> > > > all subdevs are present. At that point the host/bridge
> >>
> >> Sounds a lot like what ASoC is currently doing.
> >>
> >> > > > driver will get hold of all the subdevs and call (probably through
> >> > > > the V4L2 core) their .registered operation. That's where the
> >> > > > subdevs will get access to their clock using clk_get().
> >> > >
> >> > > Correct me, if I'm wrong, but this seems to be the case of sensor
> >> > > (and other i2c-client) drivers having to succeed their probe()
> >> > > methods without being able to actually access the hardware?
> >>
> >> It indeed sounds like that, which also concerns me. ASoC and other
> >> subsystems have exactly the same problem where the 'device' is
> >> actually an aggregate of multiple devices attached to different
> >> busses. My personal opinion is that the best way to handle this is to
> >> support deferred probing
> >
> > Yes, that's also what I think should be done. But I was thinking about a
> > slightly different approach - a dependency-based probing. I.e., you
> > should be able to register a device, depending on another one (parent?),
> > and only after the latter one has successfully probed, the driver core
> > should be allowed to probe the child. Of course, devices can depend on
> > multiple other devices, so, a single parent might not be enough.
>
> Yes, a dependency system would be lovely... but it gets really complex
> in a hurry, especially when faced with heterogeneous device
> registrations. A deferral system ends up being really simple to
> implement and probably work just as well.
The core issue is that physical device trees, clock trees, power trees and
logical device tress are not always aligned. Instanciating devices based on
the parent-child device relationships will always lead to situations where a
device probe() method will be called with clocks or power sources not
available yet.
A dependency system is tempting but will be very complex to implement
properly, especially when faced with cyclic dependencies. For instance the
OMAP3 ISP driver requires the camera sensor device to be present to proceed,
and the camera sensor requires a clock provided by the OMAP3 ISP. To solve
this we need to probe the OMAP3 ISP first, have it register its clock devices,
and then wait until all sensors become available.
A probe deferral system is probably simpler, but it will have its share of
problems as well. In the above example, if the sensor is probed first, the
driver can return -EAGAIN in the probe() method as the clock isn't available
yet (I'm not sure how to differentiate between "not available yet" and "not
present in the system" though). However, if the OMAP3 ISP is probed first,
returning -EAGAIN in its probe() method won't really help, as we need to
register the clock before waiting for the sensor.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2011-08-30 15:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201107261647.19235.laurent.pinchart@ideasonboard.com>
[not found] ` <201108081750.07000.laurent.pinchart@ideasonboard.com>
2011-08-28 11:28 ` [ANN] Meeting minutes of the Cambourne meeting Sylwester Nawrocki
2011-08-29 13:08 ` Laurent Pinchart
2011-08-29 22:20 ` Guennadi Liakhovetski
2011-08-29 22:26 ` Laurent Pinchart
[not found] ` <201108300026.05489.laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2011-08-29 22:38 ` Guennadi Liakhovetski
[not found] ` <Pine.LNX.4.64.1108300018490.5065-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2011-08-30 13:41 ` Mark Brown
2011-08-30 13:56 ` Grant Likely
2011-08-30 14:00 ` Mark Brown
2011-08-30 14:03 ` Guennadi Liakhovetski
2011-08-30 15:18 ` Grant Likely
2011-08-30 15:42 ` Laurent Pinchart [this message]
2011-08-30 15:46 ` Mark Brown
2011-08-30 20:12 ` Laurent Pinchart
2011-08-30 20:19 ` Mark Brown
[not found] ` <20110830201929.GS2061-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-08-30 20:35 ` Grant Likely
[not found] ` <CACxGe6v0Tm8oz5+vcrdjzk3x0DdvBoyeqEv=aZv=XEA=Ev7WpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-30 20:37 ` Grant Likely
2011-08-30 20:37 ` Laurent Pinchart
2011-08-30 20:39 ` Mark Brown
2011-08-30 15:59 ` Guennadi Liakhovetski
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=201108301742.56581.laurent.pinchart@ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=g.liakhovetski@gmx.de \
--cc=grant.likely@secretlab.ca \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@redhat.com \
--cc=s.nawrocki@samsung.com \
--cc=sakari.ailus@maxwell.research.nokia.com \
--cc=snjw23@gmail.com \
--cc=t.stanislaws@samsung.com \
--cc=tuukka.toivonen@intel.com \
/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