diff options
author | Xiangliang Yu <yuxiangl@marvell.com> | 2013-01-29 11:25:53 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-02-22 06:18:33 -0500 |
commit | 7c237c5f6d5c62724ccd82aecdcd1fd9bd71dc75 (patch) | |
tree | 70660235d07bba87b4221912f08fabe3192a5c48 /drivers/scsi/mvsas/mv_sas.c | |
parent | 2b4df6ea53d05625e9ca2dd73bc0e831976e009d (diff) |
[SCSI] mvsas: fixed timeout issue when removing module
Root cause is libsas will clear asd_sas_port phy_mask value in sas_port_deform
after triggering destruct workqueue, but the workqueue will send sync cmd and
still need phy_mask value. Now, mvsas using asd_sas_phy setting instead of
asd_sas_port setting.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/mvsas/mv_sas.c')
-rw-r--r-- | drivers/scsi/mvsas/mv_sas.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index 078c63913b55..532110f4562a 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c | |||
@@ -316,10 +316,13 @@ static int mvs_task_prep_smp(struct mvs_info *mvi, | |||
316 | struct mvs_task_exec_info *tei) | 316 | struct mvs_task_exec_info *tei) |
317 | { | 317 | { |
318 | int elem, rc, i; | 318 | int elem, rc, i; |
319 | struct sas_ha_struct *sha = mvi->sas; | ||
319 | struct sas_task *task = tei->task; | 320 | struct sas_task *task = tei->task; |
320 | struct mvs_cmd_hdr *hdr = tei->hdr; | 321 | struct mvs_cmd_hdr *hdr = tei->hdr; |
321 | struct domain_device *dev = task->dev; | 322 | struct domain_device *dev = task->dev; |
322 | struct asd_sas_port *sas_port = dev->port; | 323 | struct asd_sas_port *sas_port = dev->port; |
324 | struct sas_phy *sphy = dev->phy; | ||
325 | struct asd_sas_phy *sas_phy = sha->sas_phy[sphy->number]; | ||
323 | struct scatterlist *sg_req, *sg_resp; | 326 | struct scatterlist *sg_req, *sg_resp; |
324 | u32 req_len, resp_len, tag = tei->tag; | 327 | u32 req_len, resp_len, tag = tei->tag; |
325 | void *buf_tmp; | 328 | void *buf_tmp; |
@@ -392,7 +395,7 @@ static int mvs_task_prep_smp(struct mvs_info *mvi, | |||
392 | slot->tx = mvi->tx_prod; | 395 | slot->tx = mvi->tx_prod; |
393 | mvi->tx[mvi->tx_prod] = cpu_to_le32((TXQ_CMD_SMP << TXQ_CMD_SHIFT) | | 396 | mvi->tx[mvi->tx_prod] = cpu_to_le32((TXQ_CMD_SMP << TXQ_CMD_SHIFT) | |
394 | TXQ_MODE_I | tag | | 397 | TXQ_MODE_I | tag | |
395 | (sas_port->phy_mask << TXQ_PHY_SHIFT)); | 398 | (MVS_PHY_ID << TXQ_PHY_SHIFT)); |
396 | 399 | ||
397 | hdr->flags |= flags; | 400 | hdr->flags |= flags; |
398 | hdr->lens = cpu_to_le32(((resp_len / 4) << 16) | ((req_len - 4) / 4)); | 401 | hdr->lens = cpu_to_le32(((resp_len / 4) << 16) | ((req_len - 4) / 4)); |
@@ -438,11 +441,14 @@ static u32 mvs_get_ncq_tag(struct sas_task *task, u32 *tag) | |||
438 | static int mvs_task_prep_ata(struct mvs_info *mvi, | 441 | static int mvs_task_prep_ata(struct mvs_info *mvi, |
439 | struct mvs_task_exec_info *tei) | 442 | struct mvs_task_exec_info *tei) |
440 | { | 443 | { |
444 | struct sas_ha_struct *sha = mvi->sas; | ||
441 | struct sas_task *task = tei->task; | 445 | struct sas_task *task = tei->task; |
442 | struct domain_device *dev = task->dev; | 446 | struct domain_device *dev = task->dev; |
443 | struct mvs_device *mvi_dev = dev->lldd_dev; | 447 | struct mvs_device *mvi_dev = dev->lldd_dev; |
444 | struct mvs_cmd_hdr *hdr = tei->hdr; | 448 | struct mvs_cmd_hdr *hdr = tei->hdr; |
445 | struct asd_sas_port *sas_port = dev->port; | 449 | struct asd_sas_port *sas_port = dev->port; |
450 | struct sas_phy *sphy = dev->phy; | ||
451 | struct asd_sas_phy *sas_phy = sha->sas_phy[sphy->number]; | ||
446 | struct mvs_slot_info *slot; | 452 | struct mvs_slot_info *slot; |
447 | void *buf_prd; | 453 | void *buf_prd; |
448 | u32 tag = tei->tag, hdr_tag; | 454 | u32 tag = tei->tag, hdr_tag; |
@@ -462,7 +468,7 @@ static int mvs_task_prep_ata(struct mvs_info *mvi, | |||
462 | slot->tx = mvi->tx_prod; | 468 | slot->tx = mvi->tx_prod; |
463 | del_q = TXQ_MODE_I | tag | | 469 | del_q = TXQ_MODE_I | tag | |
464 | (TXQ_CMD_STP << TXQ_CMD_SHIFT) | | 470 | (TXQ_CMD_STP << TXQ_CMD_SHIFT) | |
465 | (sas_port->phy_mask << TXQ_PHY_SHIFT) | | 471 | (MVS_PHY_ID << TXQ_PHY_SHIFT) | |
466 | (mvi_dev->taskfileset << TXQ_SRS_SHIFT); | 472 | (mvi_dev->taskfileset << TXQ_SRS_SHIFT); |
467 | mvi->tx[mvi->tx_prod] = cpu_to_le32(del_q); | 473 | mvi->tx[mvi->tx_prod] = cpu_to_le32(del_q); |
468 | 474 | ||