[PATCH 4/8] LinuxPPS: kapi: Unlock before waking up events queue in pps_event().
From: Andrey Drobyshev
Date: Wed Feb 15 2017 - 09:32:25 EST
From: Alexander GQ Gerasiov <gq@xxxxxxxxxxx>
Otherwise we get "scheduling while atomic" problem.
Signed-off-by: Alexander GQ Gerasiov <gq@xxxxxxxxxxx>
---
drivers/pps/kapi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pps/kapi.c b/drivers/pps/kapi.c
index 805c749..a9a111d 100644
--- a/drivers/pps/kapi.c
+++ b/drivers/pps/kapi.c
@@ -226,11 +226,11 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
/* Wake up if captured something */
if (captured) {
pps->last_ev++;
+ spin_unlock_irqrestore(&pps->lock, flags);
wake_up_interruptible_all(&pps->queue);
-
kill_fasync(&pps->async_queue, SIGIO, POLL_IN);
- }
- spin_unlock_irqrestore(&pps->lock, flags);
+ } else
+ spin_unlock_irqrestore(&pps->lock, flags);
}
EXPORT_SYMBOL(pps_event);
--
2.1.4