Skip to contentSkip to conversation

media: gpio-ir-tx: Driver does not behave with PREEMPT_RT

PATCH In review Sean Young 2 participants 2 messages Sep 21, 2024 – Oct 2, 2024

Subsystems (2)
lore
Share & tools
lore

Sean Young

author maintainer
#0 lore raw

PATCH 1/1 media: gpio-ir-tx: Driver does not behave with PREEMPT_RT

This driver bit-bangs a signal with interrupts disabled. The signal can last for up to half a second (IR_MAX_DURATION).

A much better way of transmitting IR is using the pwm-ir-tx driver, which does not disable interrupts.

---
 drivers/media/rc/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/media/rc/Kconfig +1 -0
index 74d69ce22a33e..0a8aeafdb7e07 100644
@@ -184,6 +184,7 @@ config IR_GPIO_TX
 	tristate "GPIO IR Bit Banging Transmitter"
 	depends on LIRC
 	depends on (OF && GPIOLIB) || COMPILE_TEST
+	depends on !PREEMPT_RT
 	help
 	   Say Y if you want to a GPIO based IR transmitter. This is a
 	   bit banging driver.
Signature · 1 line
2.46.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sean Young

This driver bit-bangs a signal with interrupts disabled. The signal can last for up to half a second (IR_MAX_DURATION).

A much better way of transmitting IR is using the pwm-ir-tx driver, which does not disable interrupts.

If you have to spin to make the signal exact and there is no other way then be may guest.

But RT or not, spinning for up to 0.5s is a lot. Is this 0.5s in total or 0.5 * count?
Anyway, gpio_ir_tx_unmodulated() and gpio_ir_tx_modulated() have local_irq_disable() in there which can be removed. It got introduced in commit 1451b93223bbe ("media: gpio-ir-tx: spinlock is not needed to disable interrupts") but the previous irq-save is enough.

Quoted 1 line

Sebastian