diff options
Diffstat (limited to 'drivers/pcmcia/cs.c')
-rw-r--r-- | drivers/pcmcia/cs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c index 8007bfd..c3b615c 100644 --- a/drivers/pcmcia/cs.c +++ b/drivers/pcmcia/cs.c @@ -621,8 +621,6 @@ static int pccardd(void *__skt) unsigned int events; unsigned int sysfs_events; - set_current_state(TASK_INTERRUPTIBLE); - spin_lock_irqsave(&skt->thread_lock, flags); events = skt->thread_events; skt->thread_events = 0; @@ -670,11 +668,15 @@ static int pccardd(void *__skt) if (kthread_should_stop()) break; + set_current_state(TASK_INTERRUPTIBLE); + schedule(); + + /* make sure we are running */ + __set_current_state(TASK_RUNNING); + try_to_freeze(); } - /* make sure we are running before we exit */ - set_current_state(TASK_RUNNING); /* shut down socket, if a device is still present */ if (skt->state & SOCKET_PRESENT) { |