devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Gwendal Grignou <gwendal@chromium.org>
Cc: jic23@kernel.org, linux-iio@vger.kernel.org,
	chrome-platform@lists.linux.dev, devicetree@vger.kernel.org
Subject: Re: [PATCH v2] iio: cros_ec_sensors: Flush when changing the FIFO timeout
Date: Tue, 8 Apr 2025 07:59:33 +0000	[thread overview]
Message-ID: <Z_TXZT3SPEpTm6tc@google.com> (raw)
In-Reply-To: <20250408055412.1623257-1-gwendal@chromium.org>

On Mon, Apr 07, 2025 at 10:54:11PM -0700, Gwendal Grignou wrote:
> @@ -853,6 +859,16 @@ int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
>  		st->param.sensor_odr.roundup = 1;
>  
>  		ret = cros_ec_motion_send_host_cmd(st, 0);
> +
> +		/* Flush the FIFO in case we are stopping a sensor.
> +		 * If the FIFO has just been emptied, pending samples will be
> +		 * stuck until new samples are available. It will not happen
> +		 * when all the sensors are stopped.
> +		 */
> +		if (ret >= 0 && frequency == 0) {

To disambiguate, `ret == 0` or `!ret`[1].

[1]: https://elixir.bootlin.com/linux/v6.13/source/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c#L411

  reply	other threads:[~2025-04-08  7:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 16:48 [PATCH] drivers: iio: cros_ec_sensors: Flush changing the FIFO timeout Gwendal Grignou
2025-04-02  9:29 ` Tzung-Bi Shih
2025-04-08  5:50   ` Gwendal Grignou
2025-04-08  5:54     ` [PATCH v2] iio: cros_ec_sensors: Flush when " Gwendal Grignou
2025-04-08  7:59       ` Tzung-Bi Shih [this message]
2025-04-08 15:56         ` Gwendal Grignou
2025-04-08 15:56     ` [PATCH v3] " Gwendal Grignou
2025-04-09  1:19       ` Tzung-Bi Shih
2025-04-12 10:42       ` Jonathan Cameron
2025-04-23 22:05         ` Gwendal Grignou

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=Z_TXZT3SPEpTm6tc@google.com \
    --to=tzungbi@kernel.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=devicetree@vger.kernel.org \
    --cc=gwendal@chromium.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.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).