Skip to content

Commit

Permalink
[S390] dasd: Prevent deadlock during suspend/resume.
Browse files Browse the repository at this point in the history
The freeze callback may set a stop bit so that a worker thread could
not start I/O. The discipline specific freeze function waits for the
worker to be completed.
Set the stop_bit after the discipline specific freeze function has
returned and no worker is running.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Stefan Haberland authored and Martin Schwidefsky committed Jan 5, 2011
1 parent 5a27e60 commit 6f272b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2769,6 +2769,10 @@ int dasd_generic_pm_freeze(struct ccw_device *cdev)

if (IS_ERR(device))
return PTR_ERR(device);

if (device->discipline->freeze)
rc = device->discipline->freeze(device);

/* disallow new I/O */
dasd_device_set_stop_bits(device, DASD_STOPPED_PM);
/* clear active requests */
Expand Down Expand Up @@ -2805,9 +2809,6 @@ int dasd_generic_pm_freeze(struct ccw_device *cdev)
list_splice_tail(&freeze_queue, &device->ccw_queue);
spin_unlock_irq(get_ccwdev_lock(cdev));

if (device->discipline->freeze)
rc = device->discipline->freeze(device);

dasd_put_device(device);
return rc;
}
Expand Down

0 comments on commit 6f272b9

Please sign in to comment.