2014-04-05 20:56:01

by Alexey Khoroshilov

[permalink] [raw]
Subject: [PATCH] mfd: ezx-pcap: avoid calling mutex_lock() in irq handler

pcap_adc_irq() calls mutex_lock(), while it is registered
as nonthreaded irq handler.

The patch makes a switch to threaded irq handling.
Compile tested only.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <[email protected]>
---
drivers/mfd/ezx-pcap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 2ed774e7d342..b27830035e36 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -485,8 +485,8 @@ static int ezx_pcap_probe(struct spi_device *spi)
adc_irq = pcap_to_irq(pcap, (pdata->config & PCAP_SECOND_PORT) ?
PCAP_IRQ_ADCDONE2 : PCAP_IRQ_ADCDONE);

- ret = devm_request_irq(&spi->dev, adc_irq, pcap_adc_irq, 0, "ADC",
- pcap);
+ ret = devm_request_threaded_irq(&spi->dev, adc_irq, NULL,
+ pcap_adc_irq, 0, "ADC", pcap);
if (ret)
goto free_irqchip;

--
1.8.3.2