lkml.org 
[lkml]   [2017]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/8] LinuxPPS: kapi: Unlock before waking up events queue in pps_event().
Date
From: Alexander GQ Gerasiov <gq@redlab-i.ru>

Otherwise we get "scheduling while atomic" problem.

Signed-off-by: Alexander GQ Gerasiov <gq@redlab-i.ru>
---
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
\
 
 \ /
  Last update: 2017-02-15 15:33    [W:0.092 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site