public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Peng Fan <peng.fan@nxp.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
	"brgl@bgdev.pl" <brgl@bgdev.pl>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cristian.marussi@arm.com" <cristian.marussi@arm.com>
Subject: Re: [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP
Date: Fri, 5 Apr 2024 19:20:28 +0300	[thread overview]
Message-ID: <ZhAkzFIv9fx-DQN3@smile.fi.intel.com> (raw)
In-Reply-To: <ZhAhpMNv8Agl4vCZ@bogus>

On Fri, Apr 05, 2024 at 05:07:00PM +0100, Sudeep Holla wrote:
> On Fri, Apr 05, 2024 at 06:55:34PM +0300, Andy Shevchenko wrote:
> > On Fri, Apr 05, 2024 at 04:47:19PM +0100, Sudeep Holla wrote:

...

> > > Well, I don't agree with that 100% now since this is GPIO/pinmux sub-system
> > > practice only.
> >
> > 	git grep -lw ENOTSUPP
> >
> > utterly disagrees with you.
> >
> 
> /me more confused. Though I haven't dig deeper to chech how many of these
> EOPNOTSUPP uses are intended for userspace.
> 
> $git grep -lw ENOTSUPP | wc -l
> 713
> git grep -lw EOPNOTSUPP | wc -l
> 2946

I (mis?) interpret your words that only GPIO/pin control uses ENOTSUPP internally.

> > > What if we change the source/root error cause(SCMI) in this
> > > case and keep GPIO/pinmux happy today but tomorrow when this needs to be
> > > used in some other subsystem which uses EOPNOTSUPP by default/consistently.
> >
> > This is different case. For that we may shadow error codes with explicit
> > comments.
> 
> Sure as along as that is acceptable.
> 
> > > Now how do we address that then, hence I mentioned I am not 100% in agreement
> > > now while I was before knowing that this is GPIO/pinmux strategy.
> > >
> > > I don't know how to proceed now 🙁.
> >
> > KISS principle? There are only 10+ drivers to fix (I showed a rough list)
> > to use ENOTSUPP instead of 100s+ otherwise.
> 
> Again I assume you are referring to just GPIO/pinmux subsystem right.

Yes, I am.

> As the number of occurrence of EOPNOTSUPP in the kernel overall is quite
> large.

Of course that is out of scope of GPIO/pin control design.

> I was thinking of changing the SCMI error map from EOPNOTSUPP to ENOTSUPP,
> but for now I think it is better to just handle the mapping in the pinmux
> part of SCMI that pinmux subsystem interacts with.

Sure. Wherever you prefer, the only expectation that GPIO / pin control callbacks
will return into GPIO / pin control _core_ ENOTSUPP.

> In future if more
> subsystem expect ENOTSUPP, then we can change it. I hope this aligns with
> KISS principle as we are just fixing for the case that is know to cause
> issue rather than changing all probably regressing and then having to
> fix them all.

Exactly!

> Thanks for the time and explanation.

Thanks for discussion!

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-04-05 16:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01 14:10 [PATCH] pinctrl: pinconf-generic: check error value EOPNOTSUPP Peng Fan (OSS)
2024-04-04 11:44 ` Linus Walleij
2024-04-04 17:05   ` Andy Shevchenko
2024-04-04 19:03     ` Linus Walleij
2024-04-04 19:23       ` Andy Shevchenko
2024-04-05  0:26         ` Peng Fan
2024-04-05  2:13     ` Peng Fan
2024-04-05  9:46       ` Sudeep Holla
2024-04-05 15:39         ` Andy Shevchenko
2024-04-05 15:38       ` Andy Shevchenko
2024-04-05 15:47         ` Sudeep Holla
2024-04-05 15:55           ` Andy Shevchenko
2024-04-05 16:07             ` Sudeep Holla
2024-04-05 16:20               ` Andy Shevchenko [this message]
2024-04-05 16:06           ` Cristian Marussi
2024-04-05 16:16             ` Andy Shevchenko
2024-04-05 16:23               ` Cristian Marussi
2024-04-05 16:27                 ` Andy Shevchenko

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=ZhAkzFIv9fx-DQN3@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=brgl@bgdev.pl \
    --cc=cristian.marussi@arm.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=sudeep.holla@arm.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