mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[SCSI] Update the SCSI state model to allow blocking in the created state
Brian King <[email protected]> reported that fibre channel devices can oops during scanning if their ports block (because the device goes from CREATED -> BLOCK -> RUNNING rather than CREATED -> BLOCK -> CREATED). Fix this by adding a new state: CREATED_BLOCK which can only transition back to CREATED and disallow the CREATED -> BLOCK transition. Now both the created and blocked states that the mid-layer recognises can include CREATED_BLOCK. Signed-off-by: James Bottomley <[email protected]>
This commit is contained in:
parent
0f1d87a2ac
commit
6f4267e3bd
4 changed files with 54 additions and 16 deletions
|
|
@ -42,9 +42,11 @@ enum scsi_device_state {
|
|||
* originate in the mid-layer) */
|
||||
SDEV_OFFLINE, /* Device offlined (by error handling or
|
||||
* user request */
|
||||
SDEV_BLOCK, /* Device blocked by scsi lld. No scsi
|
||||
* commands from user or midlayer should be issued
|
||||
* to the scsi lld. */
|
||||
SDEV_BLOCK, /* Device blocked by scsi lld. No
|
||||
* scsi commands from user or midlayer
|
||||
* should be issued to the scsi
|
||||
* lld. */
|
||||
SDEV_CREATED_BLOCK, /* same as above but for created devices */
|
||||
};
|
||||
|
||||
enum scsi_device_event {
|
||||
|
|
@ -393,11 +395,13 @@ static inline int scsi_device_online(struct scsi_device *sdev)
|
|||
}
|
||||
static inline int scsi_device_blocked(struct scsi_device *sdev)
|
||||
{
|
||||
return sdev->sdev_state == SDEV_BLOCK;
|
||||
return sdev->sdev_state == SDEV_BLOCK ||
|
||||
sdev->sdev_state == SDEV_CREATED_BLOCK;
|
||||
}
|
||||
static inline int scsi_device_created(struct scsi_device *sdev)
|
||||
{
|
||||
return sdev->sdev_state == SDEV_CREATED;
|
||||
return sdev->sdev_state == SDEV_CREATED ||
|
||||
sdev->sdev_state == SDEV_CREATED_BLOCK;
|
||||
}
|
||||
|
||||
/* accessor functions for the SCSI parameters */
|
||||
|
|
|
|||
Loading…
Reference in a new issue