linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Sa, Nuno" <Nuno.Sa@analog.com>,
	Paul Cercueil <paul@crapouillou.net>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check
Date: Mon, 3 May 2021 15:56:01 +0200	[thread overview]
Message-ID: <CACRpkdaA5dgG3f8fEqkSny_uUYC_1nFu3=GAPtwS=aoy7qYsJg@mail.gmail.com> (raw)
In-Reply-To: <20210503120615.64b396bd@jic23-huawei>

On Mon, May 3, 2021 at 1:05 PM Jonathan Cameron <jic23@kernel.org> wrote:

> So, I did a bit of detective work on this one.  Seems this change in error
> code was actually introduced as a side effect of Alex's recent rework of
> the IOCTLs.  Prior to that we returned -ENODEV for this case and now
> we do indeed return EINVAL.
>
> So we may need to figure out how to fix that, or decide that such is life
> and modify this code to give the right error message as done in this patch...
>
> Linus / Alex, thoughts?  It's always been a bit messy because we also
> return -ENODEV in the path where the ioctl hits a driver that is going away
> so it hasn't uniquely identified a lack of support for a long time, even
> if that is by far the most likely reason for this return code.

Normally this would be ABI if any existing userspace can break because
of the wrong error code being returned. Linus (the other one) has
clearly stated that the ABI is a contract that cannot be broken.

So I would just try to fix the errorpath to go back to returning -ENODEV.

Yours,
Linus Walleij

  parent reply	other threads:[~2021-05-03 13:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 15:08 [PATCH] tools/iio: iio_event_monitor: Fix ioctl error check Paul Cercueil
2021-04-28 15:30 ` Sa, Nuno
2021-04-28 15:33   ` Sa, Nuno
2021-05-03 11:06     ` Jonathan Cameron
2021-05-03 11:07       ` Jonathan Cameron
2021-05-03 13:56       ` Linus Walleij [this message]
2021-05-03 14:35         ` Alexandru Ardelean

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='CACRpkdaA5dgG3f8fEqkSny_uUYC_1nFu3=GAPtwS=aoy7qYsJg@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=Nuno.Sa@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=pmeerw@pmeerw.net \
    /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).