All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH v2 2/2] rtc: Add ASPEED RTC driver
Date: Mon, 25 Mar 2019 16:43:47 +0100	[thread overview]
Message-ID: <20190325154347.GN30105@piout.net> (raw)
In-Reply-To: <CACPK8XfFTF2hDzwO33gE=fotEEC-CZztThoaYj98Le9JAsAQ-w@mail.gmail.com>

On 25/03/2019 15:28:26+0000, Joel Stanley wrote:
> On Mon, 25 Mar 2019 at 14:59, Alexandre Belloni
> <alexandre.belloni@bootlin.com> 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

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Joel Stanley <joel@jms.id.au>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andrew Jeffery <andrew@aj.id.au>,
	linux-rtc@vger.kernel.org,
	devicetree <devicetree@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-aspeed@lists.ozlabs.org
Subject: Re: [PATCH v2 2/2] rtc: Add ASPEED RTC driver
Date: Mon, 25 Mar 2019 16:43:47 +0100	[thread overview]
Message-ID: <20190325154347.GN30105@piout.net> (raw)
In-Reply-To: <CACPK8XfFTF2hDzwO33gE=fotEEC-CZztThoaYj98Le9JAsAQ-w@mail.gmail.com>

On 25/03/2019 15:28:26+0000, Joel Stanley wrote:
> On Mon, 25 Mar 2019 at 14:59, Alexandre Belloni
> <alexandre.belloni@bootlin.com> 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

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Joel Stanley <joel@jms.id.au>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-aspeed@lists.ozlabs.org,
	devicetree <devicetree@vger.kernel.org>,
	Andrew Jeffery <andrew@aj.id.au>,
	Rob Herring <robh+dt@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH v2 2/2] rtc: Add ASPEED RTC driver
Date: Mon, 25 Mar 2019 16:43:47 +0100	[thread overview]
Message-ID: <20190325154347.GN30105@piout.net> (raw)
In-Reply-To: <CACPK8XfFTF2hDzwO33gE=fotEEC-CZztThoaYj98Le9JAsAQ-w@mail.gmail.com>

On 25/03/2019 15:28:26+0000, Joel Stanley wrote:
> On Mon, 25 Mar 2019 at 14:59, Alexandre Belloni
> <alexandre.belloni@bootlin.com> 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

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Joel Stanley <joel@jms.id.au>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-aspeed@lists.ozlabs.org,
	devicetree <devicetree@vger.kernel.org>,
	Andrew Jeffery <andrew@aj.id.au>,
	Rob Herring <robh+dt@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH v2 2/2] rtc: Add ASPEED RTC driver
Date: Mon, 25 Mar 2019 16:43:47 +0100	[thread overview]
Message-ID: <20190325154347.GN30105@piout.net> (raw)
In-Reply-To: <CACPK8XfFTF2hDzwO33gE=fotEEC-CZztThoaYj98Le9JAsAQ-w@mail.gmail.com>

On 25/03/2019 15:28:26+0000, Joel Stanley wrote:
> On Mon, 25 Mar 2019 at 14:59, Alexandre Belloni
> <alexandre.belloni@bootlin.com> 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

  reply	other threads:[~2019-03-25 15:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 13:31 [PATCH v2 0/2] rtc: Add ASPEED RTC driver Joel Stanley
2019-03-25 13:31 ` Joel Stanley
2019-03-25 13:31 ` Joel Stanley
2019-03-25 13:31 ` Joel Stanley
2019-03-25 13:31 ` [PATCH v2 1/2] dt-bindings: rtc: Add on-chip ASPEED RTC documentation Joel Stanley
2019-03-25 13:31   ` Joel Stanley
2019-03-25 13:31   ` Joel Stanley
2019-03-25 13:31   ` Joel Stanley
2019-03-25 13:31 ` [PATCH v2 2/2] rtc: Add ASPEED RTC driver Joel Stanley
2019-03-25 13:31   ` Joel Stanley
2019-03-25 13:31   ` Joel Stanley
2019-03-25 13:31   ` Joel Stanley
2019-03-25 14:59   ` Alexandre Belloni
2019-03-25 14:59     ` Alexandre Belloni
2019-03-25 14:59     ` Alexandre Belloni
2019-03-25 14:59     ` Alexandre Belloni
2019-03-25 15:28     ` Joel Stanley
2019-03-25 15:28       ` Joel Stanley
2019-03-25 15:28       ` Joel Stanley
2019-03-25 15:28       ` Joel Stanley
2019-03-25 15:43       ` Alexandre Belloni [this message]
2019-03-25 15:43         ` Alexandre Belloni
2019-03-25 15:43         ` Alexandre Belloni
2019-03-25 15:43         ` Alexandre Belloni
2019-03-25 16:10       ` Alexandre Belloni
2019-03-25 16:10         ` Alexandre Belloni
2019-03-25 16:10         ` Alexandre Belloni
2019-03-25 16:10         ` Alexandre Belloni
2019-03-27  1:00         ` Joel Stanley
2019-03-27  1:00           ` Joel Stanley
2019-03-27  1:00           ` Joel Stanley
2019-03-27  1:00           ` Joel Stanley

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=20190325154347.GN30105@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=linux-aspeed@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.