The rtctest requires the read permission on /dev/rtc0. The rtctest will
be skipped if the /dev/rtc0 is not readable.
Reviewed-by: Koba Ko <kobak@nvidia.com>
Reviewed-by: Matthew R. Ochs <mochs@nvidia.com>
Signed-off-by: Joseph Jang <jjang@nvidia.com>
---
tools/testing/selftests/rtc/rtctest.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c
index 2b12497eb30d..d104f5326cf4 100644
--- a/tools/testing/selftests/rtc/rtctest.c
+++ b/tools/testing/selftests/rtc/rtctest.c
@@ -483,6 +483,8 @@ __constructor_order_last(void)
int main(int argc, char **argv)
{
+ int ret = -1;
+
switch (argc) {
case 2:
rtc_file = argv[1];
@@ -494,5 +496,12 @@ int main(int argc, char **argv)
return 1;
}
- return test_harness_run(argc, argv);
+ /* Run the test if rtc_file is accessible */
+ if (access(rtc_file, R_OK) == 0)
+ ret = test_harness_run(argc, argv);
+ else
+ ksft_exit_skip("[SKIP]: Cannot access rtc file %s - Exiting\n",
+ rtc_file);
+
+ return ret;
}
--
2.34.1
On 23/05/2024 18:38:07-0700, Joseph Jang wrote:
> The rtctest requires the read permission on /dev/rtc0. The rtctest will
> be skipped if the /dev/rtc0 is not readable.
>
> Reviewed-by: Koba Ko <kobak@nvidia.com>
> Reviewed-by: Matthew R. Ochs <mochs@nvidia.com>
> Signed-off-by: Joseph Jang <jjang@nvidia.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
> ---
> tools/testing/selftests/rtc/rtctest.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c
> index 2b12497eb30d..d104f5326cf4 100644
> --- a/tools/testing/selftests/rtc/rtctest.c
> +++ b/tools/testing/selftests/rtc/rtctest.c
> @@ -483,6 +483,8 @@ __constructor_order_last(void)
>
> int main(int argc, char **argv)
> {
> + int ret = -1;
> +
> switch (argc) {
> case 2:
> rtc_file = argv[1];
> @@ -494,5 +496,12 @@ int main(int argc, char **argv)
> return 1;
> }
>
> - return test_harness_run(argc, argv);
> + /* Run the test if rtc_file is accessible */
> + if (access(rtc_file, R_OK) == 0)
> + ret = test_harness_run(argc, argv);
> + else
> + ksft_exit_skip("[SKIP]: Cannot access rtc file %s - Exiting\n",
> + rtc_file);
> +
> + return ret;
> }
> --
> 2.34.1
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Hi Alexandre,
Thank you for looking at the rtc patch.
I saw you Acked the [PATCH 2/2], not sure when could we see the patch
in kernel master or next branch ?
Thank you,
Joseph.
On 2024/6/21 3:37 AM, Alexandre Belloni wrote:
> On 23/05/2024 18:38:07-0700, Joseph Jang wrote:
>> The rtctest requires the read permission on /dev/rtc0. The rtctest will
>> be skipped if the /dev/rtc0 is not readable.
>>
>> Reviewed-by: Koba Ko <kobak@nvidia.com>
>> Reviewed-by: Matthew R. Ochs <mochs@nvidia.com>
>> Signed-off-by: Joseph Jang <jjang@nvidia.com>
>
> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>
>> ---
>> tools/testing/selftests/rtc/rtctest.c | 11 ++++++++++-
>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c
>> index 2b12497eb30d..d104f5326cf4 100644
>> --- a/tools/testing/selftests/rtc/rtctest.c
>> +++ b/tools/testing/selftests/rtc/rtctest.c
>> @@ -483,6 +483,8 @@ __constructor_order_last(void)
>>
>> int main(int argc, char **argv)
>> {
>> + int ret = -1;
>> +
>> switch (argc) {
>> case 2:
>> rtc_file = argv[1];
>> @@ -494,5 +496,12 @@ int main(int argc, char **argv)
>> return 1;
>> }
>>
>> - return test_harness_run(argc, argv);
>> + /* Run the test if rtc_file is accessible */
>> + if (access(rtc_file, R_OK) == 0)
>> + ret = test_harness_run(argc, argv);
>> + else
>> + ksft_exit_skip("[SKIP]: Cannot access rtc file %s - Exiting\n",
>> + rtc_file);
>> +
>> + return ret;
>> }
>> --
>> 2.34.1
>>
>
On 9/23/24 23:37, Joseph Jang wrote: > Hi Alexandre, > > Thank you for looking at the rtc patch. > I saw you Acked the [PATCH 2/2], not sure when could we see the patch > in kernel master or next branch ? > > Thank you, > Joseph. > Please don't top post. It is hard to follow the thread. > On 2024/6/21 3:37 AM, Alexandre Belloni wrote: >> On 23/05/2024 18:38:07-0700, Joseph Jang wrote: >>> The rtctest requires the read permission on /dev/rtc0. The rtctest will >>> be skipped if the /dev/rtc0 is not readable. >>> >>> Reviewed-by: Koba Ko <kobak@nvidia.com> >>> Reviewed-by: Matthew R. Ochs <mochs@nvidia.com> >>> Signed-off-by: Joseph Jang <jjang@nvidia.com> >> >> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> >> Alexandre, I can take this patch through kselftest. Might have slipped through my Inbox or the assumption that this will go through rtc tree. thanks, -- Shuah
Hello, On 24/09/2024 10:05:43-0600, Shuah Khan wrote: > On 9/23/24 23:37, Joseph Jang wrote: > > Hi Alexandre, > > > > Thank you for looking at the rtc patch. > > I saw you Acked the [PATCH 2/2], not sure when could we see the patch > > in kernel master or next branch ? > > > > Thank you, > > Joseph. > > > > Please don't top post. It is hard to follow the thread. > > > On 2024/6/21 3:37 AM, Alexandre Belloni wrote: > > > On 23/05/2024 18:38:07-0700, Joseph Jang wrote: > > > > The rtctest requires the read permission on /dev/rtc0. The rtctest will > > > > be skipped if the /dev/rtc0 is not readable. > > > > > > > > Reviewed-by: Koba Ko <kobak@nvidia.com> > > > > Reviewed-by: Matthew R. Ochs <mochs@nvidia.com> > > > > Signed-off-by: Joseph Jang <jjang@nvidia.com> > > > > > > Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> > > > > > Alexandre, I can take this patch through kselftest. Might have > slipped through my Inbox or the assumption that this will go > through rtc tree. I assumed this would go through your tree, this is why I didn't carry it. -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On 9/24/24 13:31, Alexandre Belloni wrote: > Hello, > > On 24/09/2024 10:05:43-0600, Shuah Khan wrote: >> On 9/23/24 23:37, Joseph Jang wrote: >>> Hi Alexandre, >>> >>> Thank you for looking at the rtc patch. >>> I saw you Acked the [PATCH 2/2], not sure when could we see the patch >>> in kernel master or next branch ? >>> >>> Thank you, >>> Joseph. >>> >> >> Please don't top post. It is hard to follow the thread. >> >>> On 2024/6/21 3:37 AM, Alexandre Belloni wrote: >>>> On 23/05/2024 18:38:07-0700, Joseph Jang wrote: >>>>> The rtctest requires the read permission on /dev/rtc0. The rtctest will >>>>> be skipped if the /dev/rtc0 is not readable. >>>>> >>>>> Reviewed-by: Koba Ko <kobak@nvidia.com> >>>>> Reviewed-by: Matthew R. Ochs <mochs@nvidia.com> >>>>> Signed-off-by: Joseph Jang <jjang@nvidia.com> >>>> >>>> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> >>>> >> >> Alexandre, I can take this patch through kselftest. Might have >> slipped through my Inbox or the assumption that this will go >> through rtc tree. > > I assumed this would go through your tree, this is why I didn't carry > it. > I will take it through my tree then. Sorry for the delay. thanks, -- Shuah
On 2024/9/25 3:57 AM, Shuah Khan wrote: > On 9/24/24 13:31, Alexandre Belloni wrote: >> Hello, >> >> On 24/09/2024 10:05:43-0600, Shuah Khan wrote: >>> On 9/23/24 23:37, Joseph Jang wrote: >>>> Hi Alexandre, >>>> >>>> Thank you for looking at the rtc patch. >>>> I saw you Acked the [PATCH 2/2], not sure when could we see the patch >>>> in kernel master or next branch ? >>>> >>>> Thank you, >>>> Joseph. >>>> >>> >>> Please don't top post. It is hard to follow the thread. >>> >>>> On 2024/6/21 3:37 AM, Alexandre Belloni wrote: >>>>> On 23/05/2024 18:38:07-0700, Joseph Jang wrote: >>>>>> The rtctest requires the read permission on /dev/rtc0. The rtctest >>>>>> will >>>>>> be skipped if the /dev/rtc0 is not readable. >>>>>> >>>>>> Reviewed-by: Koba Ko <kobak@nvidia.com> >>>>>> Reviewed-by: Matthew R. Ochs <mochs@nvidia.com> >>>>>> Signed-off-by: Joseph Jang <jjang@nvidia.com> >>>>> >>>>> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> >>>>> >>> >>> Alexandre, I can take this patch through kselftest. Might have >>> slipped through my Inbox or the assumption that this will go >>> through rtc tree. >> >> I assumed this would go through your tree, this is why I didn't carry >> it. >> > > I will take it through my tree then. Sorry for the delay. Hi Shuah, Thanks your help. May I know when can we see the patch on master branch ? Thank you, Joseph. > > thanks, > -- Shuah
On 10/17/24 22:18, Joseph Jang wrote:
>
>
> On 2024/9/25 3:57 AM, Shuah Khan wrote:
>> On 9/24/24 13:31, Alexandre Belloni wrote:
>>> Hello,
>>>
>>> On 24/09/2024 10:05:43-0600, Shuah Khan wrote:
>>>> On 9/23/24 23:37, Joseph Jang wrote:
>>>>> Hi Alexandre,
>>>>>
>>>>> Thank you for looking at the rtc patch.
>>>>> I saw you Acked the [PATCH 2/2], not sure when could we see the patch
>>>>> in kernel master or next branch ?
>>>>>
>>>>> Thank you,
>>>>> Joseph.
>>>>>
>>>>
>>>> Please don't top post. It is hard to follow the thread.
>>>>
>>>>> On 2024/6/21 3:37 AM, Alexandre Belloni wrote:
>>>>>> On 23/05/2024 18:38:07-0700, Joseph Jang wrote:
>>>>>>> The rtctest requires the read permission on /dev/rtc0. The rtctest will
>>>>>>> be skipped if the /dev/rtc0 is not readable.
>>>>>>>
>>>>>>> Reviewed-by: Koba Ko <kobak@nvidia.com>
>>>>>>> Reviewed-by: Matthew R. Ochs <mochs@nvidia.com>
>>>>>>> Signed-off-by: Joseph Jang <jjang@nvidia.com>
>>>>>>
>>>>>> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
>>>>>>
>>>>
>>>> Alexandre, I can take this patch through kselftest. Might have
>>>> slipped through my Inbox or the assumption that this will go
>>>> through rtc tree.
>>>
>>> I assumed this would go through your tree, this is why I didn't carry
>>> it.
>>>
>>
>> I will take it through my tree then. Sorry for the delay.
>
> Hi Shuah,
>
> Thanks your help.
> May I know when can we see the patch on master branch ?
>
Did you check the mainline:
This is already in Linux 6.12 since rc2
commit 1ad999870a86d58246b6a614a435d055a9edf269
Author: Joseph Jang <jjang@nvidia.com>
Date: Thu May 23 18:38:07 2024 -0700
selftest: rtc: Check if could access /dev/rtc0 before testing
thanks,
-- Shuah
© 2016 - 2026 Red Hat, Inc.