s390/dasd: driver unbind fixes
Subsystems (3)
Stefan Haberland
maintainercover s390/dasd: driver unbind fixes
Hi Jens,
please apply the following patches that fix two issues that may happen during driver unbind.
Stefan Haberland (2):
s390/dasd: fix hanging DASD driver unbind s390/dasd: fix hanging IO request during DASD driver unbind
drivers/s390/block/dasd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
Stefan Haberland
maintainerPATCH 1/2 s390/dasd: fix hanging DASD driver unbind
In case of an unbind of the DASD device driver the function dasd_generic_remove() is called which shuts down the device. Among others this functions removes the int_handler from the cdev. During shutdown the device cancels all outstanding IO requests and waits for completion of the clear request.
Unfortunately the clear interrupt will never be received when there is no interrupt handler connected.
Fix by moving the int_handler removal after the call to the state machine where no request or interrupt is outstanding.
--- drivers/s390/block/dasd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/block/dasd.c +1 -2
@@ -3487,8 +3487,6 @@ void dasd_generic_remove(struct ccw_device *cdev)struct dasd_device *device;struct dasd_block *block; - cdev->handler =NULL ; - device =dasd_device_from_cdev (cdev);if (IS_ERR (device)) {dasd_remove_sysfs_files (cdev);
@@ -3507,6 +3505,7 @@ void dasd_generic_remove(struct ccw_device *cdev)* no quite down yet. */ dasd_set_target_state (device,DASD_STATE_NEW ); + cdev->handler =NULL ;/* dasd_delete_device destroys the device reference. */ block = device->block;dasd_delete_device (device);
Signature · 1 line
2.25.1
Stefan Haberland
maintainerPATCH 2/2 s390/dasd: fix hanging IO request during DASD driver unbind
In reply to Stefan HaberlandPrevent that an IO request is build during device shutdown initiated by a driver unbind. This request will never be able to be processed or canceled and will hang forever. This will lead also to a hanging unbind.
Fix by checking not only if the device is in READY state but also check that there is no device offline initiated before building a new IO request.
--- drivers/s390/block/dasd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/s390/block/dasd.c +2 -1
@@ -3052,7 +3052,8 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx, basedev = block->base;spin_lock_irq (&dq->lock); -if (basedev->state <DASD_STATE_READY ) { +if (basedev->state <DASD_STATE_READY || +test_bit (DASD_FLAG_OFFLINE , &basedev->flags)) {DBF_DEV_EVENT (DBF_ERR , basedev,"device not ready for request %p" , req); rc =BLK_STS_IOERR ;
Signature · 1 line
2.25.1
Quoted 11 lines · Stefan Haberland
Hi Jens,
please apply the following patches that fix two issues that may happen during driver unbind.
Stefan Haberland (2):
s390/dasd: fix hanging DASD driver unbind s390/dasd: fix hanging IO request during DASD driver unbinddrivers/s390/block/dasd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
Signature · 1 line
Jens Axboe