kernel_samsung_a53x/drivers/net/ethernet
Christophe JAILLET d7f2fd59f6 net/qla3xxx: switch from 'pci_' to 'dma_' API
[ Upstream commit 41fb4c1ba7478fe34c7e094e124e4ee4513b9763 ]

The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'ql_alloc_net_req_rsp_queues()' GFP_KERNEL can
be used because it is only called from 'ql_alloc_mem_resources()' which
already calls 'ql_alloc_buffer_queues()' which uses GFP_KERNEL. (see below)

When memory is allocated in 'ql_alloc_buffer_queues()' GFP_KERNEL can be
used because this flag is already used just a few line above.

When memory is allocated in 'ql_alloc_small_buffers()' GFP_KERNEL can
be used because it is only called from 'ql_alloc_mem_resources()' which
already calls 'ql_alloc_buffer_queues()' which uses GFP_KERNEL. (see above)

When memory is allocated in 'ql_alloc_mem_resources()' GFP_KERNEL can be
used because this function already calls 'ql_alloc_buffer_queues()' which
uses GFP_KERNEL. (see above)

While at it, use 'dma_set_mask_and_coherent()' instead of 'dma_set_mask()/
dma_set_coherent_mask()' in order to slightly simplify code.

@@
@@
-    PCI_DMA_BIDIRECTIONAL
+    DMA_BIDIRECTIONAL

@@
@@
-    PCI_DMA_TODEVICE
+    DMA_TO_DEVICE

@@
@@
-    PCI_DMA_FROMDEVICE
+    DMA_FROM_DEVICE

@@
@@
-    PCI_DMA_NONE
+    DMA_NONE

@@
expression e1, e2, e3;
@@
-    pci_alloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-    pci_zalloc_consistent(e1, e2, e3)
+    dma_alloc_coherent(&e1->dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-    pci_free_consistent(e1, e2, e3, e4)
+    dma_free_coherent(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_single(e1, e2, e3, e4)
+    dma_map_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_single(e1, e2, e3, e4)
+    dma_unmap_single(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-    pci_map_page(e1, e2, e3, e4, e5)
+    dma_map_page(&e1->dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_page(e1, e2, e3, e4)
+    dma_unmap_page(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_map_sg(e1, e2, e3, e4)
+    dma_map_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_unmap_sg(e1, e2, e3, e4)
+    dma_unmap_sg(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+    dma_sync_single_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_single_for_device(e1, e2, e3, e4)
+    dma_sync_single_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+    dma_sync_sg_for_cpu(&e1->dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-    pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+    dma_sync_sg_for_device(&e1->dev, e2, e3, e4)

@@
expression e1, e2;
@@
-    pci_dma_mapping_error(e1, e2)
+    dma_mapping_error(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_dma_mask(e1, e2)
+    dma_set_mask(&e1->dev, e2)

@@
expression e1, e2;
@@
-    pci_set_consistent_dma_mask(e1, e2)
+    dma_set_coherent_mask(&e1->dev, e2)

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20210117081542.560021-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 89f45c30172c ("net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:12:07 +01:00
..
3com Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
8390 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
adaptec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aeroflex Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
agere Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
alacritech Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
allwinner Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
alteon Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
altera Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
amazon net: ena: Fix XDP redirection error 2024-11-18 12:11:49 +01:00
amd amd-xgbe: propagate the correct speed and duplex status 2024-11-18 12:10:55 +01:00
apm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
apple Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aquantia net: atlantic: fix double free in ring reinit logic 2024-11-18 12:11:49 +01:00
arc Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
atheros ethernet: atheros: fix a memleak in atl1e_setup_ring_resources 2024-11-18 12:11:59 +01:00
aurora Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
broadcom net: bcmgenet: Fix FCS generation for fragmented skbuffs 2024-11-18 12:12:06 +01:00
brocade Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cadence Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
calxeda Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cavium Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
chelsio chtls: fix tp->rcv_tstamp initialization 2024-11-18 11:42:50 +01:00
cirrus Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cisco Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cortina net: ethernet: cortina: Fix MTU max setting 2024-11-18 11:43:20 +01:00
davicom Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dec Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dlink Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
emulex net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
ezchip Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
faraday Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
freescale net: fec: correct queue selection 2024-11-18 12:11:49 +01:00
fujitsu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
google gve: Use size_add() in call to struct_size() 2024-11-18 11:42:47 +01:00
hisilicon net: vlan: introduce skb_vlan_eth_hdr() 2024-11-18 12:11:48 +01:00
huawei Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i825xx Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ibm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel i40e: Restore VF MSI-X state during PCI reset 2024-11-18 12:12:07 +01:00
marvell octeontx2-af: Fix marking couple of structure as __packed 2024-11-18 12:12:06 +01:00
mediatek Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
mellanox net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors 2024-11-18 12:11:58 +01:00
micrel net: ks8851: Fix TX stall caused by TX buffer overrun 2024-11-18 12:12:01 +01:00
microchip Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
moxa Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mscc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
myricom Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
natsemi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
neterion Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netronome Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ni Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nvidia Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nxp Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
oki-semi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
packetengines Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pasemi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pensando ionic: Fix dim work handling in split interrupt mode 2024-11-18 12:11:39 +01:00
qlogic net/qla3xxx: switch from 'pci_' to 'dma_' API 2024-11-18 12:12:07 +01:00
qualcomm qca_spi: Fix reset behavior 2024-11-18 12:11:48 +01:00
rdc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
realtek r8169: fix rtl8125b PAUSE frames blasting when suspended 2024-11-18 12:11:48 +01:00
renesas net: ravb: Start TX queues after HW initialization succeeded 2024-11-18 12:11:11 +01:00
rocker Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
samsung Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
seeq Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sfc sfc: fix a double-free bug in efx_probe_filters 2024-11-18 12:12:06 +01:00
sgi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
silan Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sis Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smsc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socionext Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
stmicro net: stmmac: Handle disabled MDIO busses from devicetree 2024-11-18 12:11:49 +01:00
sun Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
synopsys Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tehuti Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
toshiba net: spider_net: Use size_add() in call to struct_size() 2024-11-18 11:42:47 +01:00
tundra Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
via Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wiznet Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
xilinx net: axienet: Fix check for partial TX checksum 2024-11-18 12:10:55 +01:00
xircom Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xscale Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dnet.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dnet.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ec_bhf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ethoc.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
fealnx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jme.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
jme.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
korina.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lantiq_etop.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lantiq_xrx200.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00