mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: gpio-ir-tx: Driver does not behave with PREEMPT_RT
@ 2024-09-21 19:07 Sean Young
  2024-10-02 13:48 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Young @ 2024-09-21 19:07 UTC (permalink / raw)
  To: linux-media, linux-rt-users, Mauro Carvalho Chehab; +Cc: linux-kernel

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.

Signed-off-by: Sean Young <sean@mess.org>
---
 drivers/media/rc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
index 74d69ce22a33e..0a8aeafdb7e07 100644
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -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.
-- 
2.46.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: gpio-ir-tx: Driver does not behave with PREEMPT_RT
  2024-09-21 19:07 [PATCH] media: gpio-ir-tx: Driver does not behave with PREEMPT_RT Sean Young
@ 2024-10-02 13:48 ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-10-02 13:48 UTC (permalink / raw)
  To: Sean Young
  Cc: linux-media, linux-rt-users, Mauro Carvalho Chehab, linux-kernel

On 2024-09-21 20:07:20 [+0100], Sean Young wrote:
> 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.

Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

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.

> Signed-off-by: Sean Young <sean@mess.org>

Sebastian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-02 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-21 19:07 [PATCH] media: gpio-ir-tx: Driver does not behave with PREEMPT_RT Sean Young
2024-10-02 13:48 ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®