lkml.org 
[lkml]   [2009]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: platform_driver's probe functions must not be located in .init.text
On Tue, Jan 13, 2009 at 12:15:55PM +0900, Paul Mundt wrote:
> On Mon, Jan 12, 2009 at 11:12:02PM +0100, Uwe Kleine-K?nig wrote:
> > Hello,
> >
> > if the probe function of a platform_driver lives in .init.text (i.e. is
> > defined using __init) registering a device after the .init sections are
> > discarded results in an oops. You can test that by doing
> >
> > echo $drivername.$somevalidid > /sys/bus/platform/drivers/$drivername/unbind
> > echo $drivername.$somevalidid > /sys/bus/platform/drivers/$drivername/bind
> >
> > As a reply to this mail I send 62 patches that fix this kind of error by
> > moving the respective probe functions to .devinit.text.
> >
> None of these patches balance with __devexit, is that intentional?
For now, yes, it is.

One reason is that my script to find errors doesn't trigger for that.

Another is that this is not that critical. If the probe function is in
.init.text you can get an oops. If remove is in .text it just occupies
RAM without being used (if HOTPLUG=n). And if remove is in .exit.text
and is properly wrapped in __exit_p when assigning .remove everything is
fine, too, you just cannot remove a device.

Maybe I will address this in later series.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
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/
\
 
 \ /
  Last update: 2009-01-13 09:11    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site