* Fw: Initialisation sequencing.
@ 2005-03-03 0:41 Andrew Morton
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2005-03-03 0:41 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: Ian Molton
Begin forwarded message:
Date: Wed, 02 Mar 2005 23:32:51 +0000
From: Ian Molton <spyro@f2s.com>
To: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Initialisation sequencing.
Hi.
I have a problem. It affects both modular and non modular builds, and I
dont see an obviously correct solution.
The problem is that I have a video chip which supports some GPIOs and an
LCD display.
some LCD functions are controlled via the GPIOs, like backlighting.
so the driver is split into a video driver which exports three GPIO
related functions, and a backlight driver which requires them to work.
Both are on the platform bus.
the problem occurs when the backlight driver gets probed before the
video driver. it tries to access the GPIO functions, which try to write
to random locations as the memory hasnt been ioremap()ed by the as yet
unprobed video driver, and it all predictably falls over in a gibbering
heap.
I cant spin at this point without deadlocking the video driver and
ending up never being able to call the gpio functions, for obvious reasons.
I've tried making the backlight driver a child of the video driver,
hoping the probe functions are called in 'bus order', ie. parents first.
This failed.
I could make the backlight driver initialise late, but that seems like a
hack. scheduling work risks deadlock.
what is the correct solution? does one exist?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fw: Initialisation sequencing.
@ 2005-03-03 6:38 Antonino A. Daplas
2005-03-03 9:18 ` Ian Molton
0 siblings, 1 reply; 6+ messages in thread
From: Antonino A. Daplas @ 2005-03-03 6:38 UTC (permalink / raw)
To: linux-fbdev-devel; +Cc: Ian Molton
--- Andrew Morton <akpm@osdl.org> wrote:
>
>
> Begin forwarded message:
>
> Date: Wed, 02 Mar 2005 23:32:51 +0000
> From: Ian Molton <spyro@f2s.com>
> To: Kernel Mailing List
> <linux-kernel@vger.kernel.org>
> Subject: Initialisation sequencing.
>
>
> Hi.
>
> I have a problem. It affects both modular and non
> modular builds, and I
> dont see an obviously correct solution.
>
> The problem is that I have a video chip which
> supports some GPIOs and an
> LCD display.
>
> some LCD functions are controlled via the GPIOs,
> like backlighting.
>
> so the driver is split into a video driver which
> exports three GPIO
> related functions, and a backlight driver which
> requires them to work.
> Both are on the platform bus.
>
> the problem occurs when the backlight driver gets
> probed before the
> video driver. it tries to access the GPIO functions,
> which try to write
> to random locations as the memory hasnt been
> ioremap()ed by the as yet
> unprobed video driver, and it all predictably falls
> over in a gibbering
> heap.
>
If your backlight driver depends on the video driver, then you
just have to initialize backlight after video.
Why not place your backlight driver in after drivers/video in
drivers/Makefile?
Tony
> I cant spin at this point without deadlocking the
> video driver and
> ending up never being able to call the gpio
> functions, for obvious reasons.
>
> I've tried making the backlight driver a child of
> the video driver,
> hoping the probe functions are called in 'bus
> order', ie. parents first.
> This failed.
>
> I could make the backlight driver initialise late,
> but that seems like a
> hack. scheduling work risks deadlock.
>
> what is the correct solution? does one exist?
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT
> Products from real users.
> Discover which products truly live up to the hype.
> Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Linux-fbdev-devel mailing list
> Linux-fbdev-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
>
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fw: Initialisation sequencing.
2005-03-03 6:38 Fw: Initialisation sequencing Antonino A. Daplas
@ 2005-03-03 9:18 ` Ian Molton
2005-03-03 20:07 ` Antonino A. Daplas
0 siblings, 1 reply; 6+ messages in thread
From: Ian Molton @ 2005-03-03 9:18 UTC (permalink / raw)
To: adaplas; +Cc: linux-fbdev-devel
Antonino A. Daplas wrote:
> If your backlight driver depends on the video driver, then you
> just have to initialize backlight after video.
>
> Why not place your backlight driver in after drivers/video in
> drivers/Makefile?
What about the modular case ?
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fw: Initialisation sequencing.
2005-03-03 9:18 ` Ian Molton
@ 2005-03-03 20:07 ` Antonino A. Daplas
2005-03-04 0:03 ` Ian Molton
0 siblings, 1 reply; 6+ messages in thread
From: Antonino A. Daplas @ 2005-03-03 20:07 UTC (permalink / raw)
To: Ian Molton, adaplas; +Cc: linux-fbdev-devel
On Thursday 03 March 2005 17:18, Ian Molton wrote:
> Antonino A. Daplas wrote:
> > If your backlight driver depends on the video driver, then you
> > just have to initialize backlight after video.
> >
> > Why not place your backlight driver in after drivers/video in
> > drivers/Makefile?
>
> What about the modular case ?
Are you using the backlight architecture in drivers/video/backlight? Shouldn't
the backlight driver pull the video driver first? I think you can do that if you
make the backlight driver depend on the video driver.
Tony
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fw: Initialisation sequencing.
2005-03-03 20:07 ` Antonino A. Daplas
@ 2005-03-04 0:03 ` Ian Molton
2005-03-04 0:45 ` Antonino A. Daplas
0 siblings, 1 reply; 6+ messages in thread
From: Ian Molton @ 2005-03-04 0:03 UTC (permalink / raw)
To: adaplas; +Cc: linux-fbdev-devel
Antonino A. Daplas wrote:
> Are you using the backlight architecture in drivers/video/backlight?
> Shouldn't the backlight driver pull the video driver first? I think
> you can do that if you make the backlight driver depend on the video
> driver.
IOW make it a child of it?
I asumed that would work but I cant actually build a modular kernel for
some reason I havent had time to look into yet.
that said, does load order have *any* bearing on probe order ?
since both devices are platform devices, both drivers can be loaded and
dormant and brought up at any time by their devices becomming available
from (another) module...
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Fw: Initialisation sequencing.
2005-03-04 0:03 ` Ian Molton
@ 2005-03-04 0:45 ` Antonino A. Daplas
0 siblings, 0 replies; 6+ messages in thread
From: Antonino A. Daplas @ 2005-03-04 0:45 UTC (permalink / raw)
To: Ian Molton, adaplas; +Cc: linux-fbdev-devel
On Friday 04 March 2005 08:03, Ian Molton wrote:
> Antonino A. Daplas wrote:
> > Are you using the backlight architecture in drivers/video/backlight?
> > Shouldn't the backlight driver pull the video driver first? I think
> > you can do that if you make the backlight driver depend on the video
> > driver.
>
> IOW make it a child of it?
>
> I asumed that would work but I cant actually build a modular kernel for
> some reason I havent had time to look into yet.
>
> that said, does load order have *any* bearing on probe order ?
> since both devices are platform devices, both drivers can be loaded and
> dormant and brought up at any time by their devices becomming available
> from (another) module...
If you really need to ensure that video gets loaded before backlight, you can
insert:
module_get/try_module_get(<video_driver>) in your backlight on load,
module_put() on unload.
Tony
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-03-04 0:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-03 6:38 Fw: Initialisation sequencing Antonino A. Daplas
2005-03-03 9:18 ` Ian Molton
2005-03-03 20:07 ` Antonino A. Daplas
2005-03-04 0:03 ` Ian Molton
2005-03-04 0:45 ` Antonino A. Daplas
-- strict thread matches above, loose matches on Subject: below --
2005-03-03 0:41 Andrew Morton
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).