aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 1a058ec9bd0c..191dafd89be0 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -849,7 +849,8 @@ qla2x00_resize_request_q(scsi_qla_host_t *ha)
849 return; 849 return;
850 850
851 /* Retrieve IOCB counts available to the firmware. */ 851 /* Retrieve IOCB counts available to the firmware. */
852 rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, &fw_iocb_cnt); 852 rval = qla2x00_get_resource_cnts(ha, NULL, NULL, NULL, &fw_iocb_cnt,
853 &ha->max_npiv_vports);
853 if (rval) 854 if (rval)
854 return; 855 return;
855 /* No point in continuing if current settings are sufficient. */ 856 /* No point in continuing if current settings are sufficient. */
@@ -916,9 +917,15 @@ qla2x00_setup_chip(scsi_qla_host_t *ha)
916 &ha->fw_attributes, &ha->fw_memory_size); 917 &ha->fw_attributes, &ha->fw_memory_size);
917 qla2x00_resize_request_q(ha); 918 qla2x00_resize_request_q(ha);
918 ha->flags.npiv_supported = 0; 919 ha->flags.npiv_supported = 0;
919 if (IS_QLA24XX(ha) && 920 if ((IS_QLA24XX(ha) || IS_QLA25XX(ha)) &&
920 (ha->fw_attributes & BIT_2)) 921 (ha->fw_attributes & BIT_2)) {
921 ha->flags.npiv_supported = 1; 922 ha->flags.npiv_supported = 1;
923 if ((!ha->max_npiv_vports) ||
924 ((ha->max_npiv_vports + 1) %
925 MAX_MULTI_ID_FABRIC))
926 ha->max_npiv_vports =
927 MAX_NUM_VPORT_FABRIC;
928 }
922 929
923 if (ql2xallocfwdump) 930 if (ql2xallocfwdump)
924 qla2x00_alloc_fw_dump(ha); 931 qla2x00_alloc_fw_dump(ha);
@@ -1155,8 +1162,7 @@ qla2x00_init_rings(scsi_qla_host_t *ha)
1155 1162
1156 DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no)); 1163 DEBUG(printk("scsi(%ld): Issue init firmware.\n", ha->host_no));
1157 1164
1158 mid_init_cb->count = MAX_NUM_VPORT_FABRIC; 1165 mid_init_cb->count = ha->max_npiv_vports;
1159 ha->max_npiv_vports = MAX_NUM_VPORT_FABRIC;
1160 1166
1161 rval = qla2x00_init_firmware(ha, ha->init_cb_size); 1167 rval = qla2x00_init_firmware(ha, ha->init_cb_size);
1162 if (rval) { 1168 if (rval) {
@@ -1786,12 +1792,11 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
1786{ 1792{
1787 fc_port_t *fcport; 1793 fc_port_t *fcport;
1788 1794
1789 fcport = kmalloc(sizeof(fc_port_t), flags); 1795 fcport = kzalloc(sizeof(fc_port_t), flags);
1790 if (fcport == NULL) 1796 if (!fcport)
1791 return (fcport); 1797 return NULL;
1792 1798
1793 /* Setup fcport template structure. */ 1799 /* Setup fcport template structure. */
1794 memset(fcport, 0, sizeof (fc_port_t));
1795 fcport->ha = ha; 1800 fcport->ha = ha;
1796 fcport->vp_idx = ha->vp_idx; 1801 fcport->vp_idx = ha->vp_idx;
1797 fcport->port_type = FCT_UNKNOWN; 1802 fcport->port_type = FCT_UNKNOWN;
@@ -1801,7 +1806,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
1801 fcport->supported_classes = FC_COS_UNSPECIFIED; 1806 fcport->supported_classes = FC_COS_UNSPECIFIED;
1802 spin_lock_init(&fcport->rport_lock); 1807 spin_lock_init(&fcport->rport_lock);
1803 1808
1804 return (fcport); 1809 return fcport;
1805} 1810}
1806 1811
1807/* 1812/*
@@ -2127,15 +2132,9 @@ qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport)
2127 if (!IS_IIDMA_CAPABLE(ha)) 2132 if (!IS_IIDMA_CAPABLE(ha))
2128 return; 2133 return;
2129 2134
2130 if (fcport->fp_speed == PORT_SPEED_UNKNOWN) { 2135 if (fcport->fp_speed == PORT_SPEED_UNKNOWN ||
2131 DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- " 2136 fcport->fp_speed > ha->link_data_rate)
2132 "unsupported FM port operating speed.\n",
2133 ha->host_no, fcport->port_name[0], fcport->port_name[1],
2134 fcport->port_name[2], fcport->port_name[3],
2135 fcport->port_name[4], fcport->port_name[5],
2136 fcport->port_name[6], fcport->port_name[7]));
2137 return; 2137 return;
2138 }
2139 2138
2140 rval = qla2x00_set_idma_speed(ha, fcport->loop_id, fcport->fp_speed, 2139 rval = qla2x00_set_idma_speed(ha, fcport->loop_id, fcport->fp_speed,
2141 mb); 2140 mb);
@@ -2473,13 +2472,12 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
2473 rval = QLA_SUCCESS; 2472 rval = QLA_SUCCESS;
2474 2473
2475 /* Try GID_PT to get device list, else GAN. */ 2474 /* Try GID_PT to get device list, else GAN. */
2476 swl = kmalloc(sizeof(sw_info_t) * MAX_FIBRE_DEVICES, GFP_ATOMIC); 2475 swl = kcalloc(MAX_FIBRE_DEVICES, sizeof(sw_info_t), GFP_ATOMIC);
2477 if (swl == NULL) { 2476 if (!swl) {
2478 /*EMPTY*/ 2477 /*EMPTY*/
2479 DEBUG2(printk("scsi(%ld): GID_PT allocations failed, fallback " 2478 DEBUG2(printk("scsi(%ld): GID_PT allocations failed, fallback "
2480 "on GA_NXT\n", ha->host_no)); 2479 "on GA_NXT\n", ha->host_no));
2481 } else { 2480 } else {
2482 memset(swl, 0, sizeof(sw_info_t) * MAX_FIBRE_DEVICES);
2483 if (qla2x00_gid_pt(ha, swl) != QLA_SUCCESS) { 2481 if (qla2x00_gid_pt(ha, swl) != QLA_SUCCESS) {
2484 kfree(swl); 2482 kfree(swl);
2485 swl = NULL; 2483 swl = NULL;