From: Johan Hovold <hidden> Date: 2013-09-23 14:28:33
Deferred probing cannot be used with platform_driver_probe as by the
time probing is retried either the driver has been unregistered or its
probe function has been set to platform_drv_probe_fail.
With commit e9354576 ("gpiolib: Defer failed gpio requests by default")
the gpio subsystem started returning -EPROBE_DEFER, which in turn
several platform drivers using platform_driver_probe return to driver
core. Other subsystems (e.g. regulator) has since started doing the
same.
The first patch in this series prevents platform drivers using
platform_driver_probe from requesting probe deferral while warning that
it is not supported.
The remaining patches move six platform-driver probe functions that rely
on gpio_request out of __init. There are likely other probe functions
that might return -EPROBE_DEFER and should be moved out of __init as
well.
Note that the mvsdio, at91_cf and pxa25x_udc patches are completely
untested.
Johan
Johan Hovold (7):
driver core: prevent deferred probe with platform_driver_probe
mmc: mvsdio: fix deferred probe from __init
mtd: atmel_nand: fix deferred probe from __init
pcmcia: at91_cf: fix deferred probe from __init
usb: gadget: pxa25x_udc: fix deferred probe from __init
usb: phy: gpio-vbus: fix deferred probe from __init
backlight: atmel-pwm-bl: fix deferred probe from __init
drivers/base/platform.c | 17 +++++++++++++----
drivers/mmc/host/mvsdio.c | 11 ++++++-----
drivers/mtd/nand/atmel_nand.c | 13 +++++++------
drivers/pcmcia/at91_cf.c | 11 +++++------
drivers/usb/gadget/pxa25x_udc.c | 9 +++++----
drivers/usb/phy/phy-gpio-vbus-usb.c | 11 +++++------
drivers/video/backlight/atmel-pwm-bl.c | 9 +++++----
include/linux/platform_device.h | 1 +
8 files changed, 47 insertions(+), 35 deletions(-)
--
1.8.3.2
From: Johan Hovold <hidden> Date: 2013-09-23 14:27:55
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.
Since commit e9354576 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.
Cc: Richard Purdie <redacted>
Cc: Jingoo Han <redacted>
Cc: Jean-Christophe Plagniol-Villard <redacted>
Signed-off-by: Johan Hovold <redacted>
---
drivers/video/backlight/atmel-pwm-bl.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
From: Johan Hovold <hidden> Date: 2013-09-23 14:27:57
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.
Since commit e9354576 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Josh Wu <redacted>
Signed-off-by: Johan Hovold <redacted>
---
drivers/mtd/nand/atmel_nand.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
From: Johan Hovold <hidden> Date: 2013-09-23 14:27:59
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.
Since commit e9354576 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if the mmc_gpio_request_cd fails.
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Chris Ball <redacted>
Signed-off-by: Johan Hovold <redacted>
---
drivers/mmc/host/mvsdio.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
From: Johan Hovold <hidden> Date: 2013-09-23 14:28:31
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.
Since commit e9354576 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.
Cc: Jean-Christophe PLAGNIOL-VILLARD <redacted>
Cc: Nicolas Ferre <redacted>
Signed-off-by: Johan Hovold <redacted>
---
drivers/pcmcia/at91_cf.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
From: Johan Hovold <hidden> Date: 2013-09-23 14:28:34
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.
Since commit e9354576 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.
Cc: Eric Miao <redacted>
Cc: Russell King <redacted>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Felipe Balbi <redacted>
Signed-off-by: Johan Hovold <redacted>
---
drivers/usb/gadget/pxa25x_udc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
From: Johan Hovold <hidden> Date: 2013-09-23 14:29:52
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.
Since commit e9354576 ("gpiolib: Defer failed gpio requests by default")
and 04bf3011 ("regulator: Support driver probe deferral") this driver
might return -EPROBE_DEFER if a gpio_request or regulator_get fails.
Cc: Felipe Balbi <redacted>
Signed-off-by: Johan Hovold <redacted>
---
drivers/usb/phy/phy-gpio-vbus-usb.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
From: Johan Hovold <hidden> Date: 2013-09-23 14:30:11
Prevent drivers relying on platform_driver_probe from requesting
deferred probing in order to avoid further futile probe attempts (either
the driver has been unregistered or its probe function has been set to
platform_drv_probe_fail when probing is retried).
Note that several platform drivers currently return subsystem errors
from probe and that these can include -EPROBE_DEFER (e.g. if a gpio
request fails).
Add a warning to platform_drv_probe that can be used to catch drivers
that inadvertently request probe deferral while using
platform_driver_probe.
Signed-off-by: Johan Hovold <redacted>
---
drivers/base/platform.c | 17 +++++++++++++----
include/linux/platform_device.h | 1 +
2 files changed, 14 insertions(+), 4 deletions(-)
On Mon, Sep 23, 2013 at 04:27:25PM +0200, Johan Hovold wrote:
Deferred probing cannot be used with platform_driver_probe as by the
time probing is retried either the driver has been unregistered or its
probe function has been set to platform_drv_probe_fail.
With commit e9354576 ("gpiolib: Defer failed gpio requests by default")
the gpio subsystem started returning -EPROBE_DEFER, which in turn
several platform drivers using platform_driver_probe return to driver
core. Other subsystems (e.g. regulator) has since started doing the
same.
The first patch in this series prevents platform drivers using
platform_driver_probe from requesting probe deferral while warning that
it is not supported.
The remaining patches move six platform-driver probe functions that rely
on gpio_request out of __init. There are likely other probe functions
that might return -EPROBE_DEFER and should be moved out of __init as
well.
As usually when I read this I wonder why platform_driver_probe exists
anyway. The only advantage I can think off is that the probe functions
are in __init and thus can be disposed of later. Now you remove the
__init annotations from these probe functions. Wouldn't it be better to
convert the drivers to regular platform_driver_register instead?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
From: Johan Hovold <hidden> Date: 2013-09-23 15:20:25
On Mon, Sep 23, 2013 at 04:50:29PM +0200, Sascha Hauer wrote:
On Mon, Sep 23, 2013 at 04:27:25PM +0200, Johan Hovold wrote:
quoted
Deferred probing cannot be used with platform_driver_probe as by the
time probing is retried either the driver has been unregistered or its
probe function has been set to platform_drv_probe_fail.
With commit e9354576 ("gpiolib: Defer failed gpio requests by default")
the gpio subsystem started returning -EPROBE_DEFER, which in turn
several platform drivers using platform_driver_probe return to driver
core. Other subsystems (e.g. regulator) has since started doing the
same.
The first patch in this series prevents platform drivers using
platform_driver_probe from requesting probe deferral while warning that
it is not supported.
The remaining patches move six platform-driver probe functions that rely
on gpio_request out of __init. There are likely other probe functions
that might return -EPROBE_DEFER and should be moved out of __init as
well.
As usually when I read this I wonder why platform_driver_probe exists
anyway. The only advantage I can think off is that the probe functions
are in __init and thus can be disposed of later. Now you remove the
__init annotations from these probe functions. Wouldn't it be better to
convert the drivers to regular platform_driver_register instead?
Perhaps that paragraph was a bit unclear: I move them out of __init
_and_ use platform_driver_register instead of platform_driver_probe as
well.
Johan
On Mon, Sep 23, 2013 at 05:20:18PM +0200, Johan Hovold wrote:
On Mon, Sep 23, 2013 at 04:50:29PM +0200, Sascha Hauer wrote:
quoted
On Mon, Sep 23, 2013 at 04:27:25PM +0200, Johan Hovold wrote:
quoted
Deferred probing cannot be used with platform_driver_probe as by the
time probing is retried either the driver has been unregistered or its
probe function has been set to platform_drv_probe_fail.
With commit e9354576 ("gpiolib: Defer failed gpio requests by default")
the gpio subsystem started returning -EPROBE_DEFER, which in turn
several platform drivers using platform_driver_probe return to driver
core. Other subsystems (e.g. regulator) has since started doing the
same.
The first patch in this series prevents platform drivers using
platform_driver_probe from requesting probe deferral while warning that
it is not supported.
The remaining patches move six platform-driver probe functions that rely
on gpio_request out of __init. There are likely other probe functions
that might return -EPROBE_DEFER and should be moved out of __init as
well.
As usually when I read this I wonder why platform_driver_probe exists
anyway. The only advantage I can think off is that the probe functions
are in __init and thus can be disposed of later. Now you remove the
__init annotations from these probe functions. Wouldn't it be better to
convert the drivers to regular platform_driver_register instead?
Perhaps that paragraph was a bit unclear: I move them out of __init
_and_ use platform_driver_register instead of platform_driver_probe as
well.
Oh yes, I should have looked closer. Sorry for the noise.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
From: Nicolas Ferre <hidden> Date: 2013-09-23 16:53:33
On 23/09/2013 16:27, Johan Hovold :
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.
Since commit e9354576 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.
Cc: Jean-Christophe PLAGNIOL-VILLARD <redacted>
Cc: Nicolas Ferre <redacted>