hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
....@@ -1,8 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * QLogic qlcnic NIC Driver
34 * Copyright (c) 2009-2013 QLogic Corporation
4
- *
5
- * See LICENSE.qlcnic for copyright and licensing details.
65 */
76
87 #include "qlcnic.h"
....@@ -434,14 +433,14 @@
434433 *(tx_ring->hw_consumer) = 0;
435434
436435 rq_size = SIZEOF_HOSTRQ_TX(struct qlcnic_hostrq_tx_ctx);
437
- rq_addr = dma_zalloc_coherent(&adapter->pdev->dev, rq_size,
438
- &rq_phys_addr, GFP_KERNEL);
436
+ rq_addr = dma_alloc_coherent(&adapter->pdev->dev, rq_size,
437
+ &rq_phys_addr, GFP_KERNEL);
439438 if (!rq_addr)
440439 return -ENOMEM;
441440
442441 rsp_size = SIZEOF_CARDRSP_TX(struct qlcnic_cardrsp_tx_ctx);
443
- rsp_addr = dma_zalloc_coherent(&adapter->pdev->dev, rsp_size,
444
- &rsp_phys_addr, GFP_KERNEL);
442
+ rsp_addr = dma_alloc_coherent(&adapter->pdev->dev, rsp_size,
443
+ &rsp_phys_addr, GFP_KERNEL);
445444 if (!rsp_addr) {
446445 err = -ENOMEM;
447446 goto out_free_rq;
....@@ -629,7 +628,13 @@
629628 int i, err, ring;
630629
631630 if (dev->flags & QLCNIC_NEED_FLR) {
632
- pci_reset_function(dev->pdev);
631
+ err = pci_reset_function(dev->pdev);
632
+ if (err) {
633
+ dev_err(&dev->pdev->dev,
634
+ "Adapter reset failed (%d). Please reboot\n",
635
+ err);
636
+ return err;
637
+ }
633638 dev->flags &= ~QLCNIC_NEED_FLR;
634639 }
635640
....@@ -855,8 +860,8 @@
855860 struct qlcnic_cmd_args cmd;
856861 size_t nic_size = sizeof(struct qlcnic_info_le);
857862
858
- nic_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, nic_size,
859
- &nic_dma_t, GFP_KERNEL);
863
+ nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
864
+ &nic_dma_t, GFP_KERNEL);
860865 if (!nic_info_addr)
861866 return -ENOMEM;
862867
....@@ -909,8 +914,8 @@
909914 if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC)
910915 return err;
911916
912
- nic_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, nic_size,
913
- &nic_dma_t, GFP_KERNEL);
917
+ nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
918
+ &nic_dma_t, GFP_KERNEL);
914919 if (!nic_info_addr)
915920 return -ENOMEM;
916921
....@@ -964,8 +969,8 @@
964969 void *pci_info_addr;
965970 int err = 0, i;
966971
967
- pci_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, pci_size,
968
- &pci_info_dma_t, GFP_KERNEL);
972
+ pci_info_addr = dma_alloc_coherent(&adapter->pdev->dev, pci_size,
973
+ &pci_info_dma_t, GFP_KERNEL);
969974 if (!pci_info_addr)
970975 return -ENOMEM;
971976
....@@ -1078,8 +1083,8 @@
10781083 return -EIO;
10791084 }
10801085
1081
- stats_addr = dma_zalloc_coherent(&adapter->pdev->dev, stats_size,
1082
- &stats_dma_t, GFP_KERNEL);
1086
+ stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size,
1087
+ &stats_dma_t, GFP_KERNEL);
10831088 if (!stats_addr)
10841089 return -ENOMEM;
10851090
....@@ -1134,8 +1139,8 @@
11341139 if (mac_stats == NULL)
11351140 return -ENOMEM;
11361141
1137
- stats_addr = dma_zalloc_coherent(&adapter->pdev->dev, stats_size,
1138
- &stats_dma_t, GFP_KERNEL);
1142
+ stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size,
1143
+ &stats_dma_t, GFP_KERNEL);
11391144 if (!stats_addr)
11401145 return -ENOMEM;
11411146