s390/qdio: improve roll-back after error on ESTABLISH ccw
If the ESTABLISH ccw fails (ie. the qdio_irq is set to QDIO_IRQ_STATE_ERR), we don't need to call qdio_shutdown() for rolling back our earlier actions. All the needed logic is already available in qdio_establish()'s error chain, and using it means we don't have to temporarily drop the setup_mutex either. This makes qdio_shutdown() a purely external function, that should only be called by the driver if an earlier qdio_establish() succeeded. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Reviewed-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
1c1dc8bda3
commit
d06314e0ce
@ -1148,9 +1148,8 @@ int qdio_establish(struct ccw_device *cdev,
|
||||
}
|
||||
|
||||
if (irq_ptr->state != QDIO_IRQ_STATE_ESTABLISHED) {
|
||||
mutex_unlock(&irq_ptr->setup_mutex);
|
||||
qdio_shutdown(cdev, QDIO_FLAG_CLEANUP_USING_CLEAR);
|
||||
return -EIO;
|
||||
rc = -EIO;
|
||||
goto err_ccw_error;
|
||||
}
|
||||
|
||||
qdio_setup_ssqd_info(irq_ptr);
|
||||
@ -1165,6 +1164,7 @@ int qdio_establish(struct ccw_device *cdev,
|
||||
|
||||
err_ccw_timeout:
|
||||
qdio_cancel_ccw(irq_ptr, QDIO_FLAG_CLEANUP_USING_CLEAR);
|
||||
err_ccw_error:
|
||||
err_ccw_start:
|
||||
qdio_shutdown_thinint(irq_ptr);
|
||||
err_thinint:
|
||||
|
Loading…
Reference in New Issue
Block a user