linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Mining Lin <mimi05633@gmail.com>
Cc: Benjamin Fair <benjaminfair@google.com>,
	Nancy Yuen <yuenn@google.com>,
	Patrick Venture <venture@google.com>,
	Tali Perry <tali.perry1@gmail.com>,
	Tomer Maimon <tmaimon77@gmail.com>,
	Avi Fishman <avifishman70@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	a.zummo@towertech.it, KWLIU@nuvoton.com, YSCHU@nuvoton.com,
	JJLIU0@nuvoton.com, KFTING <KFTING@nuvoton.com>,
	ctcchien@nuvoton.com, Medad Young <medadyoung@gmail.com>,
	CS20 MYLin1 <mylin1@nuvoton.com>,
	OpenBMC Maillist <openbmc@lists.ozlabs.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH v3 3/3] RTC: nuvoton: Add NCT3018Y real time clock driver
Date: Thu, 7 Jul 2022 09:52:14 +0200	[thread overview]
Message-ID: <YsaQrksj8jBhJYGP@mail.local> (raw)
In-Reply-To: <CAL3ZnpzSm7f1L2MMuDr9_vg3TQuk3PSr46fwmJTMz4sA2sdCJg@mail.gmail.com>

On 07/07/2022 15:17:28+0800, Mining Lin wrote:
> Dear Alexandre,
> 
> Thank you for your comments.
> I will refine and reply below.
> 
> Thanks.
> Best Regards,
> Mia
> 
> Medad Young <medadyoung@gmail.com> 於 2022年7月7日 週四 下午1:31寫道:
> >
> > Hello Alexandre,
> >
> > Thanks for your comments.
> > I add Mining Lin <mimi05633@gmail.com> into this mail thread,
> > and she is going to follow up this RTC driver.
> > She will be in charge of maintaining this driver.
> >
> > Alexandre Belloni <alexandre.belloni@bootlin.com> 於 2022年6月25日 週六 凌晨4:26寫道:
> > >
> > > Hello,
> > >
> > > Please run ./scripts/checkpatch.pl --strict on your patch, there are a
> > > bunch of issues.
> > >
> [Mia] I will run ./scripts/checkpatch.pl --strict on my patch to fix issues.
> 
> > > On 27/05/2022 16:46:47+0800, medadyoung@gmail.com wrote:
> > > > +static int nct3018y_set_alarm_mode(struct i2c_client *client, bool on)
> > > > +{
> > > > +     int err, flags;
> > > > +
> > > > +     dev_dbg(&client->dev, "%s:on:%d\n", __func__, on);
> > > > +
> > > > +     flags =  i2c_smbus_read_byte_data(client, NCT3018Y_REG_CTRL);
> > > > +     if (flags < 0) {
> > > > +             dev_err(&client->dev,
> > > > +                     "Failed to read NCT3018Y_REG_CTRL\n");
> > >
> > > You should cut down on the number of error messages, they are usually
> > > not useful as the user doesn't have any specific action after getting
> > > one of them apart from trying the action once again. Also, this will
> > > make your code shorter. dev_dbg is fine.
> > >
> [Mia] I will modify dev_err to dev_dbg if there is an error and nothing to do.
> 
> > > > +/*
> > > > + * In the routines that deal directly with the nct3018y hardware, we use
> > > > + * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch.
> > > > + */
> > > > +static int nct3018y_rtc_read_time(struct device *dev, struct rtc_time *tm)
> > > > +{
> > > > +     struct i2c_client *client = to_i2c_client(dev);
> > > > +     unsigned char buf[10];
> > > > +     int err;
> > > > +
> > >
> > > You should still return an error if the time is invalid there but without
> > > an error message.
> > >
> [Mia] I will verify the time by rtc_valid_tm(tm).
> 

No, I meant checking NCT3018Y_REG_ST as was done in the previous
revisions of the series

> > > > +static struct clk *nct3018y_clkout_register_clk(struct nct3018y *nct3018y)
> > > > +{
> > > > +     struct i2c_client *client = nct3018y->client;
> > > > +     struct device_node *node = client->dev.of_node;
> > > > +     struct clk *clk;
> > > > +     struct clk_init_data init;
> > > > +     int flags, err;
> > > > +
> > > > +     /* disable the clkout output */
> > > > +     flags = 0;
> > > > +     err = i2c_smbus_write_byte_data(client, NCT3018Y_REG_CLKO, flags);
> > >
> > > BTW, this introduces a glitch in the clock output if the clock is
> > > actually used. Maybe you could just rely on the CCF core to disable this
> > > clock when there are no users.
> > >
> [Mia] Do you mean there is no need to disable the clock output here?
> 

The CCF will disable the clock at boot time if there are no users

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2022-07-07  7:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  8:46 [PATCH v3 0/3] RTC: nuvoton: Add nuvoton real time clock driver medadyoung
2022-05-27  8:46 ` [PATCH v3 1/3] dt-bindings: rtc: nuvoton: add NCT3018Y Real Time Clock medadyoung
2022-06-01 18:51   ` Rob Herring
2022-05-27  8:46 ` [PATCH v3 2/3] ARM: dts: nuvoton: Add nuvoton RTC3018Y node medadyoung
2022-05-27  8:46 ` [PATCH v3 3/3] RTC: nuvoton: Add NCT3018Y real time clock driver medadyoung
2022-06-24 20:26   ` Alexandre Belloni
2022-07-07  5:30     ` Medad Young
2022-07-07  7:17       ` Mining Lin
2022-07-07  7:52         ` Alexandre Belloni [this message]
2022-07-07  9:36           ` Mining Lin

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=YsaQrksj8jBhJYGP@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=JJLIU0@nuvoton.com \
    --cc=KFTING@nuvoton.com \
    --cc=KWLIU@nuvoton.com \
    --cc=YSCHU@nuvoton.com \
    --cc=a.zummo@towertech.it \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=ctcchien@nuvoton.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=medadyoung@gmail.com \
    --cc=mimi05633@gmail.com \
    --cc=mylin1@nuvoton.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=robh+dt@kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=venture@google.com \
    --cc=yuenn@google.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;
as well as URLs for NNTP newsgroup(s).