aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_bsg.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2011-07-22 18:37:42 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-07-27 07:14:00 -0400
commitb76f2dc91c0fff7a66616affdc039dc2e4b7ff98 (patch)
treec918b99e5e368f32118044a3ecbb4e793443028c /drivers/scsi/lpfc/lpfc_bsg.c
parent0a96e9754d6c4a2a31e50ee6c6e36ec13f80bc25 (diff)
[SCSI] lpfc 8.3.25: Enhancements to Debug infrastructure
Enhancements to Debug infrastructure - debugfs additions for new hardware. - Correct stack overflow in lpfc_debugfs_dumpHBASlim_data() - Correct warning on uninitialized reg_val in lpfc_idiag_drbacc_write() - Separated the iDiag command for capturing mailbox commands for generic issue mailbox command entry point and for BSG multi-buffer handling. - Added capturing dumping capabiliy of mailbox command and external buffer for the completion of the mailbox command so that the outcome can be examined. - Changed all the iDiag command structure data array indexing introduced so far with properly defined macros. - Added SLI4 device PCI BAR memory mapped register read/browse, write-by- value, set-bit, and clear-bit methods for both interface type 0 and interface type 2. - Corrected warnings on mbxstatus being uninitialized in error paths in lpfc_bsg.c Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_bsg.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index f46378fb802c..6760c69f5253 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -42,6 +42,7 @@
42#include "lpfc.h" 42#include "lpfc.h"
43#include "lpfc_logmsg.h" 43#include "lpfc_logmsg.h"
44#include "lpfc_crtn.h" 44#include "lpfc_crtn.h"
45#include "lpfc_debugfs.h"
45#include "lpfc_vport.h" 46#include "lpfc_vport.h"
46#include "lpfc_version.h" 47#include "lpfc_version.h"
47 48
@@ -1566,7 +1567,7 @@ lpfc_sli3_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct fc_bsg_job *job)
1566 uint32_t link_flags; 1567 uint32_t link_flags;
1567 uint32_t timeout; 1568 uint32_t timeout;
1568 LPFC_MBOXQ_t *pmboxq; 1569 LPFC_MBOXQ_t *pmboxq;
1569 int mbxstatus; 1570 int mbxstatus = MBX_SUCCESS;
1570 int i = 0; 1571 int i = 0;
1571 int rc = 0; 1572 int rc = 0;
1572 1573
@@ -1740,7 +1741,7 @@ lpfc_sli4_bsg_diag_loopback_mode(struct lpfc_hba *phba, struct fc_bsg_job *job)
1740 uint32_t link_flags, timeout, req_len, alloc_len; 1741 uint32_t link_flags, timeout, req_len, alloc_len;
1741 struct lpfc_mbx_set_link_diag_loopback *link_diag_loopback; 1742 struct lpfc_mbx_set_link_diag_loopback *link_diag_loopback;
1742 LPFC_MBOXQ_t *pmboxq = NULL; 1743 LPFC_MBOXQ_t *pmboxq = NULL;
1743 int mbxstatus, i, rc = 0; 1744 int mbxstatus = MBX_SUCCESS, i, rc = 0;
1744 1745
1745 /* no data to return just the return code */ 1746 /* no data to return just the return code */
1746 job->reply->reply_payload_rcv_len = 0; 1747 job->reply->reply_payload_rcv_len = 0;
@@ -3177,6 +3178,11 @@ lpfc_bsg_issue_mbox_ext_handle_job(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
3177 "(x%x/x%x) complete bsg job done, bsize:%d\n", 3178 "(x%x/x%x) complete bsg job done, bsize:%d\n",
3178 phba->mbox_ext_buf_ctx.nembType, 3179 phba->mbox_ext_buf_ctx.nembType,
3179 phba->mbox_ext_buf_ctx.mboxType, size); 3180 phba->mbox_ext_buf_ctx.mboxType, size);
3181 lpfc_idiag_mbxacc_dump_bsg_mbox(phba,
3182 phba->mbox_ext_buf_ctx.nembType,
3183 phba->mbox_ext_buf_ctx.mboxType,
3184 dma_ebuf, sta_pos_addr,
3185 phba->mbox_ext_buf_ctx.mbx_dmabuf, 0);
3180 } else 3186 } else
3181 spin_unlock_irqrestore(&phba->ct_ev_lock, flags); 3187 spin_unlock_irqrestore(&phba->ct_ev_lock, flags);
3182 3188
@@ -3429,6 +3435,10 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct fc_bsg_job *job,
3429 "ext_buf_cnt:%d\n", ext_buf_cnt); 3435 "ext_buf_cnt:%d\n", ext_buf_cnt);
3430 } 3436 }
3431 3437
3438 /* before dma descriptor setup */
3439 lpfc_idiag_mbxacc_dump_bsg_mbox(phba, nemb_tp, mbox_rd, dma_mbox,
3440 sta_pre_addr, dmabuf, ext_buf_cnt);
3441
3432 /* reject non-embedded mailbox command with none external buffer */ 3442 /* reject non-embedded mailbox command with none external buffer */
3433 if (ext_buf_cnt == 0) { 3443 if (ext_buf_cnt == 0) {
3434 rc = -EPERM; 3444 rc = -EPERM;
@@ -3476,6 +3486,10 @@ lpfc_bsg_sli_cfg_read_cmd_ext(struct lpfc_hba *phba, struct fc_bsg_job *job,
3476 } 3486 }
3477 } 3487 }
3478 3488
3489 /* after dma descriptor setup */
3490 lpfc_idiag_mbxacc_dump_bsg_mbox(phba, nemb_tp, mbox_rd, dma_mbox,
3491 sta_pos_addr, dmabuf, ext_buf_cnt);
3492
3479 /* construct base driver mbox command */ 3493 /* construct base driver mbox command */
3480 pmb = &pmboxq->u.mb; 3494 pmb = &pmboxq->u.mb;
3481 pmbx = (uint8_t *)dmabuf->virt; 3495 pmbx = (uint8_t *)dmabuf->virt;
@@ -3590,12 +3604,20 @@ lpfc_bsg_sli_cfg_write_cmd_ext(struct lpfc_hba *phba, struct fc_bsg_job *job,
3590 "ext_buf_cnt:%d\n", ext_buf_cnt); 3604 "ext_buf_cnt:%d\n", ext_buf_cnt);
3591 } 3605 }
3592 3606
3607 /* before dma buffer descriptor setup */
3608 lpfc_idiag_mbxacc_dump_bsg_mbox(phba, nemb_tp, mbox_wr, dma_mbox,
3609 sta_pre_addr, dmabuf, ext_buf_cnt);
3610
3593 if (ext_buf_cnt == 0) 3611 if (ext_buf_cnt == 0)
3594 return -EPERM; 3612 return -EPERM;
3595 3613
3596 /* for the first external buffer */ 3614 /* for the first external buffer */
3597 lpfc_bsg_sli_cfg_dma_desc_setup(phba, nemb_tp, 0, dmabuf, dmabuf); 3615 lpfc_bsg_sli_cfg_dma_desc_setup(phba, nemb_tp, 0, dmabuf, dmabuf);
3598 3616
3617 /* after dma descriptor setup */
3618 lpfc_idiag_mbxacc_dump_bsg_mbox(phba, nemb_tp, mbox_wr, dma_mbox,
3619 sta_pos_addr, dmabuf, ext_buf_cnt);
3620
3599 /* log for looking forward */ 3621 /* log for looking forward */
3600 for (i = 1; i < ext_buf_cnt; i++) { 3622 for (i = 1; i < ext_buf_cnt; i++) {
3601 if (nemb_tp == nemb_mse) 3623 if (nemb_tp == nemb_mse)
@@ -3844,6 +3866,12 @@ lpfc_bsg_read_ebuf_get(struct lpfc_hba *phba, struct fc_bsg_job *job)
3844 dmabuf = list_first_entry(&phba->mbox_ext_buf_ctx.ext_dmabuf_list, 3866 dmabuf = list_first_entry(&phba->mbox_ext_buf_ctx.ext_dmabuf_list,
3845 struct lpfc_dmabuf, list); 3867 struct lpfc_dmabuf, list);
3846 list_del_init(&dmabuf->list); 3868 list_del_init(&dmabuf->list);
3869
3870 /* after dma buffer descriptor setup */
3871 lpfc_idiag_mbxacc_dump_bsg_mbox(phba, phba->mbox_ext_buf_ctx.nembType,
3872 mbox_rd, dma_ebuf, sta_pos_addr,
3873 dmabuf, index);
3874
3847 pbuf = (uint8_t *)dmabuf->virt; 3875 pbuf = (uint8_t *)dmabuf->virt;
3848 job->reply->reply_payload_rcv_len = 3876 job->reply->reply_payload_rcv_len =
3849 sg_copy_from_buffer(job->reply_payload.sg_list, 3877 sg_copy_from_buffer(job->reply_payload.sg_list,
@@ -3926,6 +3954,11 @@ lpfc_bsg_write_ebuf_set(struct lpfc_hba *phba, struct fc_bsg_job *job,
3926 dmabuf); 3954 dmabuf);
3927 list_add_tail(&dmabuf->list, &phba->mbox_ext_buf_ctx.ext_dmabuf_list); 3955 list_add_tail(&dmabuf->list, &phba->mbox_ext_buf_ctx.ext_dmabuf_list);
3928 3956
3957 /* after write dma buffer */
3958 lpfc_idiag_mbxacc_dump_bsg_mbox(phba, phba->mbox_ext_buf_ctx.nembType,
3959 mbox_wr, dma_ebuf, sta_pos_addr,
3960 dmabuf, index);
3961
3929 if (phba->mbox_ext_buf_ctx.seqNum == phba->mbox_ext_buf_ctx.numBuf) { 3962 if (phba->mbox_ext_buf_ctx.seqNum == phba->mbox_ext_buf_ctx.numBuf) {
3930 lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC, 3963 lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC,
3931 "2968 SLI_CONFIG ext-buffer wr all %d " 3964 "2968 SLI_CONFIG ext-buffer wr all %d "