linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rafael David Tinoco <rafael.tinoco@linaro.org>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Shuah Khan <shuah@kernel.org>
Cc: Rafael David Tinoco <rafael.tinoco@linaro.org>,
	John Stultz <john.stultz@linaro.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH 1/4] selftests: timers: move PIE tests out of rtctest
Date: Thu, 29 Nov 2018 17:57:05 -0200	[thread overview]
Message-ID: <a304b6f1-11db-543b-2cb3-372f34dc7697@linaro.org> (raw)
In-Reply-To: <20180419125030.5076-2-alexandre.belloni@bootlin.com>

On 4/19/18 9:50 AM, Alexandre Belloni wrote:
> Since commit 6610e0893b8bc ("RTC: Rework RTC code to use timerqueue for
> events"), PIE are completely handled using hrtimers, without actually using
> any underlying hardware RTC.
> 
> Move PIE testing out of rtctest. It still depends on the presence of an RTC
> (to access the device file) but doesn't depend on it actually working.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
>  tools/testing/selftests/timers/.gitignore |   1 +
>  tools/testing/selftests/timers/Makefile   |   2 +-
>  tools/testing/selftests/timers/rtcpie.c   | 132 ++++++++++++++++++++++
>  tools/testing/selftests/timers/rtctest.c  |  83 +-------------
>  4 files changed, 138 insertions(+), 80 deletions(-)
>  create mode 100644 tools/testing/selftests/timers/rtcpie.c
> 
...
> +	/* The frequencies 128Hz, 256Hz, ... 8192Hz are only allowed for root. */
> +	for (tmp=2; tmp<=64; tmp*=2) {
> +
> +		retval = ioctl(fd, RTC_IRQP_SET, tmp);
> +		if (retval == -1) {
> +			/* not all RTCs can change their periodic IRQ rate */
> +			if (errno == EINVAL) {
> +				fprintf(stderr,
> +					"\n...Periodic IRQ rate is fixed\n");
> +				goto done;
> +			}
> +			perror("RTC_IRQP_SET ioctl");
> +			exit(errno);
> +		}

Hello Alexandre,

In our tests, having failures under 64Hz is quite common in embedded
systems with few number of CPUs/Cores:

--------
root@bug3402:opt$ find /sys -name rtc0
/sys/devices/platform/9010000.pl031/rtc/rtc0
/sys/class/rtc/rtc0

selftests: timers: rtcpie
Periodic IRQ rate is 1Hz.
Counting 20 interrupts at:
2Hz:	 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
4Hz:	 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8Hz:	 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
16Hz:	 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
32Hz:	 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
64Hz:	
PIE delta error: 0.017697 should be close to 0.015625
not ok 1..9 selftests: timers: rtcpie [FAIL]
--------

Mainly because 64Hz gives us.. ~16ms in the test, and the variation
being taken in consideration for an error, for this test, is 10%, which
is ~1.6ms... pretty close to scheduler limit for lower number of CPUs in
a functional testing environment.

Would you mind if we change the default for up to 32Hz ? Or, do you have
any other suggestion ?

Best Rgds
Rafael

-- 
Rafael D. Tinoco
Linaro - Kernel Validation

  reply	other threads:[~2018-11-29 19:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 12:50 [PATCH 0/4] selftests: rework RTC tests Alexandre Belloni
2018-04-19 12:50 ` [PATCH 1/4] selftests: timers: move PIE tests out of rtctest Alexandre Belloni
2018-11-29 19:57   ` Rafael David Tinoco [this message]
2018-12-01  9:55     ` Alexandre Belloni
2018-04-19 12:50 ` [PATCH 2/4] selftests: timers: rtcpie: restore previous PIE rate Alexandre Belloni
2018-04-19 12:50 ` [PATCH 3/4] selftests: move RTC tests to rtc subfolder Alexandre Belloni
2018-04-19 12:50 ` [PATCH 4/4] selftests: rtc: rework rtctest Alexandre Belloni
2018-04-24 19:33 ` [PATCH 0/4] selftests: rework RTC tests Shuah Khan
2018-05-10 17:34   ` Shuah Khan

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=a304b6f1-11db-543b-2cb3-372f34dc7697@linaro.org \
    --to=rafael.tinoco@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=shuah@kernel.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 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).