From: Jonathan Cameron <jic23@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: lorenzo.bianconi@redhat.com, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: imu: st_lsm6dsx: set 10ms as min shub slave timeout
Date: Sun, 1 Nov 2020 15:43:10 +0000 [thread overview]
Message-ID: <20201101154310.6f2aa827@archlinux> (raw)
In-Reply-To: <b0cd79d1b72246652df9ccef19bd951bb17b5c55.1603317102.git.lorenzo@kernel.org>
On Wed, 21 Oct 2020 23:53:54 +0200
Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> Set 10ms as minimum i2c slave configuration timeout since at high ODRs
> (e.g. 833Hz) the slave sensor may need more cycles than ~3ms
> (2s/833Hz + 1) for the configuration
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Hi Lorenzo,
This sounds like a fix to me. Could you give a bit more detail on what
setup it fails for and a fixes tag so we can get this into appropriate
stable trees?
Thanks,
Jonathan
> ---
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> index 8c8d8870ca07..99562ba85ee4 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> @@ -156,11 +156,13 @@ static const struct st_lsm6dsx_ext_dev_settings st_lsm6dsx_ext_dev_table[] = {
> static void st_lsm6dsx_shub_wait_complete(struct st_lsm6dsx_hw *hw)
> {
> struct st_lsm6dsx_sensor *sensor;
> - u32 odr;
> + u32 odr, timeout;
>
> sensor = iio_priv(hw->iio_devs[ST_LSM6DSX_ID_ACC]);
> odr = (hw->enable_mask & BIT(ST_LSM6DSX_ID_ACC)) ? sensor->odr : 12500;
> - msleep((2000000U / odr) + 1);
> + /* set 10ms as minimum timeout for i2c slave configuration */
> + timeout = max_t(u32, 2000000U / odr + 1, 10);
> + msleep(timeout);
> }
>
> /*
next prev parent reply other threads:[~2020-11-01 15:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-21 21:53 [PATCH] iio: imu: st_lsm6dsx: set 10ms as min shub slave timeout Lorenzo Bianconi
2020-11-01 15:43 ` Jonathan Cameron [this message]
2020-11-01 15:53 ` Lorenzo Bianconi
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=20201101154310.6f2aa827@archlinux \
--to=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.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).