Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1710365

Re: [PATCH] rtc: rtctest: Improve support detection

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Alexandre Belloni <alexandre.belloni@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH] rtc: rtctest: Improve support detection
Date Sat, 12 Aug 2017 22:30:01 +0200
Message-ID <udLcJ-5F4-5@gated-at.bofh.it> (permalink)
References <udegN-1FX-7@gated-at.bofh.it> <udegN-1FX-5@gated-at.bofh.it>
X-Original-To Lukáš Doktor <ldoktor@redhat.com>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent NeoMutt/20170609 (1.8.3)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 60
Organization linux.* mail to news gateway
X-Original-Cc a.zummo@towertech.it, john.stultz@linaro.org, tglx@linutronix.de, sboyd@codeaurora.org, shuah@kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
X-Original-Date Sat, 12 Aug 2017 22:22:06 +0200
X-Original-Message-ID <20170812202206.6phv7fesej42jhxr@piout.net>
X-Original-References <20170811091455.11041-1-ldoktor@redhat.com> <20170811091455.11041-2-ldoktor@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1710365

Show key headers only | View raw


Hi,

On 11/08/2017 at 11:14:55 +0200, Lukáš Doktor wrote:
> The rtc-generic and opal-rtc are failing to run this test as they do not
> support all the features. Let's treat the error returns and skip to the
> following test.
> 
> Theoretically the test_DATE should be also adjusted, but as it's enabled
> on demand I think it makes sense to fail in such case.
> 
> Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
> ---
>  tools/testing/selftests/timers/rtctest.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/timers/rtctest.c b/tools/testing/selftests/timers/rtctest.c
> index f61170f..6344842 100644
> --- a/tools/testing/selftests/timers/rtctest.c
> +++ b/tools/testing/selftests/timers/rtctest.c
> @@ -125,7 +125,7 @@ int main(int argc, char **argv)
>  	/* Turn on update interrupts (one per second) */
>  	retval = ioctl(fd, RTC_UIE_ON, 0);
>  	if (retval == -1) {
> -		if (errno == EINVAL) {
> +		if (errno == EINVAL || errno == EINVAL) {

Well, this needs to be fixed.

>  			fprintf(stderr,
>  				"\n...Update IRQs not supported.\n");
>  			goto test_READ;
> @@ -221,6 +221,11 @@ int main(int argc, char **argv)
>  	/* Read the current alarm settings */
>  	retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
>  	if (retval == -1) {
> +		if (errno == EINVAL) {
> +			fprintf(stderr,
> +					"\n...EINVAL reading current alarm setting.\n");
> +			goto test_PIE;
> +		}
>  		perror("RTC_ALM_READ ioctl");
>  		exit(errno);
>  	}
> @@ -231,7 +236,7 @@ int main(int argc, char **argv)
>  	/* Enable alarm interrupts */
>  	retval = ioctl(fd, RTC_AIE_ON, 0);
>  	if (retval == -1) {
> -		if (errno == EINVAL) {
> +		if (errno == EINVAL || errno ==EIO) {
>  			fprintf(stderr,
>  				"\n...Alarm IRQs not supported.\n");
>  			goto test_PIE;
> -- 
> 2.9.4
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] rtc: rtctest: Improve support detection Lukáš Doktor <ldoktor@redhat.com> - 2017-08-11 11:20 +0200
  Re: [PATCH] rtc: rtctest: Improve support detection Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-08-12 22:30 +0200
    Re: [PATCH] rtc: rtctest: Improve support detection Lukáš Doktor <ldoktor@redhat.com> - 2017-08-15 10:30 +0200

csiph-web