aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuinn Tran <quinn.tran@cavium.com>2017-03-15 12:48:52 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2017-03-18 20:28:37 -0400
commit15f30a5752287f20c7de428423c34bc51cfbe465 (patch)
tree3ccc6a4a6c3d193da2e6e26dc2f58095e2157c89
parentf1443eebca7792b3b8b41b27652d67ddc5d31fa2 (diff)
qla2xxx: Use IOCB interface to submit non-critical MBX.
The Mailbox interface is currently over subscribed. We like to reserve the Mailbox interface for the chip managment and link initialization. Any non essential Mailbox command will be routed through the IOCB interface. The IOCB interface is able to absorb more commands. Following commands are being routed through IOCB interface - Get ID List (007Ch) - Get Port DB (0064h) - Get Link Priv Stats (006Dh) Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h12
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h10
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c46
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c270
-rw-r--r--drivers/scsi/qla2xxx/qla_target.c4
6 files changed, 279 insertions, 65 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 8228dfac6a31..ae38b7a789b1 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -395,11 +395,15 @@ struct srb_iocb {
395 struct completion comp; 395 struct completion comp;
396 } abt; 396 } abt;
397 struct ct_arg ctarg; 397 struct ct_arg ctarg;
398#define MAX_IOCB_MB_REG 28
399#define SIZEOF_IOCB_MB_REG (MAX_IOCB_MB_REG * sizeof(uint16_t))
398 struct { 400 struct {
399 __le16 in_mb[28]; /* fr fw */ 401 __le16 in_mb[MAX_IOCB_MB_REG]; /* from FW */
400 __le16 out_mb[28]; /* to fw */ 402 __le16 out_mb[MAX_IOCB_MB_REG]; /* to FW */
401 void *out, *in; 403 void *out, *in;
402 dma_addr_t out_dma, in_dma; 404 dma_addr_t out_dma, in_dma;
405 struct completion comp;
406 int rc;
403 } mbx; 407 } mbx;
404 struct { 408 struct {
405 struct imm_ntfy_from_isp *ntfy; 409 struct imm_ntfy_from_isp *ntfy;
@@ -437,7 +441,7 @@ typedef struct srb {
437 uint32_t handle; 441 uint32_t handle;
438 uint16_t flags; 442 uint16_t flags;
439 uint16_t type; 443 uint16_t type;
440 char *name; 444 const char *name;
441 int iocbs; 445 int iocbs;
442 struct qla_qpair *qpair; 446 struct qla_qpair *qpair;
443 u32 gen1; /* scratch */ 447 u32 gen1; /* scratch */
@@ -3364,6 +3368,8 @@ struct qla_hw_data {
3364 uint32_t exlogins_enabled:1; 3368 uint32_t exlogins_enabled:1;
3365 uint32_t exchoffld_enabled:1; 3369 uint32_t exchoffld_enabled:1;
3366 /* 35 bits */ 3370 /* 35 bits */
3371
3372 uint32_t fw_started:1;
3367 } flags; 3373 } flags;
3368 3374
3369 /* This spinlock is used to protect "io transactions", you must 3375 /* This spinlock is used to protect "io transactions", you must
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index ca6f122e5865..323b912b47f7 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -193,6 +193,7 @@ extern int qla24xx_post_upd_fcport_work(struct scsi_qla_host *, fc_port_t *);
193void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *, 193void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *,
194 uint16_t *); 194 uint16_t *);
195int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *); 195int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *);
196int qla24xx_async_abort_cmd(srb_t *);
196 197
197/* 198/*
198 * Global Functions in qla_mid.c source file. 199 * Global Functions in qla_mid.c source file.
@@ -368,7 +369,7 @@ qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, struct link_statistics *,
368 369
369extern int 370extern int
370qla24xx_get_isp_stats(scsi_qla_host_t *, struct link_statistics *, 371qla24xx_get_isp_stats(scsi_qla_host_t *, struct link_statistics *,
371 dma_addr_t, uint); 372 dma_addr_t, uint16_t);
372 373
373extern int qla24xx_abort_command(srb_t *); 374extern int qla24xx_abort_command(srb_t *);
374extern int qla24xx_async_abort_command(srb_t *); 375extern int qla24xx_async_abort_command(srb_t *);
@@ -472,6 +473,13 @@ qla2x00_dump_mctp_data(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
472extern int 473extern int
473qla26xx_dport_diagnostics(scsi_qla_host_t *, void *, uint, uint); 474qla26xx_dport_diagnostics(scsi_qla_host_t *, void *, uint, uint);
474 475
476int qla24xx_send_mb_cmd(struct scsi_qla_host *, mbx_cmd_t *);
477int qla24xx_gpdb_wait(struct scsi_qla_host *, fc_port_t *, u8);
478int qla24xx_gidlist_wait(struct scsi_qla_host *, void *, dma_addr_t,
479 uint16_t *);
480int __qla24xx_parse_gpdb(struct scsi_qla_host *, fc_port_t *,
481 struct port_database_24xx *);
482
475/* 483/*
476 * Global Function Prototypes in qla_isr.c source file. 484 * Global Function Prototypes in qla_isr.c source file.
477 */ 485 */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index a7865a5d556d..b1bfa63f7d4e 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -629,7 +629,6 @@ void qla24xx_async_gpdb_sp_done(void *s, int res)
629 struct srb *sp = s; 629 struct srb *sp = s;
630 struct scsi_qla_host *vha = sp->vha; 630 struct scsi_qla_host *vha = sp->vha;
631 struct qla_hw_data *ha = vha->hw; 631 struct qla_hw_data *ha = vha->hw;
632 uint64_t zero = 0;
633 struct port_database_24xx *pd; 632 struct port_database_24xx *pd;
634 fc_port_t *fcport = sp->fcport; 633 fc_port_t *fcport = sp->fcport;
635 u16 *mb = sp->u.iocb_cmd.u.mbx.in_mb; 634 u16 *mb = sp->u.iocb_cmd.u.mbx.in_mb;
@@ -649,48 +648,7 @@ void qla24xx_async_gpdb_sp_done(void *s, int res)
649 648
650 pd = (struct port_database_24xx *)sp->u.iocb_cmd.u.mbx.in; 649 pd = (struct port_database_24xx *)sp->u.iocb_cmd.u.mbx.in;
651 650
652 /* Check for logged in state. */ 651 rval = __qla24xx_parse_gpdb(vha, fcport, pd);
653 if (pd->current_login_state != PDS_PRLI_COMPLETE &&
654 pd->last_login_state != PDS_PRLI_COMPLETE) {
655 ql_dbg(ql_dbg_mbx, vha, 0xffff,
656 "Unable to verify login-state (%x/%x) for "
657 "loop_id %x.\n", pd->current_login_state,
658 pd->last_login_state, fcport->loop_id);
659 rval = QLA_FUNCTION_FAILED;
660 goto gpd_error_out;
661 }
662
663 if (fcport->loop_id == FC_NO_LOOP_ID ||
664 (memcmp(fcport->port_name, (uint8_t *)&zero, 8) &&
665 memcmp(fcport->port_name, pd->port_name, 8))) {
666 /* We lost the device mid way. */
667 rval = QLA_NOT_LOGGED_IN;
668 goto gpd_error_out;
669 }
670
671 /* Names are little-endian. */
672 memcpy(fcport->node_name, pd->node_name, WWN_SIZE);
673
674 /* Get port_id of device. */
675 fcport->d_id.b.domain = pd->port_id[0];
676 fcport->d_id.b.area = pd->port_id[1];
677 fcport->d_id.b.al_pa = pd->port_id[2];
678 fcport->d_id.b.rsvd_1 = 0;
679
680 /* If not target must be initiator or unknown type. */
681 if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0)
682 fcport->port_type = FCT_INITIATOR;
683 else
684 fcport->port_type = FCT_TARGET;
685
686 /* Passback COS information. */
687 fcport->supported_classes = (pd->flags & PDF_CLASS_2) ?
688 FC_COS_CLASS2 : FC_COS_CLASS3;
689
690 if (pd->prli_svc_param_word_3[0] & BIT_7) {
691 fcport->flags |= FCF_CONF_COMP_SUPPORTED;
692 fcport->conf_compl_supported = 1;
693 }
694 652
695gpd_error_out: 653gpd_error_out:
696 memset(&ea, 0, sizeof(ea)); 654 memset(&ea, 0, sizeof(ea));
@@ -1266,7 +1224,7 @@ qla24xx_abort_sp_done(void *ptr, int res)
1266 complete(&abt->u.abt.comp); 1224 complete(&abt->u.abt.comp);
1267} 1225}
1268 1226
1269static int 1227int
1270qla24xx_async_abort_cmd(srb_t *cmd_sp) 1228qla24xx_async_abort_cmd(srb_t *cmd_sp)
1271{ 1229{
1272 scsi_qla_host_t *vha = cmd_sp->vha; 1230 scsi_qla_host_t *vha = cmd_sp->vha;
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index b2c6da752edd..3953c8d6af69 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2692,7 +2692,7 @@ qla24xx_abort_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
2692 return; 2692 return;
2693 2693
2694 abt = &sp->u.iocb_cmd; 2694 abt = &sp->u.iocb_cmd;
2695 abt->u.abt.comp_status = le32_to_cpu(pkt->nport_handle); 2695 abt->u.abt.comp_status = le16_to_cpu(pkt->nport_handle);
2696 sp->done(sp, 0); 2696 sp->done(sp, 0);
2697} 2697}
2698 2698
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 35079f417417..e40ed570d3c1 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -10,6 +10,28 @@
10#include <linux/delay.h> 10#include <linux/delay.h>
11#include <linux/gfp.h> 11#include <linux/gfp.h>
12 12
13static struct mb_cmd_name {
14 uint16_t cmd;
15 const char *str;
16} mb_str[] = {
17 {MBC_GET_PORT_DATABASE, "GPDB"},
18 {MBC_GET_ID_LIST, "GIDList"},
19 {MBC_GET_LINK_PRIV_STATS, "Stats"},
20};
21
22static const char *mb_to_str(uint16_t cmd)
23{
24 int i;
25 struct mb_cmd_name *e;
26
27 for (i = 0; i < ARRAY_SIZE(mb_str); i++) {
28 e = mb_str + i;
29 if (cmd == e->cmd)
30 return e->str;
31 }
32 return "unknown";
33}
34
13static struct rom_cmd { 35static struct rom_cmd {
14 uint16_t cmd; 36 uint16_t cmd;
15} rom_cmds[] = { 37} rom_cmds[] = {
@@ -2818,7 +2840,7 @@ qla2x00_get_link_status(scsi_qla_host_t *vha, uint16_t loop_id,
2818 2840
2819int 2841int
2820qla24xx_get_isp_stats(scsi_qla_host_t *vha, struct link_statistics *stats, 2842qla24xx_get_isp_stats(scsi_qla_host_t *vha, struct link_statistics *stats,
2821 dma_addr_t stats_dma, uint options) 2843 dma_addr_t stats_dma, uint16_t options)
2822{ 2844{
2823 int rval; 2845 int rval;
2824 mbx_cmd_t mc; 2846 mbx_cmd_t mc;
@@ -2828,19 +2850,17 @@ qla24xx_get_isp_stats(scsi_qla_host_t *vha, struct link_statistics *stats,
2828 ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1088, 2850 ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1088,
2829 "Entered %s.\n", __func__); 2851 "Entered %s.\n", __func__);
2830 2852
2831 mcp->mb[0] = MBC_GET_LINK_PRIV_STATS; 2853 memset(&mc, 0, sizeof(mc));
2832 mcp->mb[2] = MSW(stats_dma); 2854 mc.mb[0] = MBC_GET_LINK_PRIV_STATS;
2833 mcp->mb[3] = LSW(stats_dma); 2855 mc.mb[2] = MSW(stats_dma);
2834 mcp->mb[6] = MSW(MSD(stats_dma)); 2856 mc.mb[3] = LSW(stats_dma);
2835 mcp->mb[7] = LSW(MSD(stats_dma)); 2857 mc.mb[6] = MSW(MSD(stats_dma));
2836 mcp->mb[8] = sizeof(struct link_statistics) / 4; 2858 mc.mb[7] = LSW(MSD(stats_dma));
2837 mcp->mb[9] = vha->vp_idx; 2859 mc.mb[8] = sizeof(struct link_statistics) / 4;
2838 mcp->mb[10] = options; 2860 mc.mb[9] = cpu_to_le16(vha->vp_idx);
2839 mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_0; 2861 mc.mb[10] = cpu_to_le16(options);
2840 mcp->in_mb = MBX_2|MBX_1|MBX_0; 2862
2841 mcp->tov = MBX_TOV_SECONDS; 2863 rval = qla24xx_send_mb_cmd(vha, &mc);
2842 mcp->flags = IOCTL_CMD;
2843 rval = qla2x00_mailbox_command(vha, mcp);
2844 2864
2845 if (rval == QLA_SUCCESS) { 2865 if (rval == QLA_SUCCESS) {
2846 if (mcp->mb[0] != MBS_COMMAND_COMPLETE) { 2866 if (mcp->mb[0] != MBS_COMMAND_COMPLETE) {
@@ -5827,3 +5847,225 @@ qla26xx_dport_diagnostics(scsi_qla_host_t *vha,
5827 5847
5828 return rval; 5848 return rval;
5829} 5849}
5850
5851static void qla2x00_async_mb_sp_done(void *s, int res)
5852{
5853 struct srb *sp = s;
5854
5855 sp->u.iocb_cmd.u.mbx.rc = res;
5856
5857 complete(&sp->u.iocb_cmd.u.mbx.comp);
5858 /* don't free sp here. Let the caller do the free */
5859}
5860
5861/*
5862 * This mailbox uses the iocb interface to send MB command.
5863 * This allows non-critial (non chip setup) command to go
5864 * out in parrallel.
5865 */
5866int qla24xx_send_mb_cmd(struct scsi_qla_host *vha, mbx_cmd_t *mcp)
5867{
5868 int rval = QLA_FUNCTION_FAILED;
5869 srb_t *sp;
5870 struct srb_iocb *c;
5871
5872 if (!vha->hw->flags.fw_started)
5873 goto done;
5874
5875 sp = qla2x00_get_sp(vha, NULL, GFP_KERNEL);
5876 if (!sp)
5877 goto done;
5878
5879 sp->type = SRB_MB_IOCB;
5880 sp->name = mb_to_str(mcp->mb[0]);
5881
5882 qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2);
5883
5884 memcpy(sp->u.iocb_cmd.u.mbx.out_mb, mcp->mb, SIZEOF_IOCB_MB_REG);
5885
5886 c = &sp->u.iocb_cmd;
5887 c->timeout = qla2x00_async_iocb_timeout;
5888 init_completion(&c->u.mbx.comp);
5889
5890 sp->done = qla2x00_async_mb_sp_done;
5891
5892 rval = qla2x00_start_sp(sp);
5893 if (rval != QLA_SUCCESS) {
5894 ql_dbg(ql_dbg_mbx, vha, 0xffff,
5895 "%s: %s Failed submission. %x.\n",
5896 __func__, sp->name, rval);
5897 goto done_free_sp;
5898 }
5899
5900 ql_dbg(ql_dbg_mbx, vha, 0xffff, "MB:%s hndl %x submitted\n",
5901 sp->name, sp->handle);
5902
5903 wait_for_completion(&c->u.mbx.comp);
5904 memcpy(mcp->mb, sp->u.iocb_cmd.u.mbx.in_mb, SIZEOF_IOCB_MB_REG);
5905
5906 rval = c->u.mbx.rc;
5907 switch (rval) {
5908 case QLA_FUNCTION_TIMEOUT:
5909 ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %s Timeout. %x.\n",
5910 __func__, sp->name, rval);
5911 break;
5912 case QLA_SUCCESS:
5913 ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %s done.\n",
5914 __func__, sp->name);
5915 sp->free(sp);
5916 break;
5917 default:
5918 ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %s Failed. %x.\n",
5919 __func__, sp->name, rval);
5920 sp->free(sp);
5921 break;
5922 }
5923
5924 return rval;
5925
5926done_free_sp:
5927 sp->free(sp);
5928done:
5929 return rval;
5930}
5931
5932/*
5933 * qla24xx_gpdb_wait
5934 * NOTE: Do not call this routine from DPC thread
5935 */
5936int qla24xx_gpdb_wait(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
5937{
5938 int rval = QLA_FUNCTION_FAILED;
5939 dma_addr_t pd_dma;
5940 struct port_database_24xx *pd;
5941 struct qla_hw_data *ha = vha->hw;
5942 mbx_cmd_t mc;
5943
5944 if (!vha->hw->flags.fw_started)
5945 goto done;
5946
5947 pd = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &pd_dma);
5948 if (pd == NULL) {
5949 ql_log(ql_log_warn, vha, 0xffff,
5950 "Failed to allocate port database structure.\n");
5951 goto done_free_sp;
5952 }
5953 memset(pd, 0, max(PORT_DATABASE_SIZE, PORT_DATABASE_24XX_SIZE));
5954
5955 memset(&mc, 0, sizeof(mc));
5956 mc.mb[0] = MBC_GET_PORT_DATABASE;
5957 mc.mb[1] = cpu_to_le16(fcport->loop_id);
5958 mc.mb[2] = MSW(pd_dma);
5959 mc.mb[3] = LSW(pd_dma);
5960 mc.mb[6] = MSW(MSD(pd_dma));
5961 mc.mb[7] = LSW(MSD(pd_dma));
5962 mc.mb[9] = cpu_to_le16(vha->vp_idx);
5963 mc.mb[10] = cpu_to_le16((uint16_t)opt);
5964
5965 rval = qla24xx_send_mb_cmd(vha, &mc);
5966 if (rval != QLA_SUCCESS) {
5967 ql_dbg(ql_dbg_mbx, vha, 0xffff,
5968 "%s: %8phC fail\n", __func__, fcport->port_name);
5969 goto done_free_sp;
5970 }
5971
5972 rval = __qla24xx_parse_gpdb(vha, fcport, pd);
5973
5974 ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %8phC done\n",
5975 __func__, fcport->port_name);
5976
5977done_free_sp:
5978 if (pd)
5979 dma_pool_free(ha->s_dma_pool, pd, pd_dma);
5980done:
5981 return rval;
5982}
5983
5984int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport,
5985 struct port_database_24xx *pd)
5986{
5987 int rval = QLA_SUCCESS;
5988 uint64_t zero = 0;
5989
5990 /* Check for logged in state. */
5991 if (pd->current_login_state != PDS_PRLI_COMPLETE &&
5992 pd->last_login_state != PDS_PRLI_COMPLETE) {
5993 ql_dbg(ql_dbg_mbx, vha, 0xffff,
5994 "Unable to verify login-state (%x/%x) for "
5995 "loop_id %x.\n", pd->current_login_state,
5996 pd->last_login_state, fcport->loop_id);
5997 rval = QLA_FUNCTION_FAILED;
5998 goto gpd_error_out;
5999 }
6000
6001 if (fcport->loop_id == FC_NO_LOOP_ID ||
6002 (memcmp(fcport->port_name, (uint8_t *)&zero, 8) &&
6003 memcmp(fcport->port_name, pd->port_name, 8))) {
6004 /* We lost the device mid way. */
6005 rval = QLA_NOT_LOGGED_IN;
6006 goto gpd_error_out;
6007 }
6008
6009 /* Names are little-endian. */
6010 memcpy(fcport->node_name, pd->node_name, WWN_SIZE);
6011 memcpy(fcport->port_name, pd->port_name, WWN_SIZE);
6012
6013 /* Get port_id of device. */
6014 fcport->d_id.b.domain = pd->port_id[0];
6015 fcport->d_id.b.area = pd->port_id[1];
6016 fcport->d_id.b.al_pa = pd->port_id[2];
6017 fcport->d_id.b.rsvd_1 = 0;
6018
6019 /* If not target must be initiator or unknown type. */
6020 if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0)
6021 fcport->port_type = FCT_INITIATOR;
6022 else
6023 fcport->port_type = FCT_TARGET;
6024
6025 /* Passback COS information. */
6026 fcport->supported_classes = (pd->flags & PDF_CLASS_2) ?
6027 FC_COS_CLASS2 : FC_COS_CLASS3;
6028
6029 if (pd->prli_svc_param_word_3[0] & BIT_7) {
6030 fcport->flags |= FCF_CONF_COMP_SUPPORTED;
6031 fcport->conf_compl_supported = 1;
6032 }
6033
6034gpd_error_out:
6035 return rval;
6036}
6037
6038/*
6039 * qla24xx_gidlist__wait
6040 * NOTE: don't call this routine from DPC thread.
6041 */
6042int qla24xx_gidlist_wait(struct scsi_qla_host *vha,
6043 void *id_list, dma_addr_t id_list_dma, uint16_t *entries)
6044{
6045 int rval = QLA_FUNCTION_FAILED;
6046 mbx_cmd_t mc;
6047
6048 if (!vha->hw->flags.fw_started)
6049 goto done;
6050
6051 memset(&mc, 0, sizeof(mc));
6052 mc.mb[0] = MBC_GET_ID_LIST;
6053 mc.mb[2] = MSW(id_list_dma);
6054 mc.mb[3] = LSW(id_list_dma);
6055 mc.mb[6] = MSW(MSD(id_list_dma));
6056 mc.mb[7] = LSW(MSD(id_list_dma));
6057 mc.mb[8] = 0;
6058 mc.mb[9] = cpu_to_le16(vha->vp_idx);
6059
6060 rval = qla24xx_send_mb_cmd(vha, &mc);
6061 if (rval != QLA_SUCCESS) {
6062 ql_dbg(ql_dbg_mbx, vha, 0xffff,
6063 "%s: fail\n", __func__);
6064 } else {
6065 *entries = mc.mb[1];
6066 ql_dbg(ql_dbg_mbx, vha, 0xffff,
6067 "%s: done\n", __func__);
6068 }
6069done:
6070 return rval;
6071}
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 563116188c43..38bdcd325fa4 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -1238,7 +1238,7 @@ static int qla24xx_get_loop_id(struct scsi_qla_host *vha, const uint8_t *s_id,
1238 } 1238 }
1239 1239
1240 /* Get list of logged in devices */ 1240 /* Get list of logged in devices */
1241 rc = qla2x00_get_id_list(vha, gid_list, gid_list_dma, &entries); 1241 rc = qla24xx_gidlist_wait(vha, gid_list, gid_list_dma, &entries);
1242 if (rc != QLA_SUCCESS) { 1242 if (rc != QLA_SUCCESS) {
1243 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf045, 1243 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf045,
1244 "qla_target(%d): get_id_list() failed: %x\n", 1244 "qla_target(%d): get_id_list() failed: %x\n",
@@ -5648,7 +5648,7 @@ static fc_port_t *qlt_get_port_database(struct scsi_qla_host *vha,
5648 5648
5649 fcport->loop_id = loop_id; 5649 fcport->loop_id = loop_id;
5650 5650
5651 rc = qla2x00_get_port_database(vha, fcport, 0); 5651 rc = qla24xx_gpdb_wait(vha, fcport, 0);
5652 if (rc != QLA_SUCCESS) { 5652 if (rc != QLA_SUCCESS) {
5653 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf070, 5653 ql_dbg(ql_dbg_tgt_mgt, vha, 0xf070,
5654 "qla_target(%d): Failed to retrieve fcport " 5654 "qla_target(%d): Failed to retrieve fcport "