Skip to contentSkip to conversation

Initialisation sequencing.

DISCUSSION Antonino A. Daplas 2 participants 5 messages Mar 3, 2005 – Mar 4, 2005 Framebuffer layer

lore
Share & tools
lore
#0 lore raw
Quoted 30 lines · --- Andrew Morton

Begin forwarded message:

Date: Wed, 02 Mar 2005 23:32:51 +0000
From: Ian Molton <[email protected]>
To: Kernel Mailing List
<[email protected]>
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.

Quoted 10 lines

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

Quoted 25 lines

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 [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Quoted 13 lines

-------------------------------------------------------
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 [email protected]
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

#1 lore raw
Quoted 5 lines · Antonino A. Daplas

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

#2 lore raw
Quoted 8 lines · Ian Molton
Quoted 5 lines · Antonino A. Daplas

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

#3 lore raw
Quoted 4 lines · Antonino A. Daplas

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

#4 lore raw
Quoted 8 lines · Ian Molton
Quoted 4 lines · Antonino A. Daplas

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?

Quoted 7 lines

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