Re: platform_driver's probe functions must not be located in.init.text

From: Uwe Kleine-König
Date: Tue Jan 13 2009 - 03:08:42 EST


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