Inquiry Regarding IRQF_TIMER Usage in arch_arm_timer on ARM64 (Jetson Platform Porting)
Subsystems (2)
Hi Dany,
Quoted 5 lines · 陈伟
DearXenomai Community:
I am a developer at Xiaomiworking on porting Xenomai to the NVIDIAJetson (ARM64) platform. During the porting process, I
happend to encounter an issue that I would like to confirm and seek guidance on.
What is your kernel version? And are you targeting some Nvidia downstream kernel, or already upstream? Last time I checked for Orin, upstream (+their infamous downstream GPU driver) was fairly usable, and that was somewhere between 6.1 and 6.12 IIRC.
Quoted 10 lines
In the
copy_timer_regsfunction, checking is performed on desc->action-Quoted 1 line
flags for the
__IRQF_TIMERflag. If this flag is present,The function updates pipeline.tick_regs (which includes PC and PSTATE information on ARM64). However, in
arch_arm_timer.c,
when registering the interrupt, the code uses:request_percpu_irq(ppi, xx, "arch_timer", arch_timer_evt);instead of:__request_percpu_irq(ppi, xx,IRQF_TIMER, "arch_timer", arch_timer_evt);As a result, the timer interrupt never carries theIRQF_TIMERflag, andcopy_timer_regsnever updates pipeline.tick_regs.
Quoted 5 lines
My question is:1. Is the omission of
IRQF_TIMERintentional inarch_arm_timer.c, or is this something that should have been updated but was overlooked?
2. If this design is intentional, could you please clarify the rationale behind it?Thank you very much for your time and assistance.
I think this is even a question to upstream Linux because it's not dovetail which invented IRQF_TIMER. I suspect we need something like this - in upstream:
drivers/clocksource/arm_arch_timer.c +12 -8
@@ -1023,25 +1023,29 @@ static int __init arch_timer_register(void) ppi = arch_timer_ppi[arch_timer_uses_ppi];switch (arch_timer_uses_ppi) {case ARCH_TIMER_VIRT_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_virt, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_virt, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);break ;case ARCH_TIMER_PHYS_SECURE_PPI :case ARCH_TIMER_PHYS_NONSECURE_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIME ,"arch_timer" , + arch_timer_evt);if (!err &&arch_timer_has_nonsecure_ppi ()) { ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI ]; - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);if (err)free_percpu_irq (arch_timer_ppi[ARCH_TIMER_PHYS_SECURE_PPI ], arch_timer_evt); }break ;case ARCH_TIMER_HYP_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);break ;default :BUG ();
(untested)
Maybe the extra semantics of IRQF_TIMER are not needed for the arch timers, and that is why the flag was never attached in upstream. Still, it looks inconsistent and should probably be discussed with them.
Quoted 14 lines
Best regards,Dany
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出 的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄 露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件
通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#
Long live the corporate footers ;)
Jan
Signature · 2 lines
Siemens AG, Foundational Technologies Linux Expert Center
From: 陈伟
Sent: Tuesday, November 25, 2025 10:07 AM
To: Jan Kiszka; [email protected]
Cc: 邱文广; 张凯; 安迪
Subject: Re:Re: Inquiry Regarding IRQF_TIMER Usage in arch_arm_timer on ARM64 (Jetson Platform Porting)
Hi, Jan.
Thanks for your reply.
Quoted 10 lines
Quoted 5 lines
Dear Xenomai Community:
I am a developer at Xiaomi working on porting Xenomai to the NVIDIA Jetson (ARM64) platform. During the porting process, I
happened to encounter an issue that I would like to confirm and seek guidance on.What is your kernel version? And are you targeting some Nvidia downstream kernel, or already upstream? Last time I checked for Orin, upstream (+their infamous downstream GPU driver) was fairly usable, and that was somewhere between 6.1 and 6.12 IIRC.
I'm using the total downstream 6.8 kernel from NV, which works well overall, except for some issues with the display driver. I believe the problem is related to the driver itself rather than an issue with Xenomai or the porting process.
Quoted 16 lines
Quoted 10 lines
In the
copy_timer_regsfunction, checking is performed on desc->action-Quoted 1 line
flags for the
__IRQF_TIMERflag. If this flag is present,The function updates pipeline.tick_regs (which includes PC and PSTATE information on ARM64). However, in
arch_arm_timer.c,
when registering the interrupt, the code uses:request_percpu_irq(ppi, xx, "arch_timer", arch_timer_evt);instead of:__request_percpu_irq(ppi, xx,IRQF_TIMER, "arch_timer", arch_timer_evt);As a result, the timer interrupt never carries theIRQF_TIMERflag, andcopy_timer_regsnever updates pipeline.tick_regs.Quoted 5 lines
My question is:1. Is the omission of
IRQF_TIMERintentional inarch_arm_timer.c, or is this something that should have been updated but was overlooked?
2. If this design is intentional, could you please clarify the rationale behind it?Thank you very much for your time and assistance.
Quoted 3 lines
I think this is even a question to upstream Linux because it's not dovetail which invented
IRQF_TIMER. I suspect we need something like this - in upstream:
As you mentioned, IRQF_TIMER is a concept from the upstream Linux kernel. However, I've noticed a difference in how arm_arch_timer and arm_global_timer are handled. Specifically, arm_global_timer was adapted from request_percpu_irq to __request_percpu_irq with IRQF_TIMER flag during the Dovetail porting, while arm_arch_timer was not. I'm not sure if this difference is due to hardware or something else, so I'm looking to get feedback from the community on this.
Quoted 43 lines
drivers/clocksource/arm_arch_timer.c +12
-8@@ -1023,25 +1023,29 @@ static int __init arch_timer_register(void) ppi = arch_timer_ppi[arch_timer_uses_ppi];switch (arch_timer_uses_ppi) {case ARCH_TIMER_VIRT_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_virt, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_virt, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);break ;case ARCH_TIMER_PHYS_SECURE_PPI :case ARCH_TIMER_PHYS_NONSECURE_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIME ,"arch_timer" , + arch_timer_evt);if (!err &&arch_timer_has_nonsecure_ppi ()) { ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI ]; - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);if (err)free_percpu_irq (arch_timer_ppi[ARCH_TIMER_PHYS_SECURE_PPI ], arch_timer_evt); }break ;case ARCH_TIMER_HYP_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);break ;default :BUG ();
Quoted 5 lines
(untested)
Maybe the extra semantics of
IRQF_TIMERare not needed for the arch timers, and that is why the flag was never attached in upstream. Still, it looks inconsistent and should probably be discussed with them.
I've tried a similar patch to the code above before sending the email, and the tick_regs part works as expected. However, I don't assume there are no side effects. It may require more comprehensive testing.
Thanks again for your input, and good luck to you!
Best regards
Dany
From: Jan Kiszka <[email protected]>
Sent: Monday, November 24, 2025 4:05:45 PM
To: 陈伟; [email protected]
Cc: 邱文广; 张凯; 安迪
Subject: [External Mail]Re: Inquiry Regarding IRQF_TIMER Usage in arch_arm_timer on ARM64 (Jetson Platform Porting)
[外部邮件] 此邮件来源于小米公司外部,请谨慎处理。若对邮件安全性存疑,请将邮件转发给[email protected]进行反馈
Hi Dany,
Quoted 5 lines · 陈伟
DearXenomai Community:
I am a developer at Xiaomiworking on porting Xenomai to the NVIDIAJetson (ARM64) platform. During the porting process, I
happend to encounter an issue that I would like to confirm and seek guidance on.
What is your kernel version? And are you targeting some Nvidia downstream kernel, or already upstream? Last time I checked for Orin, upstream (+their infamous downstream GPU driver) was fairly usable, and that was somewhere between 6.1 and 6.12 IIRC.
Quoted 10 lines
In the
copy_timer_regsfunction, checking is performed on desc->action-Quoted 1 line
flags for the
__IRQF_TIMERflag. If this flag is present,The function updates pipeline.tick_regs (which includes PC and PSTATE information on ARM64). However, in
arch_arm_timer.c,
when registering the interrupt, the code uses:request_percpu_irq(ppi, xx, "arch_timer", arch_timer_evt);instead of:__request_percpu_irq(ppi, xx,IRQF_TIMER, "arch_timer", arch_timer_evt);As a result, the timer interrupt never carries theIRQF_TIMERflag, andcopy_timer_regsnever updates pipeline.tick_regs.
Quoted 5 lines
My question is:1. Is the omission of
IRQF_TIMERintentional inarch_arm_timer.c, or is this something that should have been updated but was overlooked?
2. If this design is intentional, could you please clarify the rationale behind it?Thank you very much for your time and assistance.
I think this is even a question to upstream Linux because it's not dovetail which invented IRQF_TIMER. I suspect we need something like this - in upstream:
drivers/clocksource/arm_arch_timer.c +12 -8
@@ -1023,25 +1023,29 @@ static int __init arch_timer_register(void) ppi = arch_timer_ppi[arch_timer_uses_ppi];switch (arch_timer_uses_ppi) {case ARCH_TIMER_VIRT_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_virt, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_virt, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);break ;case ARCH_TIMER_PHYS_SECURE_PPI :case ARCH_TIMER_PHYS_NONSECURE_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIME ,"arch_timer" , + arch_timer_evt);if (!err &&arch_timer_has_nonsecure_ppi ()) { ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI ]; - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);if (err)free_percpu_irq (arch_timer_ppi[ARCH_TIMER_PHYS_SECURE_PPI ], arch_timer_evt); }break ;case ARCH_TIMER_HYP_PPI : - err =request_percpu_irq (ppi, arch_timer_handler_phys, -"arch_timer" , arch_timer_evt); + err =__request_percpu_irq (ppi, arch_timer_handler_phys, +IRQF_TIMER ,"arch_timer" , + arch_timer_evt);break ;default :BUG ();
(untested)
Maybe the extra semantics of IRQF_TIMER are not needed for the arch timers, and that is why the flag was never attached in upstream. Still, it looks inconsistent and should probably be discussed with them.
Quoted 14 lines
Best regards,Dany
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出 的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄 露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件
通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#
Long live the corporate footers ;)
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/#
Quoted 11 lines · 陈伟
Hi, Jan.
Thanks for your reply.
Quoted 5 lines
Quoted 5 lines
Dear Xenomai Community:
I am a developer at Xiaomi working on porting Xenomai to the NVIDIA Jetson (ARM64) platform. During the porting process, I
happened to encounter an issue that I would like to confirm and seek guidance on.
Quoted 7 lines
Quoted 4 lines
What is your kernel version? And are you targeting some Nvidia downstream kernel, or already upstream? Last time I checked for Orin, upstream (+their infamous downstream GPU driver) was fairly usable, and that was somewhere between 6.1 and 6.12 IIRC.
I’m using the Total Downstream 6.8 kernel from NV, which works well
Oh... risky path, Ubuntu baseline plus NV changes...
I would still recommend giving 6.12 or 6.17 (soon to be replaced with upcoming 6.18-lts) ad try. Nvidia does officially support mainline, so this is not unrealistic. And it can be much cleaner (I found strange things in the NV kernel...), and your maintenance efforts will go down.
Quoted 26 lines
overall, except for some issues with the display driver. I believe the problem is related to the driver itself rather than an issue with Xenomai or the porting process.
Quoted 16 lines
Quoted 10 lines
In the
copy_timer_regsfunction, checking is performed on desc->action- >flags for the__IRQF_TIMERflag. If this flag is present, The function updates pipeline.tick_regs (which includes PC and PSTATE information on ARM64). However, inarch_arm_timer.c,
when registering the interrupt, the code uses:request_percpu_irq(ppi, xx, "arch_timer", arch_timer_evt);instead of:__request_percpu_irq(ppi, xx,IRQF_TIMER, "arch_timer", arch_timer_evt);As a result, the timer interrupt never carries theIRQF_TIMERflag, andcopy_timer_regsnever updates pipeline.tick_regs.Quoted 5 lines
My question is:1. Is the omission of
IRQF_TIMERintentional inarch_arm_timer.c, or is this something that should have been updated but was overlooked?
2. If this design is intentional, could you please clarify the rationale behind it?Thank you very much for your time and assistance.Quoted 3 lines
I think this is even a question to upstream Linux because it's not dovetail which invented
IRQF_TIMER. I suspect we need something like this - in upstream:
Quoted 8 lines
As you mentioned,
IRQF_TIMERis a concept from the upstream Linux kernel. However, I’ve noticed a difference in howarm_arm_timerandarm_global_timerare handled. Specifically,arm_global_timerwas adapted fromrequest_percpu_irqto__request_percpu_irqwithIRQF_TIMERduring the Dovetail porting, whilearm_arch_timerwas not. I’m not sure if this difference is due to hardware or something else, so I’m looking to get feedback from the community on this.
Yeah, this was likely just forgotten. I may still be worth to push upstream towards consistent flagging. If that should have side effects, we are better off identifying and resolving them.
Quoted 52 lines
Quoted 45 lines
drivers/clocksource/arm_arch_timer.c +0
-0@@ -1023,25 +1023,29 @@ static int __init arch_timer_register(void) ppi = arch_timer_ppi[arch_timer_uses_ppi]; switch (arch_timer_uses_ppi) {case
ARCH_TIMER_VIRT_PPI:
- err = request_percpu_irq(ppi,arch_timer_handler_virt,
- "arch_timer",arch_timer_evt);
+ err = __request_percpu_irq(ppi,arch_timer_handler_virt,
+IRQF_TIMER, "arch_timer",
+arch_timer_evt);
break;
caseARCH_TIMER_PHYS_SECURE_PPI:
caseARCH_TIMER_PHYS_NONSECURE_PPI:
- err = request_percpu_irq(ppi,arch_timer_handler_phys,
- "arch_timer",arch_timer_evt);
+ err = __request_percpu_irq(ppi,arch_timer_handler_phys,
+IRQF_TIME, "arch_timer",
+arch_timer_evt);
if (!err &&arch_timer_has_nonsecure_ppi()) {
ppi = arch_timer_ppi[ARCH_TIMER_PHYS_NONSECURE_PPI]; - err = request_percpu_irq(ppi,arch_timer_handler_phys, - "arch_timer",arch_timer_evt); + err = __request_percpu_irq(ppi,arch_timer_handler_phys, +IRQF_TIMER, "arch_timer", +arch_timer_evt);
if (err)free_percpu_irq(arch_timer_ppi[ARCH_TIMER_PHYS_SECURE_PPI], arch_timer_evt);
}
break;
caseARCH_TIMER_HYP_PPI:
- err = request_percpu_irq(ppi,arch_timer_handler_phys,
- "arch_timer",arch_timer_evt);
+ err = __request_percpu_irq(ppi,arch_timer_handler_phys,
+IRQF_TIMER, "arch_timer",
+arch_timer_evt);
break;
default:
BUG();Quoted 5 lines
(untested)
Maybe the extra semantics of
IRQF_TIMERare not needed for the arch timers, and that is why the flag was never attached in upstream. Still, it looks inconsistent and should probably be discussed with them.
Quoted 5 lines
I’ve tried a similar patch to the code above before sending the email, and the
tick_regspart works as expected. However, I don't assume there are no side effects. It may require more comprehensive testing. Thanks again for your input, and good luck to you!
We are happy to take your feedback - or your patch proposals.
Jan
Signature · 2 lines
Siemens AG, Foundational Technologies Linux Expert Center