From cb7474949371ba8d7591a62924f05b627a2601d9 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 16 Aug 2017 03:13:02 -0400 Subject: media: cec-pin: fix irq handling The free_irq() function could be called from interrupt context, which is invalid. Move this to the thread. In the interrupt handler we just request that the thread disables the irq. This is done through an atomic so we don't need to add any spinlocks. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- include/media/cec-pin.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/media/cec-pin.h') diff --git a/include/media/cec-pin.h b/include/media/cec-pin.h index 44b82d29d480..d28d07fa312e 100644 --- a/include/media/cec-pin.h +++ b/include/media/cec-pin.h @@ -113,6 +113,10 @@ struct cec_pin_ops { #define CEC_NUM_PIN_EVENTS 128 +#define CEC_PIN_IRQ_UNCHANGED 0 +#define CEC_PIN_IRQ_DISABLE 1 +#define CEC_PIN_IRQ_ENABLE 2 + struct cec_pin { struct cec_adapter *adap; const struct cec_pin_ops *ops; @@ -137,8 +141,8 @@ struct cec_pin { struct cec_msg work_rx_msg; u8 work_tx_status; - bool work_enable_irq; ktime_t work_tx_ts; + atomic_t work_irq_change; atomic_t work_pin_events; unsigned int work_pin_events_wr; unsigned int work_pin_events_rd; -- cgit v1.2.3