diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2010-03-18 09:53:50 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-11 10:24:12 -0400 |
commit | 568da76929392c9feb60a25383250dd6cfa68e05 (patch) | |
tree | 139fd2d89cf3dc3640395b141be09961066b613e /drivers/message | |
parent | 69b2e9b4431798645e3d8fb51413db97c9845db1 (diff) |
[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: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 7f217445cd93..77f21e068da0 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -1894,7 +1894,7 @@ static struct scsi_host_template mptsas_driver_template = { | |||
1894 | .module = THIS_MODULE, | 1894 | .module = THIS_MODULE, |
1895 | .proc_name = "mptsas", | 1895 | .proc_name = "mptsas", |
1896 | .proc_info = mptscsih_proc_info, | 1896 | .proc_info = mptscsih_proc_info, |
1897 | .name = "MPT SPI Host", | 1897 | .name = "MPT SAS Host", |
1898 | .info = mptscsih_info, | 1898 | .info = mptscsih_info, |
1899 | .queuecommand = mptsas_qcmd, | 1899 | .queuecommand = mptsas_qcmd, |
1900 | .target_alloc = mptsas_target_alloc, | 1900 | .target_alloc = mptsas_target_alloc, |
@@ -2038,11 +2038,13 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset) | |||
2038 | 2038 | ||
2039 | timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, | 2039 | timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, |
2040 | 10 * HZ); | 2040 | 10 * HZ); |
2041 | if (!timeleft) { | 2041 | if (!(ioc->sas_mgmt.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { |
2042 | /* On timeout reset the board */ | 2042 | error = -ETIME; |
2043 | mpt_free_msg_frame(ioc, mf); | 2043 | mpt_free_msg_frame(ioc, mf); |
2044 | mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); | 2044 | if (ioc->sas_mgmt.status & MPT_MGMT_STATUS_DID_IOCRESET) |
2045 | error = -ETIMEDOUT; | 2045 | goto out_unlock; |
2046 | if (!timeleft) | ||
2047 | mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); | ||
2046 | goto out_unlock; | 2048 | goto out_unlock; |
2047 | } | 2049 | } |
2048 | 2050 | ||
@@ -2223,11 +2225,14 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
2223 | mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf); | 2225 | mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf); |
2224 | 2226 | ||
2225 | timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ); | 2227 | timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ); |
2226 | if (!timeleft) { | 2228 | if (!(ioc->sas_mgmt.status & MPT_MGMT_STATUS_COMMAND_GOOD)) { |
2227 | printk(MYIOC_s_ERR_FMT "%s: smp timeout!\n", ioc->name, __func__); | 2229 | ret = -ETIME; |
2228 | /* On timeout reset the board */ | 2230 | mpt_free_msg_frame(ioc, mf); |
2229 | mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); | 2231 | mf = NULL; |
2230 | ret = -ETIMEDOUT; | 2232 | if (ioc->sas_mgmt.status & MPT_MGMT_STATUS_DID_IOCRESET) |
2233 | goto unmap; | ||
2234 | if (!timeleft) | ||
2235 | mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP); | ||
2231 | goto unmap; | 2236 | goto unmap; |
2232 | } | 2237 | } |
2233 | mf = NULL; | 2238 | mf = NULL; |
@@ -4098,6 +4103,7 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
4098 | cfg.pageAddr = (channel << 8) + id; | 4103 | cfg.pageAddr = (channel << 8) + id; |
4099 | cfg.cfghdr.hdr = &hdr; | 4104 | cfg.cfghdr.hdr = &hdr; |
4100 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4105 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
4106 | cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT; | ||
4101 | 4107 | ||
4102 | if (mpt_config(ioc, &cfg) != 0) | 4108 | if (mpt_config(ioc, &cfg) != 0) |
4103 | goto out; | 4109 | goto out; |