Skip to content

Commit

Permalink
[S390] cio: ensure proper locking during device recognition
Browse files Browse the repository at this point in the history
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@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Peter Oberparleiter authored and Martin Schwidefsky committed Dec 7, 2009
1 parent 7c4d964 commit 1f5bd38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,9 @@ static int online_store_recog_and_online(struct ccw_device *cdev)
{
/* 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)
Expand Down

0 comments on commit 1f5bd38

Please sign in to comment.