2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 18:23:53 +08:00
linux-next/drivers/net/wireless/realtek/rtw88
Jian-Hong Pan ee6db78f5d rtw88: pci: Rearrange the memory usage for skb in RX ISR
Testing with RTL8822BE hardware, when available memory is low, we
frequently see a kernel panic and system freeze.

First, rtw_pci_rx_isr encounters a memory allocation failure (trimmed):

rx routine starvation
WARNING: CPU: 7 PID: 9871 at drivers/net/wireless/realtek/rtw88/pci.c:822 rtw_pci_rx_isr.constprop.25+0x35a/0x370 [rtwpci]
[ 2356.580313] RIP: 0010:rtw_pci_rx_isr.constprop.25+0x35a/0x370 [rtwpci]

Then we see a variety of different error conditions and kernel panics,
such as this one (trimmed):

rtw_pci 0000:02:00.0: pci bus timeout, check dma status
skbuff: skb_over_panic: text:00000000091b6e66 len:415 put:415 head:00000000d2880c6f data:000000007a02b1ea tail:0x1df end:0xc0 dev:<NULL>
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:105!
invalid opcode: 0000 [#1] SMP NOPTI
RIP: 0010:skb_panic+0x43/0x45

When skb allocation fails and the "rx routine starvation" is hit, the
function returns immediately without updating the RX ring. At this
point, the RX ring may continue referencing an old skb which was already
handed off to ieee80211_rx_irqsafe(). When it comes to be used again,
bad things happen.

This patch allocates a new, data-sized skb first in RX ISR. After
copying the data in, we pass it to the upper layers. However, if skb
allocation fails, we effectively drop the frame. In both cases, the
original, full size ring skb is reused.

In addition, to fixing the kernel crash, the RX routine should now
generally behave better under low memory conditions.

Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=204053
Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-07-24 14:49:17 +03:00
..
debug.c
debug.h
efuse.c
efuse.h
fw.c rtw88: Make some symbols static 2019-05-28 14:41:47 +03:00
fw.h
hci.h rtw88: fix typo rtw_writ16_set 2019-06-25 08:09:01 +03:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mac80211.c rtw88: add beacon function setting 2019-06-25 08:08:55 +03:00
mac.c rtw88: power on again if it was already on 2019-06-25 08:08:59 +03:00
mac.h
main.c rtw88: remove all RTW_MAX_POWER_INDEX macro 2019-06-27 20:24:28 +03:00
main.h rtw88: update tx power limit table to RF v20 2019-06-27 20:24:27 +03:00
Makefile rtw88: add license for Makefile 2019-05-03 15:06:12 +03:00
pci.c rtw88: pci: Rearrange the memory usage for skb in RX ISR 2019-07-24 14:49:17 +03:00
pci.h
phy.c rtw88: refine flow to get tx power index 2019-06-27 20:24:29 +03:00
phy.h rtw88: refine flow to get tx power index 2019-06-27 20:24:29 +03:00
ps.c
ps.h
reg.h
regd.c rtw88: update tx power limit table to RF v20 2019-06-27 20:24:27 +03:00
regd.h rtw88: update tx power limit table to RF v20 2019-06-27 20:24:27 +03:00
rtw8822b_table.c
rtw8822b_table.h
rtw8822b.c rtw88: Fix misuse of GENMASK macro 2019-07-24 14:48:21 +03:00
rtw8822b.h
rtw8822c_table.c rtw88: update tx power limit table to RF v20 2019-06-27 20:24:27 +03:00
rtw8822c_table.h
rtw8822c.c rtw88: restore DACK results to save time 2019-06-25 08:09:00 +03:00
rtw8822c.h rtw88: restore DACK results to save time 2019-06-25 08:09:00 +03:00
rx.c
rx.h
sec.c
sec.h
tx.c rtw88: rsvd page should go though management queue 2019-06-25 08:09:01 +03:00
tx.h
util.c
util.h