Skip to content

Commit 6cbb7ae

Browse files
dcuimartinkpetersen
authored andcommitted
scsi: core: Allow the state change from SDEV_QUIESCE to SDEV_BLOCK
The APIs scsi_host_block()/scsi_host_unblock() were recently added by commit 2bb9558 ("scsi: core: add scsi_host_(block,unblock) helper function") and so far the APIs are only used by: commit 3d3ca53 ("scsi: aacraid: use scsi_host_(block,unblock) to block I/O"). However, from reading the code, I think the APIs don't really work for aacraid, because, in the resume path of hibernation, when aac_suspend() -> scsi_host_block() is called, scsi_device_quiesce() has set the state to SDEV_QUIESCE, so aac_suspend() -> scsi_host_block() returns -EINVAL. Fix the issue by allowing the state change. Link: https://lore.kernel.org/r/[email protected] Fixes: 2bb9558 ("scsi: core: add scsi_host_(block,unblock) helper function") Reviewed-by: Ewan D. Milne <[email protected]> Reviewed-by: Ming Lei <[email protected]> Signed-off-by: Dexuan Cui <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent fa17a6d commit 6cbb7ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
22842284
switch (oldstate) {
22852285
case SDEV_RUNNING:
22862286
case SDEV_CREATED_BLOCK:
2287+
case SDEV_QUIESCE:
22872288
case SDEV_OFFLINE:
22882289
break;
22892290
default:

0 commit comments

Comments
 (0)