From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 10/10] drivers: misc: use module_platform_driver_probe()
Date: Wed, 20 Mar 2013 11:46:07 +0000 [thread overview]
Message-ID: <201303201146.07987.arnd@arndb.de> (raw)
In-Reply-To: <CAHkwnC-8FH0nyJ+eT=+7doP+fSdZjNYUW4zzs_r6e9wt3Yt4Fg@mail.gmail.com>
On Wednesday 20 March 2013, Fabio Porcedda wrote:
>
> On Wed, Mar 20, 2013 at 11:20 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 20 March 2013, Fabio Porcedda wrote:
> >> I think we can check inside the deferred_probe_work_func()
> >> if the dev->probe function pointer is equal to platform_drv_probe_fail().
> >
> > I think it's too late by then, because that would only warn if we try to probe
> > it again, but when platform_driver_probe() does not succeed immediately, it
>
> Maybe you mean "does succeed immediately" ?
I mean in this code (simplified for the sake of discussion)
int __init_or_module platform_driver_probe(struct platform_driver *drv,
int (*probe)(struct platform_device *))
{
int retval, code;
drv->probe = probe;
retval = code = platform_driver_register(drv);
drv->probe = NULL;
if (code = 0 && list_empty(&drv->driver.p->klist_devices.k_list))
retval = -ENODEV;
drv->driver.probe = platform_drv_probe_fail;
if (code != retval)
platform_driver_unregister(drv);
return retval;
}
we assume that all devices are bound to drivers during the call to
platform_driver_register, and if the device list is empty afterwards,
we unregister the driver and will never get to the deferred probing
stage.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
H Hartley Sweeten <hartleys@visionengravers.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Grant Likely <grant.likely@secretlab.ca>
Subject: Re: [PATCH 10/10] drivers: misc: use module_platform_driver_probe()
Date: Wed, 20 Mar 2013 11:46:07 +0000 [thread overview]
Message-ID: <201303201146.07987.arnd@arndb.de> (raw)
In-Reply-To: <CAHkwnC-8FH0nyJ+eT=+7doP+fSdZjNYUW4zzs_r6e9wt3Yt4Fg@mail.gmail.com>
On Wednesday 20 March 2013, Fabio Porcedda wrote:
>
> On Wed, Mar 20, 2013 at 11:20 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 20 March 2013, Fabio Porcedda wrote:
> >> I think we can check inside the deferred_probe_work_func()
> >> if the dev->probe function pointer is equal to platform_drv_probe_fail().
> >
> > I think it's too late by then, because that would only warn if we try to probe
> > it again, but when platform_driver_probe() does not succeed immediately, it
>
> Maybe you mean "does succeed immediately" ?
I mean in this code (simplified for the sake of discussion)
int __init_or_module platform_driver_probe(struct platform_driver *drv,
int (*probe)(struct platform_device *))
{
int retval, code;
drv->probe = probe;
retval = code = platform_driver_register(drv);
drv->probe = NULL;
if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list))
retval = -ENODEV;
drv->driver.probe = platform_drv_probe_fail;
if (code != retval)
platform_driver_unregister(drv);
return retval;
}
we assume that all devices are bound to drivers during the call to
platform_driver_register, and if the device list is empty afterwards,
we unregister the driver and will never get to the deferred probing
stage.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/10] drivers: misc: use module_platform_driver_probe()
Date: Wed, 20 Mar 2013 11:46:07 +0000 [thread overview]
Message-ID: <201303201146.07987.arnd@arndb.de> (raw)
In-Reply-To: <CAHkwnC-8FH0nyJ+eT=+7doP+fSdZjNYUW4zzs_r6e9wt3Yt4Fg@mail.gmail.com>
On Wednesday 20 March 2013, Fabio Porcedda wrote:
>
> On Wed, Mar 20, 2013 at 11:20 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Wednesday 20 March 2013, Fabio Porcedda wrote:
> >> I think we can check inside the deferred_probe_work_func()
> >> if the dev->probe function pointer is equal to platform_drv_probe_fail().
> >
> > I think it's too late by then, because that would only warn if we try to probe
> > it again, but when platform_driver_probe() does not succeed immediately, it
>
> Maybe you mean "does succeed immediately" ?
I mean in this code (simplified for the sake of discussion)
int __init_or_module platform_driver_probe(struct platform_driver *drv,
int (*probe)(struct platform_device *))
{
int retval, code;
drv->probe = probe;
retval = code = platform_driver_register(drv);
drv->probe = NULL;
if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list))
retval = -ENODEV;
drv->driver.probe = platform_drv_probe_fail;
if (code != retval)
platform_driver_unregister(drv);
return retval;
}
we assume that all devices are bound to drivers during the call to
platform_driver_register, and if the device list is empty afterwards,
we unregister the driver and will never get to the deferred probing
stage.
Arnd
next prev parent reply other threads:[~2013-03-20 11:46 UTC|newest]
Thread overview: 131+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-14 13:11 [PATCH 00/10] Use module_platform_driver_probe() part 2 Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [lm-sensors] " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 01/10] drivers: media: use module_platform_driver_probe() Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:25 ` Guennadi Liakhovetski
2013-03-14 13:25 ` Guennadi Liakhovetski
2013-03-14 13:25 ` Guennadi Liakhovetski
2013-03-14 16:40 ` Fabio Porcedda
2013-03-14 16:40 ` Fabio Porcedda
2013-03-14 16:40 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH] drivers: misc: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [lm-sensors] " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 02/10] drivers: ata: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [lm-sensors] " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 03/10] drivers: char: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 04/10] drivers: hwmon: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [lm-sensors] " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 14:01 ` Guenter Roeck
2013-03-14 14:01 ` Guenter Roeck
2013-03-14 14:01 ` [lm-sensors] " Guenter Roeck
2013-03-14 14:01 ` Guenter Roeck
2013-03-14 16:42 ` Fabio Porcedda
2013-03-14 16:42 ` Fabio Porcedda
2013-03-14 16:42 ` [lm-sensors] " Fabio Porcedda
2013-03-14 16:42 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 05/10] drivers: ide: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [lm-sensors] " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 06/10] drivers: input: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 07/10] drivers: memory: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 08/10] drivers: mfd: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-04-09 8:06 ` Samuel Ortiz
2013-04-09 8:06 ` Samuel Ortiz
2013-04-09 8:06 ` Samuel Ortiz
2013-04-09 9:23 ` Fabio Porcedda
2013-04-09 9:23 ` Fabio Porcedda
2013-04-09 9:23 ` Fabio Porcedda
2013-04-09 9:23 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 09/10] drivers: video: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [PATCH 10/10] drivers: misc: " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:11 ` [lm-sensors] " Fabio Porcedda
2013-03-14 13:11 ` Fabio Porcedda
2013-03-14 13:58 ` Arnd Bergmann
2013-03-14 13:58 ` Arnd Bergmann
2013-03-14 13:58 ` Arnd Bergmann
2013-03-14 14:06 ` Sascha Hauer
2013-03-14 14:06 ` Sascha Hauer
2013-03-14 14:06 ` Sascha Hauer
2013-03-15 11:18 ` Fabio Porcedda
2013-03-15 11:18 ` Fabio Porcedda
2013-03-15 11:18 ` Fabio Porcedda
2013-03-15 11:28 ` Arnd Bergmann
2013-03-15 11:28 ` Arnd Bergmann
2013-03-15 11:28 ` Arnd Bergmann
2013-03-15 11:28 ` Arnd Bergmann
2013-03-15 18:09 ` Fabio Porcedda
2013-03-15 18:09 ` Fabio Porcedda
2013-03-15 18:09 ` Fabio Porcedda
2013-03-15 17:43 ` H Hartley Sweeten
2013-03-15 17:43 ` H Hartley Sweeten
2013-03-15 17:43 ` H Hartley Sweeten
2013-03-15 20:18 ` Arnd Bergmann
2013-03-15 20:18 ` Arnd Bergmann
2013-03-15 20:18 ` Arnd Bergmann
2013-03-15 20:18 ` Arnd Bergmann
2013-03-18 10:03 ` Fabio Porcedda
2013-03-18 10:03 ` Fabio Porcedda
2013-03-18 10:03 ` Fabio Porcedda
2013-03-18 10:58 ` Arnd Bergmann
2013-03-18 10:58 ` Arnd Bergmann
2013-03-18 10:58 ` Arnd Bergmann
2013-03-18 10:58 ` Arnd Bergmann
2013-03-18 11:20 ` Fabio Porcedda
2013-03-18 11:20 ` Fabio Porcedda
2013-03-18 11:20 ` Fabio Porcedda
2013-03-18 11:28 ` Arnd Bergmann
2013-03-18 11:28 ` Arnd Bergmann
2013-03-18 11:28 ` Arnd Bergmann
2013-03-19 8:55 ` Fabio Porcedda
2013-03-19 8:55 ` Fabio Porcedda
2013-03-19 8:55 ` Fabio Porcedda
2013-03-19 9:04 ` Geert Uytterhoeven
2013-03-19 9:04 ` Geert Uytterhoeven
2013-03-19 9:04 ` Geert Uytterhoeven
2013-03-19 16:48 ` Arnd Bergmann
2013-03-19 16:48 ` Arnd Bergmann
2013-03-19 16:48 ` Arnd Bergmann
2013-03-19 17:11 ` Fabio Porcedda
2013-03-19 17:11 ` Fabio Porcedda
2013-03-19 17:11 ` Fabio Porcedda
2013-03-19 17:59 ` Arnd Bergmann
2013-03-19 17:59 ` Arnd Bergmann
2013-03-19 17:59 ` Arnd Bergmann
2013-03-20 9:02 ` Fabio Porcedda
2013-03-20 9:02 ` Fabio Porcedda
2013-03-20 9:02 ` Fabio Porcedda
2013-03-20 10:20 ` Arnd Bergmann
2013-03-20 10:20 ` Arnd Bergmann
2013-03-20 10:20 ` Arnd Bergmann
2013-03-20 10:39 ` Fabio Porcedda
2013-03-20 10:39 ` Fabio Porcedda
2013-03-20 10:39 ` Fabio Porcedda
2013-03-20 11:46 ` Arnd Bergmann [this message]
2013-03-20 11:46 ` Arnd Bergmann
2013-03-20 11:46 ` Arnd Bergmann
2013-03-21 13:10 ` Fabio Porcedda
2013-03-21 13:10 ` Fabio Porcedda
2013-03-21 13:10 ` Fabio Porcedda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201303201146.07987.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.