linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.19 001/100] wil6210: fix freeing of rx buffers in EDMA mode
@ 2019-10-18 22:03 Sasha Levin
  2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 002/100] f2fs: flush quota blocks after turnning it off Sasha Levin
                   ` (98 more replies)
  0 siblings, 99 replies; 107+ messages in thread
From: Sasha Levin @ 2019-10-18 22:03 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Ahmad Masri, Maya Erez, Kalle Valo, Sasha Levin, linux-wireless,
	wil6210, netdev

From: Ahmad Masri <amasri@codeaurora.org>

[ Upstream commit 6470f31927b46846d957628b719dcfda05446664 ]

After being associated with some EDMA rx traffic, upon "down" driver
doesn't free all skbs in the rx ring.
Modify wil_move_all_rx_buff_to_free_list to loop on active list of rx
buffers, unmap the physical memory and free the skb.

Signed-off-by: Ahmad Masri <amasri@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/wireless/ath/wil6210/txrx_edma.c | 44 +++++++-------------
 1 file changed, 14 insertions(+), 30 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/txrx_edma.c b/drivers/net/wireless/ath/wil6210/txrx_edma.c
index 3e7fc2983cbb3..409a6fa8b6c8f 100644
--- a/drivers/net/wireless/ath/wil6210/txrx_edma.c
+++ b/drivers/net/wireless/ath/wil6210/txrx_edma.c
@@ -234,9 +234,10 @@ static int wil_rx_refill_edma(struct wil6210_priv *wil)
 	struct wil_ring *ring = &wil->ring_rx;
 	u32 next_head;
 	int rc = 0;
-	u32 swtail = *ring->edma_rx_swtail.va;
+	ring->swtail = *ring->edma_rx_swtail.va;
 
-	for (; next_head = wil_ring_next_head(ring), (next_head != swtail);
+	for (; next_head = wil_ring_next_head(ring),
+	     (next_head != ring->swtail);
 	     ring->swhead = next_head) {
 		rc = wil_ring_alloc_skb_edma(wil, ring, ring->swhead);
 		if (unlikely(rc)) {
@@ -264,43 +265,26 @@ static void wil_move_all_rx_buff_to_free_list(struct wil6210_priv *wil,
 					      struct wil_ring *ring)
 {
 	struct device *dev = wil_to_dev(wil);
-	u32 next_tail;
-	u32 swhead = (ring->swhead + 1) % ring->size;
+	struct list_head *active = &wil->rx_buff_mgmt.active;
 	dma_addr_t pa;
-	u16 dmalen;
 
-	for (; next_tail = wil_ring_next_tail(ring), (next_tail != swhead);
-	     ring->swtail = next_tail) {
-		struct wil_rx_enhanced_desc dd, *d = &dd;
-		struct wil_rx_enhanced_desc *_d =
-			(struct wil_rx_enhanced_desc *)
-			&ring->va[ring->swtail].rx.enhanced;
-		struct sk_buff *skb;
-		u16 buff_id;
+	while (!list_empty(active)) {
+		struct wil_rx_buff *rx_buff =
+			list_first_entry(active, struct wil_rx_buff, list);
+		struct sk_buff *skb = rx_buff->skb;
 
-		*d = *_d;
-
-		/* Extract the SKB from the rx_buff management array */
-		buff_id = __le16_to_cpu(d->mac.buff_id);
-		if (buff_id >= wil->rx_buff_mgmt.size) {
-			wil_err(wil, "invalid buff_id %d\n", buff_id);
-			continue;
-		}
-		skb = wil->rx_buff_mgmt.buff_arr[buff_id].skb;
-		wil->rx_buff_mgmt.buff_arr[buff_id].skb = NULL;
 		if (unlikely(!skb)) {
-			wil_err(wil, "No Rx skb at buff_id %d\n", buff_id);
+			wil_err(wil, "No Rx skb at buff_id %d\n", rx_buff->id);
 		} else {
-			pa = wil_rx_desc_get_addr_edma(&d->dma);
-			dmalen = le16_to_cpu(d->dma.length);
-			dma_unmap_single(dev, pa, dmalen, DMA_FROM_DEVICE);
-
+			rx_buff->skb = NULL;
+			memcpy(&pa, skb->cb, sizeof(pa));
+			dma_unmap_single(dev, pa, wil->rx_buf_len,
+					 DMA_FROM_DEVICE);
 			kfree_skb(skb);
 		}
 
 		/* Move the buffer from the active to the free list */
-		list_move(&wil->rx_buff_mgmt.buff_arr[buff_id].list,
-			  &wil->rx_buff_mgmt.free);
+		list_move(&rx_buff->list, &wil->rx_buff_mgmt.free);
 	}
 }
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 107+ messages in thread

end of thread, other threads:[~2019-10-29 10:05 UTC | newest]

Thread overview: 107+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 22:03 [PATCH AUTOSEL 4.19 001/100] wil6210: fix freeing of rx buffers in EDMA mode Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 002/100] f2fs: flush quota blocks after turnning it off Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 003/100] scsi: lpfc: Fix a duplicate 0711 log message number Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 004/100] sc16is7xx: Fix for "Unexpected interrupt: 8" Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 005/100] powerpc/powernv: hold device_hotplug_lock when calling memtrace_offline_pages() Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 006/100] f2fs: fix to recover inode's i_gc_failures during POR Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 007/100] f2fs: fix to recover inode->i_flags of inode block " Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 008/100] HID: i2c-hid: add Direkt-Tek DTLAPY133-1 to descriptor override Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 009/100] usb: dwc2: fix unbalanced use of external vbus-supply Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 010/100] tools/power turbostat: fix goldmont C-state limit decoding Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 011/100] x86/cpu: Add Atom Tremont (Jacobsville) Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 012/100] drm/msm/dpu: handle failures while initializing displays Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 013/100] bcache: fix input overflow to writeback_rate_minimum Sasha Levin
2019-10-18 22:03 ` [PATCH AUTOSEL 4.19 014/100] PCI: Fix Switchtec DMA aliasing quirk dmesg noise Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 015/100] Btrfs: fix deadlock on tree root leaf when finding free extent Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 016/100] netfilter: ipset: Make invalid MAC address checks consistent Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 017/100] HID: i2c-hid: Disable runtime PM for LG touchscreen Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 018/100] HID: i2c-hid: Ignore input report if there's no data present on Elan touchpanels Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 019/100] HID: i2c-hid: Add Odys Winbook 13 to descriptor override Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 020/100] platform/x86: Add the VLV ISP PCI ID to atomisp2_pm Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 021/100] platform/x86: Fix config space access for intel_atomisp2_pm Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 022/100] ath10k: assign 'n_cipher_suites = 11' for WCN3990 to enable WPA3 Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 023/100] clk: boston: unregister clks on failure in clk_boston_setup() Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 024/100] scripts/setlocalversion: Improve -dirty check with git-status --no-optional-locks Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 025/100] staging: mt7621-pinctrl: use pinconf-generic for 'dt_node_to_map' and 'dt_free_map' Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 026/100] HID: Add ASUS T100CHI keyboard dock battery quirks Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 027/100] NFSv4: Ensure that the state manager exits the loop on SIGKILL Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 028/100] HID: steam: fix boot loop with bluetooth firmware Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 029/100] HID: steam: fix deadlock with input devices Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 030/100] samples: bpf: fix: seg fault with NULL pointer arg Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 031/100] usb: dwc3: gadget: early giveback if End Transfer already completed Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 032/100] usb: dwc3: gadget: clear DWC3_EP_TRANSFER_STARTED on cmd complete Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 033/100] ALSA: usb-audio: Add quirk for MOTU MicroBook II Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 034/100] ALSA: usb-audio: Cleanup DSD whitelist Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 035/100] usb: handle warm-reset port requests on hub resume Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 036/100] rtc: pcf8523: set xtal load capacitance from DT Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 037/100] mlxsw: spectrum: Set LAG port collector only when active Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 038/100] net: stmmac: Fix NAPI poll in TX path when in multi-queue Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 039/100] scsi: lpfc: Correct localport timeout duration error Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 040/100] CIFS: Respect SMB2 hdr preamble size in read responses Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 041/100] cifs: add credits from unmatched responses/messages Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 042/100] ALSA: hda/realtek - Apply ALC294 hp init also for S4 resume Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 043/100] media: vimc: Remove unused but set variables Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 044/100] ext4: disallow files with EXT4_JOURNAL_DATA_FL from EXT4_IOC_SWAP_BOOT Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 045/100] exec: load_script: Do not exec truncated interpreter path Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 046/100] net: dsa: mv88e6xxx: Release lock while requesting IRQ Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 047/100] PCI/PME: Fix possible use-after-free on remove Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 048/100] drm/amd/display: fix odm combine pipe reset Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 049/100] power: supply: max14656: fix potential use-after-free Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 050/100] iio: adc: meson_saradc: Fix memory allocation order Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 051/100] iio: fix center temperature of bmc150-accel-core Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 052/100] libsubcmd: Make _FORTIFY_SOURCE defines dependent on the feature Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 053/100] perf tests: Avoid raising SEGV using an obvious NULL dereference Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 054/100] perf map: Fix overlapped map handling Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 055/100] perf script brstackinsn: Fix recovery from LBR/binary mismatch Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 056/100] perf jevents: Fix period for Intel fixed counters Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 057/100] perf tools: Propagate get_cpuid() error Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 058/100] perf annotate: Propagate perf_env__arch() error Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 059/100] perf annotate: Fix the signedness of failure returns Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 060/100] perf annotate: Propagate the symbol__annotate() error return Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 061/100] perf annotate: Return appropriate error code for allocation failures Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 062/100] staging: rtl8188eu: fix null dereference when kzalloc fails Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 063/100] crypto: arm/aes-ce - add dependency on AES library Sasha Levin
2019-10-21  6:08   ` Ard Biesheuvel
2019-10-29  9:19     ` Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 064/100] RDMA/hfi1: Prevent memory leak in sdma_init Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 065/100] RDMA/iwcm: Fix a lock inversion issue Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 066/100] HID: hyperv: Use in-place iterator API in the channel callback Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 067/100] nfs: Fix nfsi->nrequests count error on nfs_inode_remove_request Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 068/100] arm64: ftrace: Ensure synchronisation in PLT setup for Neoverse-N1 #1542419 Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 069/100] tty: serial: owl: Fix the link time qualifier of 'owl_uart_exit()' Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 070/100] tty: n_hdlc: fix build on SPARC Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 071/100] RDMA/cxgb4: Do not dma memory off of the stack Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 072/100] gpio: max77620: Use correct unit for debounce times Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 073/100] fs: cifs: mute -Wunused-const-variable message Sasha Levin
2019-10-18 22:04 ` [PATCH AUTOSEL 4.19 074/100] serial: mctrl_gpio: Check for NULL pointer Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 075/100] efi/cper: Fix endianness of PCIe class code Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 076/100] efi/x86: Do not clean dummy variable in kexec path Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 077/100] kbuild: fix build error of 'make nsdeps' in clean tree Sasha Levin
2019-10-19  0:13   ` Masahiro Yamada
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 078/100] MIPS: include: Mark __cmpxchg as __always_inline Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 079/100] x86/xen: Return from panic notifier Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 080/100] ocfs2: clear zero in unaligned direct IO Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 081/100] fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry() Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 082/100] fs: ocfs2: fix a possible null-pointer dereference in ocfs2_write_end_nolock() Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 083/100] fs: ocfs2: fix a possible null-pointer dereference in ocfs2_info_scan_inode_alloc() Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 084/100] arm64: armv8_deprecated: Checking return value for memory allocation Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 085/100] x86/cpu: Add Comet Lake to the Intel CPU models header Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 086/100] sched/vtime: Fix guest/system mis-accounting on task switch Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 087/100] perf/x86/amd: Change/fix NMI latency mitigation to use a timestamp Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 088/100] drm/amdgpu: fix memory leak Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 089/100] iio: adc: hx711: fix bug in sampling of data Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 090/100] iio: imu: adis16400: release allocated memory on failure Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 091/100] iio: adc: ad799x: fix probe error handling Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 092/100] iio: light: opt3001: fix mutex unlock race Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 093/100] MIPS: include: Mark __xchg as __always_inline Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 094/100] MIPS: fw: sni: Fix out of bounds init of o32 stack Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 095/100] USB: usb-skeleton: fix use-after-free after driver unbind Sasha Levin
2019-10-18 22:22   ` Greg Kroah-Hartman
2019-10-29  9:04     ` Sasha Levin
2019-10-29  9:43       ` Greg Kroah-Hartman
2019-10-29 10:04         ` Johan Hovold
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 096/100] virt: vbox: fix memory leak in hgcm_call_preprocess_linaddr Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 097/100] nbd: fix possible sysfs duplicate warning Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 098/100] NFSv4: Fix leak of clp->cl_acceptor string Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 099/100] s390/uaccess: avoid (false positive) compiler warnings Sasha Levin
2019-10-18 22:05 ` [PATCH AUTOSEL 4.19 100/100] tracing: Initialize iter->seq after zeroing in tracing_read_pipe() Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).