[patch 34/52] [PATCH] cio: ensure proper locking during device recognition

From: Martin Schwidefsky
Date: Fri Nov 13 2009 - 10:13:18 EST


From: Peter Oberparleiter <peter.oberparleiter@xxxxxxxxxx>

Device recognition needs to be started with the ccw device lock
held to prevent race conditions between I/O starting and interrupt
reception.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@xxxxxxxxxx>
Signed-off-by: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
---

drivers/s390/cio/device.c | 2 ++
1 file changed, 2 insertions(+)

Index: quilt-2.6/drivers/s390/cio/device.c
===================================================================
--- quilt-2.6.orig/drivers/s390/cio/device.c 2009-11-13 16:08:18.000000000 +0100
+++ quilt-2.6/drivers/s390/cio/device.c 2009-11-13 16:08:19.000000000 +0100
@@ -488,7 +488,9 @@
{
/* Do device recognition, if needed. */
if (cdev->private->state == DEV_STATE_BOXED) {
+ spin_lock_irq(cdev->ccwlock);
ccw_device_recognition(cdev);
+ spin_unlock_irq(cdev->ccwlock);
wait_event(cdev->private->wait_q,
cdev->private->flags.recog_done);
if (cdev->private->state != DEV_STATE_OFFLINE)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/