diff options
-rw-r--r-- | drivers/scsi/scsi_lib.c | 6 | ||||
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 1 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 6dfb9785d345..340c569d4535 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1173,6 +1173,7 @@ int scsi_prep_state_check(struct scsi_device *sdev, struct request *req) | |||
1173 | if (unlikely(sdev->sdev_state != SDEV_RUNNING)) { | 1173 | if (unlikely(sdev->sdev_state != SDEV_RUNNING)) { |
1174 | switch (sdev->sdev_state) { | 1174 | switch (sdev->sdev_state) { |
1175 | case SDEV_OFFLINE: | 1175 | case SDEV_OFFLINE: |
1176 | case SDEV_TRANSPORT_OFFLINE: | ||
1176 | /* | 1177 | /* |
1177 | * If the device is offline we refuse to process any | 1178 | * If the device is offline we refuse to process any |
1178 | * commands. The device must be brought online | 1179 | * commands. The device must be brought online |
@@ -2081,6 +2082,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | |||
2081 | switch (oldstate) { | 2082 | switch (oldstate) { |
2082 | case SDEV_CREATED: | 2083 | case SDEV_CREATED: |
2083 | case SDEV_OFFLINE: | 2084 | case SDEV_OFFLINE: |
2085 | case SDEV_TRANSPORT_OFFLINE: | ||
2084 | case SDEV_QUIESCE: | 2086 | case SDEV_QUIESCE: |
2085 | case SDEV_BLOCK: | 2087 | case SDEV_BLOCK: |
2086 | break; | 2088 | break; |
@@ -2093,6 +2095,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | |||
2093 | switch (oldstate) { | 2095 | switch (oldstate) { |
2094 | case SDEV_RUNNING: | 2096 | case SDEV_RUNNING: |
2095 | case SDEV_OFFLINE: | 2097 | case SDEV_OFFLINE: |
2098 | case SDEV_TRANSPORT_OFFLINE: | ||
2096 | break; | 2099 | break; |
2097 | default: | 2100 | default: |
2098 | goto illegal; | 2101 | goto illegal; |
@@ -2100,6 +2103,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | |||
2100 | break; | 2103 | break; |
2101 | 2104 | ||
2102 | case SDEV_OFFLINE: | 2105 | case SDEV_OFFLINE: |
2106 | case SDEV_TRANSPORT_OFFLINE: | ||
2103 | switch (oldstate) { | 2107 | switch (oldstate) { |
2104 | case SDEV_CREATED: | 2108 | case SDEV_CREATED: |
2105 | case SDEV_RUNNING: | 2109 | case SDEV_RUNNING: |
@@ -2136,6 +2140,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | |||
2136 | case SDEV_RUNNING: | 2140 | case SDEV_RUNNING: |
2137 | case SDEV_QUIESCE: | 2141 | case SDEV_QUIESCE: |
2138 | case SDEV_OFFLINE: | 2142 | case SDEV_OFFLINE: |
2143 | case SDEV_TRANSPORT_OFFLINE: | ||
2139 | case SDEV_BLOCK: | 2144 | case SDEV_BLOCK: |
2140 | break; | 2145 | break; |
2141 | default: | 2146 | default: |
@@ -2148,6 +2153,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | |||
2148 | case SDEV_CREATED: | 2153 | case SDEV_CREATED: |
2149 | case SDEV_RUNNING: | 2154 | case SDEV_RUNNING: |
2150 | case SDEV_OFFLINE: | 2155 | case SDEV_OFFLINE: |
2156 | case SDEV_TRANSPORT_OFFLINE: | ||
2151 | case SDEV_CANCEL: | 2157 | case SDEV_CANCEL: |
2152 | break; | 2158 | break; |
2153 | default: | 2159 | default: |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 04c2a278076e..5747478a2bf8 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -35,6 +35,7 @@ static const struct { | |||
35 | { SDEV_DEL, "deleted" }, | 35 | { SDEV_DEL, "deleted" }, |
36 | { SDEV_QUIESCE, "quiesce" }, | 36 | { SDEV_QUIESCE, "quiesce" }, |
37 | { SDEV_OFFLINE, "offline" }, | 37 | { SDEV_OFFLINE, "offline" }, |
38 | { SDEV_TRANSPORT_OFFLINE, "transport-offline" }, | ||
38 | { SDEV_BLOCK, "blocked" }, | 39 | { SDEV_BLOCK, "blocked" }, |
39 | { SDEV_CREATED_BLOCK, "created-blocked" }, | 40 | { SDEV_CREATED_BLOCK, "created-blocked" }, |
40 | }; | 41 | }; |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index ba9698852321..404575857962 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -42,6 +42,7 @@ enum scsi_device_state { | |||
42 | * originate in the mid-layer) */ | 42 | * originate in the mid-layer) */ |
43 | SDEV_OFFLINE, /* Device offlined (by error handling or | 43 | SDEV_OFFLINE, /* Device offlined (by error handling or |
44 | * user request */ | 44 | * user request */ |
45 | SDEV_TRANSPORT_OFFLINE, /* Offlined by transport class error handler */ | ||
45 | SDEV_BLOCK, /* Device blocked by scsi lld. No | 46 | SDEV_BLOCK, /* Device blocked by scsi lld. No |
46 | * scsi commands from user or midlayer | 47 | * scsi commands from user or midlayer |
47 | * should be issued to the scsi | 48 | * should be issued to the scsi |
@@ -421,6 +422,7 @@ static inline unsigned int sdev_id(struct scsi_device *sdev) | |||
421 | static inline int scsi_device_online(struct scsi_device *sdev) | 422 | static inline int scsi_device_online(struct scsi_device *sdev) |
422 | { | 423 | { |
423 | return (sdev->sdev_state != SDEV_OFFLINE && | 424 | return (sdev->sdev_state != SDEV_OFFLINE && |
425 | sdev->sdev_state != SDEV_TRANSPORT_OFFLINE && | ||
424 | sdev->sdev_state != SDEV_DEL); | 426 | sdev->sdev_state != SDEV_DEL); |
425 | } | 427 | } |
426 | static inline int scsi_device_blocked(struct scsi_device *sdev) | 428 | static inline int scsi_device_blocked(struct scsi_device *sdev) |