* [PATCH 0/9] fix deferred probing issue of platform_driver_probe @ 2013-10-08 20:35 Wolfram Sang 2013-10-08 20:35 ` [PATCH 1/9] i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing Wolfram Sang ` (3 more replies) 0 siblings, 4 replies; 9+ messages in thread From: Wolfram Sang @ 2013-10-08 20:35 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r Cc: Wolfram Sang, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, linux-spi-u79uwXL29TY76Z2rM5mHXA We had some issues with deferred probing in the I2C subsystem. This series attempts to fix a part of it. From the patch description: === Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. === I think it makes sense to remove platform_driver_probe from bus masters like i2c and spi (especially since they are dependant on pinctrl these days). This is what this series does. I had a look at dma drivers as well, but there are more things to be considered, so delayed for now. Please comment. If no objections are raised, I'd like to bring at least the I2C patches into v3.12, so deferred devices will then be correctly probed. The series is based on 3.12-rc4 and was compile-tested. It is available at git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git platform_driver_probe_drop Regards, Wolfram Wolfram Sang (9): i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing i2c: i2c-imx: replace platform_driver_probe to support deferred probing i2c: i2c-mxs: replace platform_driver_probe to support deferred probing i2c: i2c-stu300: replace platform_driver_probe to support deferred probing spi: spi-au1550: replace platform_driver_probe to support deferred probing spi: spi-bfin5xx: replace platform_driver_probe to support deferred probing spi: spi-omap-uwire: replace platform_driver_probe to support deferred probing spi: spi-s3c64xx: replace platform_driver_probe to support deferred probing spi: spi-txx9: replace platform_driver_probe to support deferred probing drivers/i2c/busses/i2c-designware-platdrv.c | 5 +++-- drivers/i2c/busses/i2c-imx.c | 11 ++++++----- drivers/i2c/busses/i2c-mxs.c | 3 ++- drivers/i2c/busses/i2c-stu300.c | 11 +++++------ drivers/spi/spi-au1550.c | 3 ++- drivers/spi/spi-bfin5xx.c | 5 +++-- drivers/spi/spi-omap-uwire.c | 5 +++-- drivers/spi/spi-s3c64xx.c | 3 ++- drivers/spi/spi-txx9.c | 3 ++- 9 files changed, 28 insertions(+), 21 deletions(-) -- 1.8.4.rc3 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/9] i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing 2013-10-08 20:35 [PATCH 0/9] fix deferred probing issue of platform_driver_probe Wolfram Sang @ 2013-10-08 20:35 ` Wolfram Sang [not found] ` <1381264542-29396-2-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2013-10-08 20:35 ` [PATCH 2/9] i2c: i2c-imx: " Wolfram Sang ` (2 subsequent siblings) 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2013-10-08 20:35 UTC (permalink / raw) To: linux-arm-kernel; +Cc: Wolfram Sang, Zhangfei Gao, linux-i2c, linux-kernel Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: Zhangfei Gao <zhangfei.gao@linaro.org> --- drivers/i2c/busses/i2c-designware-platdrv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 4c1b605..0aa0113 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -270,7 +270,8 @@ static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume); MODULE_ALIAS("platform:i2c_designware"); static struct platform_driver dw_i2c_driver = { - .remove = dw_i2c_remove, + .probe = dw_i2c_probe, + .remove = dw_i2c_remove, .driver = { .name = "i2c_designware", .owner = THIS_MODULE, @@ -282,7 +283,7 @@ static struct platform_driver dw_i2c_driver = { static int __init dw_i2c_init_driver(void) { - return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe); + return platform_driver_register(&dw_i2c_driver); } subsys_initcall(dw_i2c_init_driver); -- 1.8.4.rc3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <1381264542-29396-2-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>]
* Re: [PATCH 1/9] i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing [not found] ` <1381264542-29396-2-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> @ 2013-10-14 1:09 ` zhangfei gao 0 siblings, 0 replies; 9+ messages in thread From: zhangfei gao @ 2013-10-14 1:09 UTC (permalink / raw) To: Wolfram Sang Cc: linux-arm-kernel, Zhangfei Gao, Linux I2C, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Wed, Oct 9, 2013 at 4:35 AM, Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> wrote: > Subsystems like pinctrl and gpio rightfully make use of deferred probing at > core level. Now, deferred drivers won't be retried if they don't have a .probe > function specified in the driver struct. Fix this driver to have that, so the > devices it supports won't get lost in a deferred probe. > > Signed-off-by: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> > Cc: Zhangfei Gao <zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Acked-by: Zhangfei Gao <zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Thanks ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/9] i2c: i2c-imx: replace platform_driver_probe to support deferred probing 2013-10-08 20:35 [PATCH 0/9] fix deferred probing issue of platform_driver_probe Wolfram Sang 2013-10-08 20:35 ` [PATCH 1/9] i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing Wolfram Sang @ 2013-10-08 20:35 ` Wolfram Sang [not found] ` <1381264542-29396-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2013-10-08 20:35 ` [PATCH 3/9] i2c: i2c-mxs: " Wolfram Sang 2013-10-08 20:35 ` [PATCH 4/9] i2c: i2c-stu300: " Wolfram Sang 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2013-10-08 20:35 UTC (permalink / raw) To: linux-arm-kernel; +Cc: Wolfram Sang, kernel, linux-i2c, linux-kernel Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: kernel@pengutronix.de --- drivers/i2c/busses/i2c-imx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index ccf4665..1d7efa3 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -365,7 +365,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) clk_disable_unprepare(i2c_imx->clk); } -static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, +static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, unsigned int rate) { struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div; @@ -589,7 +589,7 @@ static struct i2c_algorithm i2c_imx_algo = { .functionality = i2c_imx_func, }; -static int __init i2c_imx_probe(struct platform_device *pdev) +static int i2c_imx_probe(struct platform_device *pdev) { const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids, &pdev->dev); @@ -697,7 +697,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) return 0; /* Return OK */ } -static int __exit i2c_imx_remove(struct platform_device *pdev) +static int i2c_imx_remove(struct platform_device *pdev) { struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev); @@ -715,7 +715,8 @@ static int __exit i2c_imx_remove(struct platform_device *pdev) } static struct platform_driver i2c_imx_driver = { - .remove = __exit_p(i2c_imx_remove), + .probe = i2c_imx_probe, + .remove = i2c_imx_remove, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, @@ -726,7 +727,7 @@ static struct platform_driver i2c_imx_driver = { static int __init i2c_adap_imx_init(void) { - return platform_driver_probe(&i2c_imx_driver, i2c_imx_probe); + return platform_driver_register(&i2c_imx_driver); } subsys_initcall(i2c_adap_imx_init); -- 1.8.4.rc3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <1381264542-29396-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>]
* Re: [PATCH 2/9] i2c: i2c-imx: replace platform_driver_probe to support deferred probing [not found] ` <1381264542-29396-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> @ 2013-10-09 7:34 ` Uwe Kleine-König 0 siblings, 0 replies; 9+ messages in thread From: Uwe Kleine-König @ 2013-10-09 7:34 UTC (permalink / raw) To: Wolfram Sang Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, kernel-bIcnvbaLZ9MEGnE8C9+IrQ, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Tue, Oct 08, 2013 at 10:35:34PM +0200, Wolfram Sang wrote: > Subsystems like pinctrl and gpio rightfully make use of deferred probing at > core level. Now, deferred drivers won't be retried if they don't have a .probe > function specified in the driver struct. Fix this driver to have that, so the > devices it supports won't get lost in a deferred probe. > > Signed-off-by: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> > Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org Acked-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> Thanks Uwe > --- > drivers/i2c/busses/i2c-imx.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index ccf4665..1d7efa3 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -365,7 +365,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) > clk_disable_unprepare(i2c_imx->clk); > } > > -static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, > +static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, > unsigned int rate) > { > struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div; > @@ -589,7 +589,7 @@ static struct i2c_algorithm i2c_imx_algo = { > .functionality = i2c_imx_func, > }; > > -static int __init i2c_imx_probe(struct platform_device *pdev) > +static int i2c_imx_probe(struct platform_device *pdev) > { > const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids, > &pdev->dev); > @@ -697,7 +697,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) > return 0; /* Return OK */ > } > > -static int __exit i2c_imx_remove(struct platform_device *pdev) > +static int i2c_imx_remove(struct platform_device *pdev) > { > struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev); > > @@ -715,7 +715,8 @@ static int __exit i2c_imx_remove(struct platform_device *pdev) > } > > static struct platform_driver i2c_imx_driver = { > - .remove = __exit_p(i2c_imx_remove), > + .probe = i2c_imx_probe, > + .remove = i2c_imx_remove, > .driver = { > .name = DRIVER_NAME, > .owner = THIS_MODULE, > @@ -726,7 +727,7 @@ static struct platform_driver i2c_imx_driver = { > > static int __init i2c_adap_imx_init(void) > { > - return platform_driver_probe(&i2c_imx_driver, i2c_imx_probe); > + return platform_driver_register(&i2c_imx_driver); > } > subsys_initcall(i2c_adap_imx_init); > > -- > 1.8.4.rc3 > > -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ | ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/9] i2c: i2c-mxs: replace platform_driver_probe to support deferred probing 2013-10-08 20:35 [PATCH 0/9] fix deferred probing issue of platform_driver_probe Wolfram Sang 2013-10-08 20:35 ` [PATCH 1/9] i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing Wolfram Sang 2013-10-08 20:35 ` [PATCH 2/9] i2c: i2c-imx: " Wolfram Sang @ 2013-10-08 20:35 ` Wolfram Sang [not found] ` <1381264542-29396-4-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2013-10-08 20:35 ` [PATCH 4/9] i2c: i2c-stu300: " Wolfram Sang 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2013-10-08 20:35 UTC (permalink / raw) To: linux-arm-kernel; +Cc: Marek Vasut, linux-kernel, linux-i2c, Wolfram Sang Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: Marek Vasut <marex@denx.de> --- drivers/i2c/busses/i2c-mxs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index f4a0167..b7c8577 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c @@ -780,12 +780,13 @@ static struct platform_driver mxs_i2c_driver = { .owner = THIS_MODULE, .of_match_table = mxs_i2c_dt_ids, }, + .probe = mxs_i2c_probe, .remove = mxs_i2c_remove, }; static int __init mxs_i2c_init(void) { - return platform_driver_probe(&mxs_i2c_driver, mxs_i2c_probe); + return platform_driver_register(&mxs_i2c_driver); } subsys_initcall(mxs_i2c_init); -- 1.8.4.rc3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <1381264542-29396-4-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>]
* Re: [PATCH 3/9] i2c: i2c-mxs: replace platform_driver_probe to support deferred probing [not found] ` <1381264542-29396-4-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> @ 2013-10-08 20:58 ` Marek Vasut 0 siblings, 0 replies; 9+ messages in thread From: Marek Vasut @ 2013-10-08 20:58 UTC (permalink / raw) To: Wolfram Sang Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-i2c-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Dear Wolfram Sang, > Subsystems like pinctrl and gpio rightfully make use of deferred probing at > core level. Now, deferred drivers won't be retried if they don't have a > .probe function specified in the driver struct. Fix this driver to have > that, so the devices it supports won't get lost in a deferred probe. > > Signed-off-by: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> > Cc: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> Certainly makes sense, Acked-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> Thanks! Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/9] i2c: i2c-stu300: replace platform_driver_probe to support deferred probing 2013-10-08 20:35 [PATCH 0/9] fix deferred probing issue of platform_driver_probe Wolfram Sang ` (2 preceding siblings ...) 2013-10-08 20:35 ` [PATCH 3/9] i2c: i2c-mxs: " Wolfram Sang @ 2013-10-08 20:35 ` Wolfram Sang 2013-10-09 13:37 ` Linus Walleij 3 siblings, 1 reply; 9+ messages in thread From: Wolfram Sang @ 2013-10-08 20:35 UTC (permalink / raw) To: linux-arm-kernel; +Cc: linux-kernel, Linus Walleij, linux-i2c, Wolfram Sang Subsystems like pinctrl and gpio rightfully make use of deferred probing at core level. Now, deferred drivers won't be retried if they don't have a .probe function specified in the driver struct. Fix this driver to have that, so the devices it supports won't get lost in a deferred probe. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Cc: Linus Walleij <linus.walleij@linaro.org> --- drivers/i2c/busses/i2c-stu300.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index f8f6f2e..04a17b9 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c @@ -859,8 +859,7 @@ static const struct i2c_algorithm stu300_algo = { .functionality = stu300_func, }; -static int __init -stu300_probe(struct platform_device *pdev) +static int stu300_probe(struct platform_device *pdev) { struct stu300_dev *dev; struct i2c_adapter *adap; @@ -966,8 +965,7 @@ static SIMPLE_DEV_PM_OPS(stu300_pm, stu300_suspend, stu300_resume); #define STU300_I2C_PM NULL #endif -static int __exit -stu300_remove(struct platform_device *pdev) +static int stu300_remove(struct platform_device *pdev) { struct stu300_dev *dev = platform_get_drvdata(pdev); @@ -989,13 +987,14 @@ static struct platform_driver stu300_i2c_driver = { .pm = STU300_I2C_PM, .of_match_table = stu300_dt_match, }, - .remove = __exit_p(stu300_remove), + .probe = stu300_probe, + .remove = stu300_remove, }; static int __init stu300_init(void) { - return platform_driver_probe(&stu300_i2c_driver, stu300_probe); + return platform_driver_register(&stu300_i2c_driver); } static void __exit stu300_exit(void) -- 1.8.4.rc3 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 4/9] i2c: i2c-stu300: replace platform_driver_probe to support deferred probing 2013-10-08 20:35 ` [PATCH 4/9] i2c: i2c-stu300: " Wolfram Sang @ 2013-10-09 13:37 ` Linus Walleij 0 siblings, 0 replies; 9+ messages in thread From: Linus Walleij @ 2013-10-09 13:37 UTC (permalink / raw) To: Wolfram Sang Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org On Tue, Oct 8, 2013 at 10:35 PM, Wolfram Sang <wsa@the-dreams.de> wrote: > Subsystems like pinctrl and gpio rightfully make use of deferred probing at > core level. Now, deferred drivers won't be retried if they don't have a .probe > function specified in the driver struct. Fix this driver to have that, so the > devices it supports won't get lost in a deferred probe. > > Signed-off-by: Wolfram Sang <wsa@the-dreams.de> > Cc: Linus Walleij <linus.walleij@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-10-14 1:09 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-10-08 20:35 [PATCH 0/9] fix deferred probing issue of platform_driver_probe Wolfram Sang 2013-10-08 20:35 ` [PATCH 1/9] i2c: i2c-designware-platdrv: replace platform_driver_probe to support deferred probing Wolfram Sang [not found] ` <1381264542-29396-2-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2013-10-14 1:09 ` zhangfei gao 2013-10-08 20:35 ` [PATCH 2/9] i2c: i2c-imx: " Wolfram Sang [not found] ` <1381264542-29396-3-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2013-10-09 7:34 ` Uwe Kleine-König 2013-10-08 20:35 ` [PATCH 3/9] i2c: i2c-mxs: " Wolfram Sang [not found] ` <1381264542-29396-4-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> 2013-10-08 20:58 ` Marek Vasut 2013-10-08 20:35 ` [PATCH 4/9] i2c: i2c-stu300: " Wolfram Sang 2013-10-09 13:37 ` Linus Walleij
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).