Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3414479imw; Thu, 7 Jul 2022 01:05:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vx+JWGThX4vUH2JErvCNxbrTY26BmP7N0wZ0+VKKlKiZbnhMtnygiAd52JJlGMTGJYTL9T X-Received: by 2002:a17:903:240e:b0:168:ea13:f9e0 with SMTP id e14-20020a170903240e00b00168ea13f9e0mr52087784plo.6.1657181117582; Thu, 07 Jul 2022 01:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657181117; cv=none; d=google.com; s=arc-20160816; b=PeOGubmk6aYtKSt7PpFaE5CmIcQAd3/mx0UELdemyCWlofLp/FBnfzV1Mz+UHULa79 EZZw3WUS+IOV5H3TiYecC8+I+v6PvxtxhJNFLBoRm3ggrPjFPc2dTPaaaUn3AukitKv7 UNjrDwNZnqbh9emckup4GBHJ6dVuzpf+E7303+f34mP+FWyk46z7A4N+TBt4F2RktygU 0IUz6kBg/acvg8FMM7vOTwrQE0GnD9XR1yWs/Y2io3jxhPM42I+F+BhDp5qeuw7/uPTt 7d2bBCqtSGqx8THWj7TIe4xxFQBWPMHhrTi+zmcxKn2MaoyJTP2lgJjHMZP9RDtO+x5g w5sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XlhJMe5eaAfucFNFw5DBnfmQ57zoA/G09jp+D3Ly4pU=; b=OavM/ij1B8HH22yBccWlcclD7TZm0BpJko0Fr2l4HuFcRDoJZYJOI/DXyjzvnqpYZO Qy42CFvmTuJIqT3XsrcIqEH0U72cMlAQICAuQPp2W7RbTbAW/zX2qvZ+yYFs2VphkXTP RinNMha/Sm9V/5N+Uf/NdukQzECTv10tYRHps1v8U3iEMHmyf6Ra2A7OU91gV9hBsb9t i12qV5o3+XECHwugJ8sAM2gB2SRG2b32gRcAtF1LA1stt7K/RvobX3quxEYv6p2MIqxN CS+KQ4GE5s89pVfDVv8lJWnkFn+TgO6BgSYAtkd88kvl1xkxjGw5SSz3rbvu/wJW6MJP aROw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=F5qIWeZE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id np11-20020a17090b4c4b00b001ece9122d4esi41250263pjb.86.2022.07.07.01.05.04; Thu, 07 Jul 2022 01:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=F5qIWeZE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235104AbiGGHwY (ORCPT + 99 others); Thu, 7 Jul 2022 03:52:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234977AbiGGHwW (ORCPT ); Thu, 7 Jul 2022 03:52:22 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E18A7B45; Thu, 7 Jul 2022 00:52:19 -0700 (PDT) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7A0C624000F; Thu, 7 Jul 2022 07:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1657180337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XlhJMe5eaAfucFNFw5DBnfmQ57zoA/G09jp+D3Ly4pU=; b=F5qIWeZE6+voZZFvqFrGd6OTrFVjxy6GGTxVWW1otoWxpwHffWNwiS9yg6YliSWJ6oOmE0 Pn9TobsV410XCrOqt2b7FUl5efbnf4DLJqx1ysYOtLEaTSfMw0UFt7J4HGlPt9z4OKtJpk 6HSz+YzU+eZ7zNk6AVHmXEo5NWvFQiahHafGm47iXkpAEg8vK63HMqFSwAGlZRlkgKG2Pn RtbZKViwdSU3C6lB7QJ7UMxcB8ioZdI+jzYhcaXhvfSZMueHxPR1eNlpmEVdb6B2zILmW0 235E7rDpjU4wYMa5zTh3OinBuzjxplR5pM/gSykulsdT74x43pKR2k6GlWNj3g== Date: Thu, 7 Jul 2022 09:52:14 +0200 From: Alexandre Belloni To: Mining Lin Cc: Benjamin Fair , Nancy Yuen , Patrick Venture , Tali Perry , Tomer Maimon , Avi Fishman , Rob Herring , a.zummo@towertech.it, KWLIU@nuvoton.com, YSCHU@nuvoton.com, JJLIU0@nuvoton.com, KFTING , ctcchien@nuvoton.com, Medad Young , CS20 MYLin1 , OpenBMC Maillist , Linux Kernel Mailing List , devicetree , linux-rtc@vger.kernel.org Subject: Re: [PATCH v3 3/3] RTC: nuvoton: Add NCT3018Y real time clock driver Message-ID: References: <20220527084647.30835-1-ctcchien@nuvoton.com> <20220527084647.30835-4-ctcchien@nuvoton.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 於 2022年7月7日 週四 下午1:31寫道: > > > > Hello Alexandre, > > > > Thanks for your comments. > > I add Mining Lin 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 於 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