linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH AUTOSEL 4.4 23/60] iio: buffer: Don't allow buffers without any channels enabled to be activated
Date: Sun, 21 Jun 2020 20:07:20 -0400	[thread overview]
Message-ID: <20200622000720.GE1931@sasha-vm> (raw)
In-Reply-To: <20200619172733.00005d9d@Huawei.com>

On Fri, Jun 19, 2020 at 05:27:33PM +0100, Jonathan Cameron wrote:
>On Wed, 17 Jun 2020 21:29:27 -0400
>Sasha Levin <sashal@kernel.org> wrote:
>
>> From: Lars-Peter Clausen <lars@metafoo.de>
>>
>> [ Upstream commit b7329249ea5b08b2a1c2c3f24a2f4c495c4f14b8 ]
>>
>> Before activating a buffer make sure that at least one channel is enabled.
>> Activating a buffer with 0 channels enabled doesn't make too much sense and
>> disallowing this case makes sure that individual driver don't have to add
>> special case code to handle it.
>>
>> Currently, without this patch enabling a buffer is possible and no error is
>> produced. With this patch -EINVAL is returned.
>>
>> An example of execution with this patch and some instrumented print-code:
>>    root@analog:~# cd /sys/bus/iio/devices/iio\:device3/buffer
>>    root@analog:/sys/bus/iio/devices/iio:device3/buffer# echo 1 > enable
>>    0: iio_verify_update 748 indio_dev->masklength 2 *insert_buffer->scan_mask 00000000
>>    1: iio_verify_update 753
>>    2:__iio_update_buffers 1115 ret -22
>>    3: iio_buffer_store_enable 1241 ret -22
>>    -bash: echo: write error: Invalid argument
>> 1, 2 & 3 are exit-error paths. 0 the first print in iio_verify_update()
>> rergardless of error path.
>>
>> Without this patch (and same instrumented print-code):
>>    root@analog:~# cd /sys/bus/iio/devices/iio\:device3/buffer
>>    root@analog:/sys/bus/iio/devices/iio:device3/buffer# echo 1 > enable
>>    0: iio_verify_update 748 indio_dev->masklength 2 *insert_buffer->scan_mask 00000000
>>    root@analog:/sys/bus/iio/devices/iio:device3/buffer#
>> Buffer is enabled with no error.
>>
>> Note from Jonathan: Probably not suitable for automatic application to stable.
>> This has been there from the very start.  It tidies up an odd corner
>> case but won't effect any 'real' users.
>>
>
>As noted. I don't think it matters if we do apply this to stable.
>It closes an interface oddity rather than an actual known bug.

I'll drop it, thanks!

-- 
Thanks,
Sasha

      reply	other threads:[~2020-06-22  0:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200618013004.610532-1-sashal@kernel.org>
2020-06-18  1:29 ` [PATCH AUTOSEL 4.4 03/60] iio: light: isl29125: fix iio_triggered_buffer_{predisable,postenable} positions Sasha Levin
2020-06-19 16:31   ` Jonathan Cameron
2020-06-22  0:07     ` Sasha Levin
2020-06-18  1:29 ` [PATCH AUTOSEL 4.4 23/60] iio: buffer: Don't allow buffers without any channels enabled to be activated Sasha Levin
2020-06-19 16:27   ` Jonathan Cameron
2020-06-22  0:07     ` Sasha Levin [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=20200622000720.GE1931@sasha-vm \
    --to=sashal@kernel.org \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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).