diff --git a/patches.suse/wcn36xx-use-dma_zalloc_coherent-instead-of-allocator.patch b/patches.suse/wcn36xx-use-dma_zalloc_coherent-instead-of-allocator.patch new file mode 100644 index 0000000..1a69079 --- /dev/null +++ b/patches.suse/wcn36xx-use-dma_zalloc_coherent-instead-of-allocator.patch @@ -0,0 +1,76 @@ +From d410e28f3ae476e1572b8893c646ef44fae7bbbd Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Mon, 6 Aug 2018 12:39:16 +0300 +Subject: [PATCH] wcn36xx: use dma_zalloc_coherent instead of allocator/memset +Git-commit: d410e28f3ae476e1572b8893c646ef44fae7bbbd +References: git-fixes +Patch-mainline: v4.20-rc1 + +Use dma_zalloc_coherent instead of dma_alloc_coherent +followed by memset 0. + +Signed-off-by: YueHaibing +Signed-off-by: Kalle Valo +Signed-off-by: Oliver Neukum +--- + drivers/net/wireless/ath/wcn36xx/dxe.c | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +diff --git a/drivers/net/wireless/ath/wcn36xx/dxe.c b/drivers/net/wireless/ath/wcn36xx/dxe.c +index 06cfe8d311f3..5ab3e31c9ffa 100644 +--- a/drivers/net/wireless/ath/wcn36xx/dxe.c ++++ b/drivers/net/wireless/ath/wcn36xx/dxe.c +@@ -174,13 +174,12 @@ static int wcn36xx_dxe_init_descs(struct device *dev, struct wcn36xx_dxe_ch *wcn + int i; + + size = wcn_ch->desc_num * sizeof(struct wcn36xx_dxe_desc); +- wcn_ch->cpu_addr = dma_alloc_coherent(dev, size, &wcn_ch->dma_addr, +- GFP_KERNEL); ++ wcn_ch->cpu_addr = dma_zalloc_coherent(dev, size, ++ &wcn_ch->dma_addr, ++ GFP_KERNEL); + if (!wcn_ch->cpu_addr) + return -ENOMEM; + +- memset(wcn_ch->cpu_addr, 0, size); +- + cur_dxe = (struct wcn36xx_dxe_desc *)wcn_ch->cpu_addr; + cur_ctl = wcn_ch->head_blk_ctl; + +@@ -628,13 +627,13 @@ int wcn36xx_dxe_allocate_mem_pools(struct wcn36xx *wcn) + 16 - (WCN36XX_BD_CHUNK_SIZE % 8); + + s = wcn->mgmt_mem_pool.chunk_size * WCN36XX_DXE_CH_DESC_NUMB_TX_H; +- cpu_addr = dma_alloc_coherent(wcn->dev, s, &wcn->mgmt_mem_pool.phy_addr, +- GFP_KERNEL); ++ cpu_addr = dma_zalloc_coherent(wcn->dev, s, ++ &wcn->mgmt_mem_pool.phy_addr, ++ GFP_KERNEL); + if (!cpu_addr) + goto out_err; + + wcn->mgmt_mem_pool.virt_addr = cpu_addr; +- memset(cpu_addr, 0, s); + + /* Allocate BD headers for DATA frames */ + +@@ -643,13 +642,13 @@ int wcn36xx_dxe_allocate_mem_pools(struct wcn36xx *wcn) + 16 - (WCN36XX_BD_CHUNK_SIZE % 8); + + s = wcn->data_mem_pool.chunk_size * WCN36XX_DXE_CH_DESC_NUMB_TX_L; +- cpu_addr = dma_alloc_coherent(wcn->dev, s, &wcn->data_mem_pool.phy_addr, +- GFP_KERNEL); ++ cpu_addr = dma_zalloc_coherent(wcn->dev, s, ++ &wcn->data_mem_pool.phy_addr, ++ GFP_KERNEL); + if (!cpu_addr) + goto out_err; + + wcn->data_mem_pool.virt_addr = cpu_addr; +- memset(cpu_addr, 0, s); + + return 0; + +-- +2.40.1 + diff --git a/series.conf b/series.conf index 2a08a5c..4443c76 100644 --- a/series.conf +++ b/series.conf @@ -42207,6 +42207,7 @@ patches.suse/ice-Fix-error-on-driver-remove.patch patches.suse/ath10k-fix-kernel-panic-by-moving-pci-flush-after-na.patch patches.suse/wcn36xx-Use-kmemdup-instead-of-duplicating-it-in-wcn.patch + patches.suse/wcn36xx-use-dma_zalloc_coherent-instead-of-allocator.patch patches.suse/ath10k-skip-resetting-rx-filter-for-WCN3990.patch patches.suse/ath10k-schedule-hardware-restart-if-WMI-command-time.patch patches.suse/ath9k-fix-tx99-with-monitor-mode-interface.patch