From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Tomas Melin <tomas.melin@vaisala.com>
Cc: 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:23:29 +0300 [thread overview]
Message-ID: <ZPW+MXuBSYEE1GfF@smile.fi.intel.com> (raw)
In-Reply-To: <20230904101533.455896-1-tomas.melin@vaisala.com>
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.
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
...
$ 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).
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-09-04 11:23 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 [this message]
2023-09-04 13:12 ` Jonathan Cameron
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=ZPW+MXuBSYEE1GfF@smile.fi.intel.com \
--to=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 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.