The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Angelo Dureghello" <adureghello@baylibre.com>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] iio: adc: ad7606_spi: add offload scan mask check
Date: Sun, 4 May 2025 15:37:56 +0100	[thread overview]
Message-ID: <20250504153756.27cf44fb@jic23-huawei> (raw)
In-Reply-To: <CAHp75VdtoxGu1qv7i6uhuPhAeVF7OUF3d5trxqcmupC+ZeAf0A@mail.gmail.com>

On Fri, 2 May 2025 21:21:49 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Fri, May 2, 2025 at 6:42 PM David Lechner <dlechner@baylibre.com> wrote:
> >
> > Validate the scan mask when SPI offloading is being used.
> >
> > Since this family of ADCs is simultaneous sampling, there isn't a way
> > to selectively disable channels when reading sample data. (Technically,
> > AD7616 has a sequencer so could have some control, but that is for  
> 
> so it could
tweaked to 
so the driver could
given 'it' would otherwise refer to the chip rather than the software.

Good catch.

Applied.

> 
> > another day).
> >
> > For "regular" IIO triggered buffer reads, this isn't a problem and the
> > IIO core will demux the data and ignore data from disabled channels.
> > However, since SPI offloading is done completely in hardware, we don't
> > have a way to do the same. So before this patch, if less than all
> > channels were enabled, the data would be misplaced in the buffer.
> >
> > By adding a check in update_scan_mode, we can fail to enable the buffer
> > instead of having bad data returned to userspace.  
> 
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
> 


  reply	other threads:[~2025-05-04 14:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02 15:42 [PATCH v2] iio: adc: ad7606_spi: add offload scan mask check David Lechner
2025-05-02 18:21 ` Andy Shevchenko
2025-05-04 14:37   ` Jonathan Cameron [this message]
2025-05-04  8:37 ` Nuno Sá

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=20250504153756.27cf44fb@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=adureghello@baylibre.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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