media: gpio-ir-tx: spinlock is not needed to disable interrupts
authorSean Young <sean@mess.org>
Thu, 13 Aug 2020 09:08:49 +0000 (11:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Sep 2020 11:55:34 +0000 (13:55 +0200)
commit76101def01209fb491b9e03f73e67c95914e0fef
treef640b61c20e65e38fdf67fedd9eccf353d830a4d
parent92fb4a758e05a738fb4f4ffa2d60884be6d7d375
media: gpio-ir-tx: spinlock is not needed to disable interrupts

[ Upstream commit 1451b93223bbe3b4e9c91fca6b451d00667c5bf0 ]

During bit-banging the IR on a gpio pin, we cannot be scheduled or have
anything interrupt us, else the generated signal will be incorrect.
Therefore, we need to disable interrupts on the local cpu. This also
disables preemption.

local_irq_disable() does exactly what we need and does not require a
spinlock.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/rc/gpio-ir-tx.c