diff options
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index bb69a14a4afc..1af578dec276 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -384,6 +384,7 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, | |||
384 | struct bnx2i_cmd *bnx2i_cmd; | 384 | struct bnx2i_cmd *bnx2i_cmd; |
385 | struct bnx2i_tmf_request *tmfabort_wqe; | 385 | struct bnx2i_tmf_request *tmfabort_wqe; |
386 | u32 dword; | 386 | u32 dword; |
387 | u32 scsi_lun[2]; | ||
387 | 388 | ||
388 | bnx2i_cmd = (struct bnx2i_cmd *)mtask->dd_data; | 389 | bnx2i_cmd = (struct bnx2i_cmd *)mtask->dd_data; |
389 | tmfabort_hdr = (struct iscsi_tm *)mtask->hdr; | 390 | tmfabort_hdr = (struct iscsi_tm *)mtask->hdr; |
@@ -394,27 +395,35 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, | |||
394 | tmfabort_wqe->op_attr = 0; | 395 | tmfabort_wqe->op_attr = 0; |
395 | tmfabort_wqe->op_attr = | 396 | tmfabort_wqe->op_attr = |
396 | ISCSI_TMF_REQUEST_ALWAYS_ONE | ISCSI_TM_FUNC_ABORT_TASK; | 397 | ISCSI_TMF_REQUEST_ALWAYS_ONE | ISCSI_TM_FUNC_ABORT_TASK; |
397 | tmfabort_wqe->lun[0] = be32_to_cpu(tmfabort_hdr->lun[0]); | ||
398 | tmfabort_wqe->lun[1] = be32_to_cpu(tmfabort_hdr->lun[1]); | ||
399 | 398 | ||
400 | tmfabort_wqe->itt = (mtask->itt | (ISCSI_TASK_TYPE_MPATH << 14)); | 399 | tmfabort_wqe->itt = (mtask->itt | (ISCSI_TASK_TYPE_MPATH << 14)); |
401 | tmfabort_wqe->reserved2 = 0; | 400 | tmfabort_wqe->reserved2 = 0; |
402 | tmfabort_wqe->cmd_sn = be32_to_cpu(tmfabort_hdr->cmdsn); | 401 | tmfabort_wqe->cmd_sn = be32_to_cpu(tmfabort_hdr->cmdsn); |
403 | 402 | ||
404 | ctask = iscsi_itt_to_task(conn, tmfabort_hdr->rtt); | 403 | ctask = iscsi_itt_to_task(conn, tmfabort_hdr->rtt); |
405 | if (!ctask || ctask->sc) | 404 | if (!ctask || !ctask->sc) |
406 | /* | 405 | /* |
407 | * the iscsi layer must have completed the cmd while this | 406 | * the iscsi layer must have completed the cmd while this |
408 | * was starting up. | 407 | * was starting up. |
408 | * | ||
409 | * Note: In the case of a SCSI cmd timeout, the task's sc | ||
410 | * is still active; hence ctask->sc != 0 | ||
411 | * In this case, the task must be aborted | ||
409 | */ | 412 | */ |
410 | return 0; | 413 | return 0; |
414 | |||
411 | ref_sc = ctask->sc; | 415 | ref_sc = ctask->sc; |
412 | 416 | ||
417 | /* Retrieve LUN directly from the ref_sc */ | ||
418 | int_to_scsilun(ref_sc->device->lun, (struct scsi_lun *) scsi_lun); | ||
419 | tmfabort_wqe->lun[0] = be32_to_cpu(scsi_lun[0]); | ||
420 | tmfabort_wqe->lun[1] = be32_to_cpu(scsi_lun[1]); | ||
421 | |||
413 | if (ref_sc->sc_data_direction == DMA_TO_DEVICE) | 422 | if (ref_sc->sc_data_direction == DMA_TO_DEVICE) |
414 | dword = (ISCSI_TASK_TYPE_WRITE << ISCSI_CMD_REQUEST_TYPE_SHIFT); | 423 | dword = (ISCSI_TASK_TYPE_WRITE << ISCSI_CMD_REQUEST_TYPE_SHIFT); |
415 | else | 424 | else |
416 | dword = (ISCSI_TASK_TYPE_READ << ISCSI_CMD_REQUEST_TYPE_SHIFT); | 425 | dword = (ISCSI_TASK_TYPE_READ << ISCSI_CMD_REQUEST_TYPE_SHIFT); |
417 | tmfabort_wqe->ref_itt = (dword | tmfabort_hdr->rtt); | 426 | tmfabort_wqe->ref_itt = (dword | (tmfabort_hdr->rtt & ISCSI_ITT_MASK)); |
418 | tmfabort_wqe->ref_cmd_sn = be32_to_cpu(tmfabort_hdr->refcmdsn); | 427 | tmfabort_wqe->ref_cmd_sn = be32_to_cpu(tmfabort_hdr->refcmdsn); |
419 | 428 | ||
420 | tmfabort_wqe->bd_list_addr_lo = (u32) bnx2i_conn->hba->mp_bd_dma; | 429 | tmfabort_wqe->bd_list_addr_lo = (u32) bnx2i_conn->hba->mp_bd_dma; |