Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp605444ybl; Wed, 14 Aug 2019 03:11:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxC7bpIpncdubh3WlgW8Tw5m1CXpsPYseCKd2mwe3mrAuCXljnAasRs4F7zoOjk53gszBu X-Received: by 2002:a62:cdc3:: with SMTP id o186mr46011487pfg.168.1565777474125; Wed, 14 Aug 2019 03:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565777474; cv=none; d=google.com; s=arc-20160816; b=cmM+7AWuVUuLkQvN11pUrudfzlSWirEC74uIY6WCxxJ0QlY7e2TT5UP5a75IBs6CQw qXnrcnzmCi2XH2GnfQ8P9g6TgpA1jXsTzFMlIWopn/SC15mwitSZp1y9fkctx5O1eTOc mmi3OH/xUIk7yWbN6aeJ9ccn95ui4fu9l3wM0MV9y+Xm5sGpNvFIzxdieQ0ER4GK6OJT H8kjLZmm1XlXll4nBBc+1h5ILyUPgqn+0ruk4ddk9sHeahXbRzWPrX2akQVgLK1U3SP3 mAwJ99uYFJrWahfwarjLt7mgfaCshMDeXqUpofpXlIqqDvroetbEWtod3DB8oHillXBg onjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ea1Q4tKD0oUpbS0uIKzPLVU5r5P9QHvgvAATx+I9RZc=; b=wjyaf7cnWzNe9oJ9Jm4SV/qXnlLdiFE7St4FaQM7MdhgZbmmsBdgAnlBM6MRwcEMCZ jSH1RaIce8OWwBGwDSEQKxYBZDdRqw92vrH2j0fPjh/YYX/0dzypBpvZ5I0ozMtc6Lqy s5R4xzx8DoTp+D2lxvDSQtHYwK+pfdE8oDWnrW/rCt7csLB4tnpAjXTYRYKcJVxr+1o3 TYdGFjaxEhaa8ksc8S/jLUf674aUH3g7OoSkSfYFERnVGXDimLnb6t6Dr80pyl/j1n8I Wj7pifdQ437tI790nqf8WrJClnjT0vAGTeu1UH2ixG9V82xSp0gr2mEcLk2FdNm5OIMj cHSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5si20847202pgj.527.2019.08.14.03.10.56; Wed, 14 Aug 2019 03:11:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726509AbfHNKJd (ORCPT + 99 others); Wed, 14 Aug 2019 06:09:33 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:45251 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfHNKJd (ORCPT ); Wed, 14 Aug 2019 06:09:33 -0400 Received: from localhost (alyon-656-1-672-152.w92-137.abo.wanadoo.fr [92.137.69.152]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 9E531240007; Wed, 14 Aug 2019 10:09:30 +0000 (UTC) Date: Wed, 14 Aug 2019 12:09:30 +0200 From: Alexandre Belloni To: Biwen Li Cc: a.zummo@towertech.it, leoyang.li@nxp.com, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: rtc: pcf85363/pcf85263: fix error that failed to run hwclock -w Message-ID: <20190814100930.GI3600@piout.net> References: <20190814093249.40065-1-biwen.li@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814093249.40065-1-biwen.li@nxp.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 14/08/2019 17:32:49+0800, Biwen Li wrote: > Issue: > # hwclock -w > hwclock: RTC_SET_TIME: Invalid argument > > The patch fixes error when run command hwclock -w > with rtc pcf85363/pcf85263 > Could you describe a bit more the issue and what causes it? IIRC I wrote that code and it works on my pcf85363. > Signed-off-by: Biwen Li > --- > drivers/rtc/rtc-pcf85363.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c > index a075e77617dc..3450d615974d 100644 > --- a/drivers/rtc/rtc-pcf85363.c > +++ b/drivers/rtc/rtc-pcf85363.c > @@ -166,7 +166,12 @@ static int pcf85363_rtc_set_time(struct device *dev, struct rtc_time *tm) > buf[DT_YEARS] = bin2bcd(tm->tm_year % 100); > > ret = regmap_bulk_write(pcf85363->regmap, CTRL_STOP_EN, > - tmp, sizeof(tmp)); > + tmp, 2); > + if (ret) > + return ret; > + > + ret = regmap_bulk_write(pcf85363->regmap, DT_100THS, > + buf, sizeof(tmp) - 2); > if (ret) > return ret; > > -- > 2.17.1 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com