From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEBB4C43381 for ; Mon, 25 Mar 2019 15:44:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E3F2206BA for ; Mon, 25 Mar 2019 15:44:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ijhle+Q2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E3F2206BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2+UjuANpUXyKlg7B/ds8LD255Oct7Hy+AFOgg0um0NI=; b=Ijhle+Q2McuiUy kqsqRjf+/z6mESikdAwcEq2vmDQv9Qip640mticJi/T0G2A6qoKJb2hPg8RIZT8SBUxJxzNY2Zops 7b1ipWhU9d0uDikwWyyMdU78VgC3PXwc+ut4iIqW9LK6tkV8bRBCSJbzh/iKJSAQIeUVNJXNUs+BP isJUs5j7gNPWGXHfT0cZYQvYVwD/OjQy2u04jyfG8Xgq5DN/RScKZIzdlgw9MduFSSjSTSlG6tEFk pO2Sdty0dvm5lDaHDMmASq35hUsN/uEN13PJBlCQ0MFfUNPmvnmnHoePRk1PA4b1hwCe06rLcd+rg rnxtg62hX1unoDa0oFHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Rli-00065J-2b; Mon, 25 Mar 2019 15:44:10 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Rla-00064S-2u for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2019 15:44:07 +0000 X-Originating-IP: 109.213.38.144 Received: from localhost (alyon-652-1-47-144.w109-213.abo.wanadoo.fr [109.213.38.144]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id E2DACC000A; Mon, 25 Mar 2019 15:43:48 +0000 (UTC) Date: Mon, 25 Mar 2019 16:43:47 +0100 From: Alexandre Belloni To: Joel Stanley Subject: Re: [PATCH v2 2/2] rtc: Add ASPEED RTC driver Message-ID: <20190325154347.GN30105@piout.net> References: <20190325133159.10653-1-joel@jms.id.au> <20190325133159.10653-3-joel@jms.id.au> <20190325145954.GM30105@piout.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_084402_282746_F46AFDE8 X-CRM114-Status: GOOD ( 16.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Alessandro Zummo , linux-aspeed@lists.ozlabs.org, devicetree , Andrew Jeffery , Rob Herring , Linux ARM , linux-rtc@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 25/03/2019 15:28:26+0000, Joel Stanley wrote: > On Mon, 25 Mar 2019 at 14:59, Alexandre Belloni > wrote: > > On 26/03/2019 00:01:59+1030, Joel Stanley wrote: > > > + dev_dbg(dev, "%s: %4d-%02d-%02d %02d:%02d:%02d\n", __func__, > > > + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, > > > + tm->tm_hour, tm->tm_min, tm->tm_sec); > > > + > > > > We now have %ptR, could you use that? > > I tried this: > > dev_dbg(dev, "%s: %ptR", __func__, tm); > > Yes, that appears to do the job. Can you make the change when applying? > Ok, I'll do that. > > > > > + rtc->rtc_dev->ops = &aspeed_rtc_ops; > > > + rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900; > > > + rtc->rtc_dev->range_max = 38814989399LL; /* 3199-12-31 23:59:59 */ > > > + > > > > I'm curious how many RTC have been properly designed, could you run > > rtc-range? > > > > https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/rtc-tools.git/tree/rtc-range.c > > It appears to pass the test: > > Testing 2000-02-28 23:59:59. > OK > > Testing 2038-01-19 03:14:07. > OK > > Testing 2069-12-31 23:59:59. > OK > > Testing 2099-12-31 23:59:59. > OK > > Testing 2100-02-28 23:59:59. > OK > > Testing 2106-02-07 06:28:15. > OK > > Testing 2262-04-11 23:47:16. > OK > > The qemu model I have for the device failed though. A good test! Are > you going to put it in the kernel tree? > I was planning to add more dates to test and detect when the range is properly reported by the rtc (right now, it reports a failure) before doing so. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel