[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201002225408.GA500800@latitude>
Date: Sat, 3 Oct 2020 00:54:08 +0200
From: Jonathan Neuschäfer <j.neuschaefer@....net>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Jonathan Neuschäfer <j.neuschaefer@....net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lee Jones <lee.jones@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Sam Ravnborg <sam@...nborg.org>,
Linus Walleij <linus.walleij@...aro.org>,
Heiko Stuebner <heiko.stuebner@...obroma-systems.com>,
Stephan Gerhold <stephan@...hold.net>,
Lubomir Rintel <lkundrak@...sk>,
Mark Brown <broonie@...nel.org>, allen <allen.chen@....com.tw>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
devicetree <devicetree@...r.kernel.org>,
linux-pwm@...r.kernel.org,
"open list:REAL TIME CLOCK (RTC) SUBSYSTEM"
<linux-rtc@...r.kernel.org>,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
Heiko Stuebner <heiko@...ech.de>,
Josua Mayer <josua.mayer@....eu>,
Andreas Kemnade <andreas@...nade.info>,
Arnd Bergmann <arnd@...db.de>, Daniel Palmer <daniel@...f.com>
Subject: Re: [PATCH v3 3/7] mfd: Add base driver for Netronix embedded
controller
On Tue, Sep 29, 2020 at 07:37:21PM +0300, Andy Shevchenko wrote:
> On Sat, Sep 26, 2020 at 12:32 AM Jonathan Neuschäfer
> <j.neuschaefer@....net> wrote:
> > On Fri, Sep 25, 2020 at 12:29:45PM +0300, Andy Shevchenko wrote:
> > > On Thu, Sep 24, 2020 at 10:26 PM Jonathan Neuschäfer
> > > <j.neuschaefer@....net> wrote:
>
> ...
>
> > > > + dev_alert(&poweroff_restart_client->dev,
> > > > + "Failed to power off (err = %d)\n", res);
> > >
> > > alert? This needs to be explained.
> >
> > I copied the dev_alert from drivers/mfd/rn5t618.c.
> >
> > Upon reconsideration, I'm not sure what the correct log level would be,
> > but _warn seems enough, or maybe _err is better
>
> It's up to you to decide, but crit/alert and similar has to be
> justified (commit message / comment in the code).
Alright, thanks for explaining.
> > > > + /*
> > > > + * NOTE: The lower half of the reset value is not sent, because sending
> > > > + * it causes an error
> > >
> > > Why? Any root cause? Perhaps you need to send 0xffff ?
> >
> > Unknown, because I don't have the EC firmware for analysis. The vendor
> > kernel sends 0xff00 and gets an error.
> >
> > Sending 0xffff doesn't help.
>
> Maybe a slightly elaborated comment that it's copied from the vendor
> kernel (which is?).
Good idea, I'll do that.
> ...
>
> > > > + dev_info(ec->dev,
> > > > + "Netronix embedded controller version %04x detected.\n",
> > > > + version);
> > >
> > > This info level may confuse users if followed by an error path.
> >
> > Right. I suppose printing incompatible versions is still useful, so how
> > about something like the following?
> >
> >
> > /* Bail out if we encounter an unknown firmware version */
> > switch (version) {
> > case 0xd726: /* found in Kobo Aura */
> > dev_info(ec->dev,
> > "Netronix embedded controller version %04x detected.\n",
> > version);
> > break;
> > default:
> > dev_err(ec->dev,
> > "Netronix embedded controller version %04x is not supported.\n",
> > version);
> > return -ENODEV;
> > }
>
> This is better.
>
> ...
>
> > > > + WARN_ON(poweroff_restart_client);
> > >
> > > WARN_ON? All these alerts, WARNs, BUGs must be explained. Screaming to
> > > the user is not good if it wasn't justified.
> >
> > poweroff_restart_client being already set is not a situation that should
> > happen (and would indicate a bug in this driver, AFAICT), but I guess
> > the log message could be better in that case...
>
> As per above.
Okay, I'll rework the dev_alert/WARN_ON parts.
Thanks,
Jonathan Neuschäfer
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists