diff mbox series

[1/3] scsi: Allow state transitions from OFFLINE to BLOCKED

Message ID 20181213104716.31930-8-hare@suse.de
State Not Applicable
Delegated to: David Miller
Headers show
Series ata: move DPRINTK to dynamic debugging | expand

Commit Message

Hannes Reinecke Dec. 13, 2018, 10:46 a.m. UTC
From: Hannes Reinecke <hare@suse.com>

When an RSCN gets delayed (or not being sent at all) the transport
class will detect an error, EH kicks in, and eventually will be
setting the device to offline.
If we receive an RSCN after that the device will stay in 'offline'.
This patch allows for an 'offline' to 'blocked' transition, thereby
allowing the device to become active again.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/scsi_lib.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index aaa1819b0a69..7db3c5fae469 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2764,6 +2764,7 @@  scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 		switch (oldstate) {
 		case SDEV_RUNNING:
 		case SDEV_CREATED_BLOCK:
+		case SDEV_OFFLINE:
 			break;
 		default:
 			goto illegal;