提交 56115598 编写于 作者: W Wayne Boyer 提交者: James Bottomley

[SCSI] ipr: move setting of the allow_restart flag for vsets and disks

A problem was found where the call to scsi_add_device() fails intermittently
for an adapter.  This is caused when __scsi_add_device() returns -ENODEV as
a result of not calling scsi_probe_and_add_lun() since the call to
scsi_host_scan_allowed() fails.  scsi_host_scan_allowed() fails because the
adapter state is set to SHOST_RECOVERY instead of SHOST_RUNNING. The state of
the adapter is being set to SHOST_RECOVERY by scsi_eh_scmd_add() during
error handling.

This problem is avoided by moving the setting of the allow_restart flag to
later in the device initialization sequence.  This prevents further error
handling if we get a NOT_READY response from a TUR command by causing
scsi_check_sense() to return SUCCESS.  Therefore, scsi_eh_scmd_add() will
not run and the adapter state will remain as SHOST_RUNNING.
Signed-off-by: NWayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: NBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 82284c09
...@@ -4353,8 +4353,6 @@ static int ipr_slave_configure(struct scsi_device *sdev) ...@@ -4353,8 +4353,6 @@ static int ipr_slave_configure(struct scsi_device *sdev)
IPR_VSET_RW_TIMEOUT); IPR_VSET_RW_TIMEOUT);
blk_queue_max_hw_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS); blk_queue_max_hw_sectors(sdev->request_queue, IPR_VSET_MAX_SECTORS);
} }
if (ipr_is_vset_device(res) || ipr_is_scsi_disk(res))
sdev->allow_restart = 1;
if (ipr_is_gata(res) && res->sata_port) if (ipr_is_gata(res) && res->sata_port)
ap = res->sata_port->ap; ap = res->sata_port->ap;
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
...@@ -6771,7 +6769,8 @@ static int ipr_init_res_table(struct ipr_cmnd *ipr_cmd) ...@@ -6771,7 +6769,8 @@ static int ipr_init_res_table(struct ipr_cmnd *ipr_cmd)
list_move_tail(&res->queue, &ioa_cfg->used_res_q); list_move_tail(&res->queue, &ioa_cfg->used_res_q);
ipr_init_res_entry(res, &cfgtew); ipr_init_res_entry(res, &cfgtew);
res->add_to_ml = 1; res->add_to_ml = 1;
} } else if (res->sdev && (ipr_is_vset_device(res) || ipr_is_scsi_disk(res)))
res->sdev->allow_restart = 1;
if (found) if (found)
ipr_update_res_entry(res, &cfgtew); ipr_update_res_entry(res, &cfgtew);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册