Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] dasd: Prevent deadlock during suspend/resume.

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>

authored by

Stefan Haberland and committed by
Martin Schwidefsky
6f272b9c 5a27e60d

+4 -3
+4 -3
drivers/s390/block/dasd.c
··· 2769 2769 2770 2770 if (IS_ERR(device)) 2771 2771 return PTR_ERR(device); 2772 + 2773 + if (device->discipline->freeze) 2774 + rc = device->discipline->freeze(device); 2775 + 2772 2776 /* disallow new I/O */ 2773 2777 dasd_device_set_stop_bits(device, DASD_STOPPED_PM); 2774 2778 /* clear active requests */ ··· 2808 2804 spin_lock_irq(get_ccwdev_lock(cdev)); 2809 2805 list_splice_tail(&freeze_queue, &device->ccw_queue); 2810 2806 spin_unlock_irq(get_ccwdev_lock(cdev)); 2811 - 2812 - if (device->discipline->freeze) 2813 - rc = device->discipline->freeze(device); 2814 2807 2815 2808 dasd_put_device(device); 2816 2809 return rc;