From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Tomas Melin <tomas.melin@vaisala.com>,
<linux-iio@vger.kernel.org>, <jic23@kernel.org>,
<lars@metafoo.de>, <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH] iio: adc: ti-ads1015: support deferred probe
Date: Mon, 4 Sep 2023 14:12:51 +0100 [thread overview]
Message-ID: <20230904141251.00002b7d@Huawei.com> (raw)
In-Reply-To: <ZPW+MXuBSYEE1GfF@smile.fi.intel.com>
On Mon, 4 Sep 2023 14:23:29 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> On Mon, Sep 04, 2023 at 01:15:22PM +0300, Tomas Melin wrote:
> > Support deferred probe for cases where communication on
> > i2c bus fails. These failures could happen for a variety of
> > reasons including bus arbitration error or power failure.
>
> > +out:
> > + if ((ret == -EAGAIN) || (ret == -ENXIO))
> > + return -EPROBE_DEFER;
> > + return ret;
>
> Oh my... This looks so-o hackish.
Agreed. This is a non starter.
> If anything, it has to be fixed on the level of regmap I2C APIs or so.
>
> Maybe something like regmap_i2c_try_write()/try_read() new APIs that
> will provide the above. Otherwise you want to fix _every single driver_
> in the Linux kernel
Any probe ordering dependencies should be described by the
firmware and the driver should 'get' the relevant resource.
If there is anything not describable today then that is what we need
to fix, not paper over the holes.
So can we have specifics of what is happening here?
If it's arbitration with some other entity then fix the arbitration
locking / hand over. If it's power, then make sure the relevant
regulator get gotten and turned on + has the right delays etc.
Jonathan
>
> ...
>
> $ git grep -lw builtin_i2c_driver | wc
> 5 5 123
> $ git grep -lw module_i2c_driver | wc
> 1164 1164 35240
>
> (and more that don't use either of the above macros).
>
next prev parent reply other threads:[~2023-09-04 13:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 10:15 [PATCH] iio: adc: ti-ads1015: support deferred probe Tomas Melin
2023-09-04 11:23 ` Andy Shevchenko
2023-09-04 13:12 ` Jonathan Cameron [this message]
2023-09-05 11:43 ` Tomas Melin
2023-09-05 12:31 ` Lars-Peter Clausen
2023-09-06 5:59 ` Tomas Melin
2023-09-05 12:38 ` Andy Shevchenko
2023-09-05 6:13 ` Tomas Melin
2023-09-05 10:45 ` Andy Shevchenko
2023-09-05 11:44 ` Tomas Melin
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=20230904141251.00002b7d@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=tomas.melin@vaisala.com \
--cc=u.kleine-koenig@pengutronix.de \
/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