@@ -1120,8 +1120,11 @@
prepare_to_wait(&coredev->buffer_mng_waitq, &wait, TASK_INTERRUPTIBLE);
- if (list_empty(&coredev->buffers))
+ if (list_empty(&coredev->buffers)) {
+ spin_unlock_irqrestore(&coredev->bufferslock, flags);
schedule();
+ spin_lock_irqsave(&coredev->bufferslock, flags);
+ }
finish_wait(&coredev->buffer_mng_waitq, &wait);
@@ -1144,8 +1147,14 @@
*/
void smscore_putbuffer(struct smscore_device_t *coredev,
struct smscore_buffer_t *cb) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&coredev->bufferslock, flags);
+
+ list_add(&cb->entry, &coredev->buffers);
wake_up_interruptible(&coredev->buffer_mng_waitq);
- list_add_locked(&cb->entry, &coredev->buffers, &coredev->bufferslock);
+
+ spin_unlock_irqrestore(&coredev->bufferslock, flags);
}
EXPORT_SYMBOL_GPL(smscore_putbuffer);