Skip to contentSkip to conversation

ARM: v7-M: Use ret_to_user_from_irq in PendSV handler

PATCH New Ezequiel Garcia 2 participants 3 messages Oct 26, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: v7-M: Use ret_to_user_from_irq in PendSV handler

The PendSV handler calls v7m_exception_entry which disables IRQs. Therefore, since IRQs are already disabled, the PendSV handler can return using ret_to_user_from_irq.

---
Tested on a NXP LPC43xx platform.

 arch/arm/kernel/entry-v7m.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/entry-v7m.S +1 -1
index b6c8bb9315e7..907534f97053 100644
@@ -88,7 +88,7 @@ __pendsv_entry:
 	@ execute the pending work, including reschedule
 	get_thread_info tsk
 	mov	why, #0
-	b	ret_to_user
+	b	ret_to_user_from_irq
 ENDPROC(__pendsv_entry)
 
 /*
Signature · 1 line
2.5.2
#1 lore raw

PATCH 1/1 ARM: v7-M: Use ret_to_user_from_irq in PendSV handler

Quoted 5 lines · Ezequiel Garcia

The PendSV handler calls v7m_exception_entry which disables IRQs. Therefore, since IRQs are already disabled, the PendSV handler can return using ret_to_user_from_irq.

Looks right. How did you notice this?

Best regards
Uwe

Quoted 23 lines

---
Tested on a NXP LPC43xx platform.

 arch/arm/kernel/entry-v7m.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/entry-v7m.S +1 -1
index b6c8bb9315e7..907534f97053 100644
@@ -88,7 +88,7 @@ __pendsv_entry:
 	@ execute the pending work, including reschedule
 	get_thread_info tsk
 	mov	why, #0
-	b	ret_to_user
+	b	ret_to_user_from_irq
 ENDPROC(__pendsv_entry)
 
 /*
Signature · 1 line
2.5.2
Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
#2 lore raw

PATCH 1/1 ARM: v7-M: Use ret_to_user_from_irq in PendSV handler

Quoted 8 lines · Uwe Kleine-K?nig
Quoted 5 lines · Ezequiel Garcia

The PendSV handler calls v7m_exception_entry which disables IRQs. Therefore, since IRQs are already disabled, the PendSV handler can return using ret_to_user_from_irq.

Looks right. How did you notice this?

Just reading the code.

Quoted 2 lines

Thanks, I'll queue this in Russell's patch tracking system.

Signature · 2 lines
Ezequiel Garc?a, VanguardiaSur
www.vanguardiasur.com.ar