All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars Povlsen <lars.povlsen@microchip.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Lars Povlsen <lars.povlsen@microchip.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	devicetree <devicetree@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 2/3] pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO
Date: Tue, 10 Nov 2020 16:59:12 +0100	[thread overview]
Message-ID: <871rh1fbjj.fsf@microchip.com> (raw)
In-Reply-To: <CAHp75VfcgyMEr3YscC2Na_RCTtd=ozCzCGq=UO6zKAa+9b4rqg@mail.gmail.com>


Andy Shevchenko writes:

> On Mon, Nov 9, 2020 at 5:27 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
>> On 09/11/2020 17:16:49+0200, Andy Shevchenko wrote:
>> > On Mon, Nov 9, 2020 at 4:32 PM Alexandre Belloni
>> > <alexandre.belloni@bootlin.com> wrote:
>> > > On 09/11/2020 16:17:40+0200, Andy Shevchenko wrote:
>
> ...
>
>> > > > > +               dev_err(pctldev->dev, "Pin %d direction as %s is not possible\n",
>> > > > > +                       pin, input ? "input" : "output");
>> > > >
>> > > > Do we need this noise? Isn't user space getting a proper error code as
>> > > > per doc and can handle this?
>> > >
>> > > Why would userspace get the error code?
>> >
>> > Huh?! Why it shouldn't. How will users know if they are doing something wrong?
>> >
>> > > Userspace should never have to
>> > > handle gpios directly or you are doing something wrong.
>> >
>> > This is true, but check how error codes are propagated to the user space.
>> >
>>
>> your point is to remove an error message because the error may be
>> propagated to userspace. My point is that userspace should never use
>> gpios and the kernel has to be the consumer.
>
> Tell this to plenty of users of old sysfs interface and to libgpiod ones.
> If what you are saying had been true, we would have never had the new
> ABI for GPIOs.
>
>> I don't see how your answer
>> is relevant here.
>
> I have an opposite opinion.
>
>> Did you already check all the call sites from the
>> kernel too?
>
> If you think we have to print a message on each possible error case
> (but not always the one) we will get lost in the messages disaster and
> dmesg overflow.
> It is consumer who should decide if the setting is critical or not to
> be printed to user.

I think the message is a valid one. I will change it to
dev_err_ratelimited() - that should prevent the dmesg flooding.

---Lars

--
Lars Povlsen,
Microchip

WARNING: multiple messages have this Message-ID (diff)
From: Lars Povlsen <lars.povlsen@microchip.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: devicetree <devicetree@vger.kernel.org>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Lars Povlsen <lars.povlsen@microchip.com>
Subject: Re: [PATCH v8 2/3] pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO
Date: Tue, 10 Nov 2020 16:59:12 +0100	[thread overview]
Message-ID: <871rh1fbjj.fsf@microchip.com> (raw)
In-Reply-To: <CAHp75VfcgyMEr3YscC2Na_RCTtd=ozCzCGq=UO6zKAa+9b4rqg@mail.gmail.com>


Andy Shevchenko writes:

> On Mon, Nov 9, 2020 at 5:27 PM Alexandre Belloni
> <alexandre.belloni@bootlin.com> wrote:
>> On 09/11/2020 17:16:49+0200, Andy Shevchenko wrote:
>> > On Mon, Nov 9, 2020 at 4:32 PM Alexandre Belloni
>> > <alexandre.belloni@bootlin.com> wrote:
>> > > On 09/11/2020 16:17:40+0200, Andy Shevchenko wrote:
>
> ...
>
>> > > > > +               dev_err(pctldev->dev, "Pin %d direction as %s is not possible\n",
>> > > > > +                       pin, input ? "input" : "output");
>> > > >
>> > > > Do we need this noise? Isn't user space getting a proper error code as
>> > > > per doc and can handle this?
>> > >
>> > > Why would userspace get the error code?
>> >
>> > Huh?! Why it shouldn't. How will users know if they are doing something wrong?
>> >
>> > > Userspace should never have to
>> > > handle gpios directly or you are doing something wrong.
>> >
>> > This is true, but check how error codes are propagated to the user space.
>> >
>>
>> your point is to remove an error message because the error may be
>> propagated to userspace. My point is that userspace should never use
>> gpios and the kernel has to be the consumer.
>
> Tell this to plenty of users of old sysfs interface and to libgpiod ones.
> If what you are saying had been true, we would have never had the new
> ABI for GPIOs.
>
>> I don't see how your answer
>> is relevant here.
>
> I have an opposite opinion.
>
>> Did you already check all the call sites from the
>> kernel too?
>
> If you think we have to print a message on each possible error case
> (but not always the one) we will get lost in the messages disaster and
> dmesg overflow.
> It is consumer who should decide if the setting is critical or not to
> be printed to user.

I think the message is a valid one. I will change it to
dev_err_ratelimited() - that should prevent the dmesg flooding.

---Lars

--
Lars Povlsen,
Microchip

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-11-10 15:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 13:26 [PATCH v8 0/3] Adding support for Microchip/Microsemi serial GPIO controller Lars Povlsen
2020-11-09 13:26 ` Lars Povlsen
2020-11-09 13:26 ` [PATCH v8 1/3] dt-bindings: pinctrl: Add bindings for pinctrl-microchip-sgpio driver Lars Povlsen
2020-11-09 13:26   ` Lars Povlsen
2020-11-09 13:26 ` [PATCH v8 2/3] pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO Lars Povlsen
2020-11-09 13:26   ` Lars Povlsen
2020-11-09 14:17   ` Andy Shevchenko
2020-11-09 14:17     ` Andy Shevchenko
2020-11-09 14:32     ` Alexandre Belloni
2020-11-09 14:32       ` Alexandre Belloni
2020-11-09 15:16       ` Andy Shevchenko
2020-11-09 15:16         ` Andy Shevchenko
2020-11-09 15:27         ` Alexandre Belloni
2020-11-09 15:27           ` Alexandre Belloni
2020-11-09 16:15           ` Andy Shevchenko
2020-11-09 16:15             ` Andy Shevchenko
2020-11-09 16:22             ` Alexandre Belloni
2020-11-09 16:22               ` Alexandre Belloni
2020-11-10 15:59             ` Lars Povlsen [this message]
2020-11-10 15:59               ` Lars Povlsen
2020-11-10 15:51     ` Lars Povlsen
2020-11-10 15:51       ` Lars Povlsen
2020-11-10 16:26       ` Andy Shevchenko
2020-11-10 16:26         ` Andy Shevchenko
2020-11-11  8:51         ` Lars Povlsen
2020-11-11  8:51           ` Lars Povlsen
2020-11-11 11:26           ` Andy Shevchenko
2020-11-11 11:26             ` Andy Shevchenko
2020-11-11 11:53             ` Lars Povlsen
2020-11-11 11:53               ` Lars Povlsen
2020-11-09 13:26 ` [PATCH v8 3/3] arm64: dts: sparx5: Add SGPIO devices Lars Povlsen
2020-11-09 13:26   ` Lars Povlsen

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=871rh1fbjj.fsf@microchip.com \
    --to=lars.povlsen@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.