Commit 568da769 authored by Kashyap, Desai's avatar Kashyap, Desai Committed by James Bottomley

[SCSI] mptfusion: Check for command status is added after completion.

1) Corrected name string as "MPT SAS HOST"
2) Added proper check conditions for MPT_MGMT_STATUS_COMMAND_GOOD.
Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 69b2e9b4
...@@ -1894,7 +1894,7 @@ static struct scsi_host_template mptsas_driver_template = { ...@@ -1894,7 +1894,7 @@ static struct scsi_host_template mptsas_driver_template = {
.module = THIS_MODULE, .module = THIS_MODULE,
.proc_name = "mptsas", .proc_name = "mptsas",
.proc_info = mptscsih_proc_info, .proc_info = mptscsih_proc_info,
.name = "MPT SPI Host", .name = "MPT SAS Host",
.info = mptscsih_info, .info = mptscsih_info,
.queuecommand = mptsas_qcmd, .queuecommand = mptsas_qcmd,
.target_alloc = mptsas_target_alloc, .target_alloc = mptsas_target_alloc,
...@@ -2038,11 +2038,13 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset) ...@@ -2038,11 +2038,13 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset)
timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done,
10 * HZ); 10 * HZ);
if (!timeleft) { if (!(ioc->sas_mgmt.status & MPT_MGMT_STATUS_COMMAND_GOOD)) {
/* On timeout reset the board */ error = -ETIME;
mpt_free_msg_frame(ioc, mf); mpt_free_msg_frame(ioc, mf);
if (ioc->sas_mgmt.status & MPT_MGMT_STATUS_DID_IOCRESET)
goto out_unlock;
if (!timeleft)
mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
error = -ETIMEDOUT;
goto out_unlock; goto out_unlock;
} }
...@@ -2223,11 +2225,14 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, ...@@ -2223,11 +2225,14 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf); mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf);
timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ); timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ);
if (!timeleft) { if (!(ioc->sas_mgmt.status & MPT_MGMT_STATUS_COMMAND_GOOD)) {
printk(MYIOC_s_ERR_FMT "%s: smp timeout!\n", ioc->name, __func__); ret = -ETIME;
/* On timeout reset the board */ mpt_free_msg_frame(ioc, mf);
mf = NULL;
if (ioc->sas_mgmt.status & MPT_MGMT_STATUS_DID_IOCRESET)
goto unmap;
if (!timeleft)
mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
ret = -ETIMEDOUT;
goto unmap; goto unmap;
} }
mf = NULL; mf = NULL;
...@@ -4098,6 +4103,7 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id) ...@@ -4098,6 +4103,7 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id)
cfg.pageAddr = (channel << 8) + id; cfg.pageAddr = (channel << 8) + id;
cfg.cfghdr.hdr = &hdr; cfg.cfghdr.hdr = &hdr;
cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
if (mpt_config(ioc, &cfg) != 0) if (mpt_config(ioc, &cfg) != 0)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment