From: Guenter Roeck <linux@roeck-us.net>
To: Danilo Bargen <mail@dbrgn.ch>
Cc: linux-hwmon@vger.kernel.org, jdelvare@suse.com,
andreas.brauchli@sensirion.com
Subject: Re: [PATCH] hwmon: (sht21) Don't use clock stretching
Date: Wed, 31 Jan 2018 07:57:12 -0800 [thread overview]
Message-ID: <20180131155712.GA21986@roeck-us.net> (raw)
In-Reply-To: <20180131153923.3df073df@adalbert.office.threema.ch>
On Wed, Jan 31, 2018 at 03:39:23PM +0100, Danilo Bargen wrote:
> Hello Guenter
>
> Thank you for your fast review!
>
> > The driver must now support I2C_FUNC_I2C which is a significant change in functionality
> > since it will no longer work on SMBus-only adapters.
>
> You are right of course, I wasn't aware of that.
>
> > You'll have to find a better
> > solution, one that retains the old functionality but also works on the Raspberry Pi.
>
> What are my options? A separate driver (sht21nhm) would probably not be accepted, right?
>
One option would be to implement access functions differently if clock
stretching is known to not work. That would, however, require infrastructure
support since the controller driver should tell the chip driver that it doesnot
support clock stretching.
> Or should I instead try to submit it to the Raspberry Pi kernel tree directly?
>
> > FWIW, this should really be solved in the infrastructure. Many devices support and
> > depend on clock stretching, and we can not mess up the drivers for all those devices
> > to deal with a broken adapter.
>
> Could you elaborate what you mean with "in the infrastructure"? Could there be a
> way to solve this on the i2c / adapter driver level?
>
As mentioned above, this is really a i2c controller driver issue. If the
controller driver does not support clock stretching, it should tell chip drivers
about it. There should also be infrastructure support to support "simulated"
clock stretching; otherwise each and every chip driver who needs it would have
to re-implement the same set of hacks.
> An interesting sidenote is that the driver used to work on the Raspberry Pi with
> older kernel versions, but not on current ones. (I'd have to look up the exact
> versions, but I think it changed sometime last year.) Maybe something about the
> timing was changed that broke clock stretching.
>
Wouldn't it make sense then to track down the patch which introduced the problem
and fix the underlying issue instead of working around it ?
Guenter
> > Has this been discussed on the i2c mailing list ?
>
> I did not submit a discussion so far, and the mailing list search did not
> turn up anything related. Should I start a discussion there?
>
> Cheers and thanks for your time,
> Danilo Bargen
prev parent reply other threads:[~2018-01-31 15:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 23:37 [PATCH] hwmon: (sht21) Don't use clock stretching Danilo Bargen
2018-01-27 16:26 ` Guenter Roeck
2018-01-31 14:39 ` Danilo Bargen
2018-01-31 15:57 ` Guenter Roeck [this message]
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=20180131155712.GA21986@roeck-us.net \
--to=linux@roeck-us.net \
--cc=andreas.brauchli@sensirion.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=mail@dbrgn.ch \
/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