forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/scsi/qla4xxx/ql4_init.c
....@@ -1,8 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * QLogic iSCSI HBA Driver
34 * Copyright (c) 2003-2013 QLogic Corporation
4
- *
5
- * See LICENSE.qla4xxx for copyright and licensing details.
65 */
76
87 #include <scsi/iscsi_if.h>
....@@ -14,7 +13,6 @@
1413 static void ql4xxx_set_mac_number(struct scsi_qla_host *ha)
1514 {
1615 uint32_t value;
17
- uint8_t func_number;
1816 unsigned long flags;
1917
2018 /* Get the function number */
....@@ -22,7 +20,6 @@
2220 value = readw(&ha->reg->ctrl_status);
2321 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2422
25
- func_number = (uint8_t) ((value >> 4) & 0x30);
2623 switch (value & ISP_CONTROL_FN_MASK) {
2724 case ISP_CONTROL_FN0_SCSI:
2825 ha->mac_index = 1;
....@@ -153,8 +150,8 @@
153150 dma_addr_t sys_info_dma;
154151 int status = QLA_ERROR;
155152
156
- sys_info = dma_zalloc_coherent(&ha->pdev->dev, sizeof(*sys_info),
157
- &sys_info_dma, GFP_KERNEL);
153
+ sys_info = dma_alloc_coherent(&ha->pdev->dev, sizeof(*sys_info),
154
+ &sys_info_dma, GFP_KERNEL);
158155 if (sys_info == NULL) {
159156 DEBUG2(printk("scsi%ld: %s: Unable to allocate dma buffer.\n",
160157 ha->host_no, __func__));
....@@ -667,6 +664,9 @@
667664
668665 pci_set_master(ha->pdev);
669666 status = pci_set_mwi(ha->pdev);
667
+ if (status)
668
+ ql4_printk(KERN_WARNING, ha, "Failed to set MWI\n");
669
+
670670 /*
671671 * We want to respect framework's setting of PCI configuration space
672672 * command register and also want to make sure that all bits of
....@@ -766,12 +766,10 @@
766766 while (drvr_wait) {
767767 if (ql4xxx_lock_drvr(a) == 0) {
768768 ssleep(QL4_LOCK_DRVR_SLEEP);
769
- if (drvr_wait) {
770
- DEBUG2(printk("scsi%ld: %s: Waiting for "
771
- "Global Init Semaphore(%d)...\n",
772
- a->host_no,
773
- __func__, drvr_wait));
774
- }
769
+ DEBUG2(printk("scsi%ld: %s: Waiting for "
770
+ "Global Init Semaphore(%d)...\n",
771
+ a->host_no,
772
+ __func__, drvr_wait));
775773 drvr_wait -= QL4_LOCK_DRVR_SLEEP;
776774 } else {
777775 DEBUG2(printk("scsi%ld: %s: Global Init Semaphore "
....@@ -947,6 +945,7 @@
947945 /**
948946 * qla4xxx_initialize_adapter - initiailizes hba
949947 * @ha: Pointer to host adapter structure.
948
+ * @is_reset: Is this init path or reset path
950949 *
951950 * This routine parforms all of the steps necessary to initialize the adapter.
952951 *
....@@ -1158,9 +1157,10 @@
11581157
11591158 /**
11601159 * qla4xxx_process_ddb_changed - process ddb state change
1161
- * @ha - Pointer to host adapter structure.
1162
- * @fw_ddb_index - Firmware's device database index
1163
- * @state - Device state
1160
+ * @ha: Pointer to host adapter structure.
1161
+ * @fw_ddb_index: Firmware's device database index
1162
+ * @state: Device state
1163
+ * @conn_err: Unused
11641164 *
11651165 * This routine processes a Decive Database Changed AEN Event.
11661166 **/
....@@ -1169,7 +1169,6 @@
11691169 uint32_t state, uint32_t conn_err)
11701170 {
11711171 struct ddb_entry *ddb_entry;
1172
- int status = QLA_ERROR;
11731172
11741173 /* check for out of range index */
11751174 if (fw_ddb_index >= MAX_DDB_ENTRIES)
....@@ -1191,7 +1190,7 @@
11911190 ddb_entry->ddb_change(ha, fw_ddb_index, ddb_entry, state);
11921191
11931192 exit_ddb_event:
1194
- return status;
1193
+ return QLA_ERROR;
11951194 }
11961195
11971196 /**