From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [v2,1/4] hwmon: iio_hwmon: defer probe when no channel is found
Date: Mon, 18 Jul 2016 06:29:02 -0700 [thread overview]
Message-ID: <578CD99E.5000406@roeck-us.net> (raw)
In-Reply-To: <20160718100232.GE4199@lukather>
On 07/18/2016 03:02 AM, Maxime Ripard wrote:
> Hi Guenter,
>
> On Sat, Jul 16, 2016 at 10:00:13AM -0700, Guenter Roeck wrote:
>> On Fri, Jul 15, 2016 at 11:59:11AM +0200, Quentin Schulz wrote:
>>> iio_channel_get_all returns -ENODEV when it cannot find either phandles and
>>> properties in the Device Tree or channels whose consumer_dev_name matches
>>> iio_hwmon in iio_map_list. The iio_map_list is filled in by iio drivers
>>> which might be probed after iio_hwmon.
>>>
>>> It is better to defer the probe of iio_hwmon if such error is returned by
>>> iio_channel_get_all in order to let a chance to iio drivers to expose
>>> channels in iio_map_list.
>>>
>>> Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
>>> ---
>>>
>>> No modifications for this patch since we did not settled for a solution.
>>> What should we do?
>>>
>> AFAICS the only thing we can do is to replace module_platform_driver() with
>> its explicitly coded variant, and to use use late_initcall() instead of
>> module_init().
>
> I thought this kind of changes to the driver init time were
> discouraged these days?
>
Blindly converting -ENODEV to -EPROBEDEFER doesn't sound like a good idea
either.
>> Anything else would result in endless probe deferrals if there are
>> no channels.
>
> Well, technically, not endless. AFAIK, the kernel only retries when a
> new driver is probed, which should hopefully settle down rather
> quickly.
>
Plus each time a new driver is loaded for whatever reason.
Also, are you sure that leaving a device in deferred probe state doesn't
have undesirable side effects ? For example, would driver_probe_done()
ever return true ?
Guenter
next prev parent reply other threads:[~2016-07-18 13:29 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 9:59 [PATCH v2 0/4] add support for Allwinner SoCs ADC Quentin Schulz
2016-07-15 9:59 ` [PATCH v2 1/4] hwmon: iio_hwmon: defer probe when no channel is found Quentin Schulz
2016-07-16 17:00 ` [v2,1/4] " Guenter Roeck
2016-07-18 10:02 ` Maxime Ripard
2016-07-18 13:29 ` Guenter Roeck [this message]
2016-07-15 9:59 ` [PATCH v2 2/4] iio: adc: add support for Allwinner SoCs ADC Quentin Schulz
2016-07-18 12:57 ` Maxime Ripard
2016-07-19 9:04 ` Quentin Schulz
2016-07-19 12:40 ` Maxime Ripard
2016-07-18 13:18 ` Jonathan Cameron
2016-07-19 8:33 ` Quentin Schulz
2016-07-20 14:57 ` Jonathan Cameron
2016-07-21 12:15 ` Quentin Schulz
2016-07-23 6:37 ` Jonathan Cameron
2016-07-20 12:37 ` Quentin Schulz
2016-07-20 14:15 ` Crt Mori
2016-07-20 14:59 ` Jonathan Cameron
2016-07-15 9:59 ` [PATCH v2 3/4] mfd: " Quentin Schulz
2016-07-18 13:02 ` Maxime Ripard
2016-07-19 12:04 ` Quentin Schulz
2016-07-18 13:25 ` Jonathan Cameron
2016-07-19 7:31 ` Lee Jones
2016-07-20 15:01 ` Jonathan Cameron
2016-07-21 12:12 ` Lee Jones
2016-07-21 20:08 ` Maxime Ripard
2016-07-22 13:55 ` Lee Jones
2016-07-23 6:42 ` Jonathan Cameron
2016-07-25 9:55 ` Maxime Ripard
2016-07-19 8:35 ` Quentin Schulz
2016-07-15 9:59 ` [PATCH v2 4/4] hwmon: iio: add label for channels read by iio_hwmon Quentin Schulz
2016-07-15 14:03 ` Guenter Roeck
2016-07-15 14:36 ` Quentin Schulz
2016-07-16 2:53 ` Guenter Roeck
2016-07-18 12:24 ` Jonathan Cameron
2016-07-19 6:55 ` Quentin Schulz
2016-07-20 14:49 ` Jonathan Cameron
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=578CD99E.5000406@roeck-us.net \
--to=linux@roeck-us.net \
--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 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).