All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Jian-Hong Pan <jian-hong@endlessm.com>
Cc: Yan-Hsuan Chuang <yhchuang@realtek.com>,
	"David S . Miller" <davem@davemloft.net>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	David Laight <David.Laight@aculab.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux@endlessm.com,
	Daniel Drake <drake@endlessm.com>,
	Jian-Hong Pan <jian-hong@endlessm.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v4 1/2] rtw88: pci: Rearrange the memory usage for skb in RX ISR
Date: Wed, 24 Jul 2019 11:49:40 +0000 (UTC)	[thread overview]
Message-ID: <20190724114940.4436E6053D@smtp.codeaurora.org> (raw)
In-Reply-To: <20190711052427.5582-1-jian-hong@endlessm.com>

Jian-Hong Pan <jian-hong@endlessm.com> wrote:

> 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>

2 patches applied to wireless-drivers-next.git, thanks.

ee6db78f5db9 rtw88: pci: Rearrange the memory usage for skb in RX ISR
29b68a920f6a rtw88: pci: Use DMA sync instead of remapping in RX ISR

-- 
https://patchwork.kernel.org/patch/11039275/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


  parent reply	other threads:[~2019-07-24 11:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08  6:32 [PATCH] rtw88/pci: Rearrange the memory usage for skb in RX ISR Jian-Hong Pan
2019-07-08  7:23 ` Tony Chuang
2019-07-08  8:07   ` Jian-Hong Pan
2019-07-08  9:00     ` Tony Chuang
2019-07-08  9:18       ` David Laight
2019-07-08  8:36 ` David Laight
2019-07-08 18:01 ` Larry Finger
2019-07-09 10:20 ` [PATCH v2 1/2] rtw88: pci: " Jian-Hong Pan
2019-07-10  8:36   ` Tony Chuang
2019-07-10  8:54     ` Jian-Hong Pan
2019-07-09 10:21 ` [PATCH v2 2/2] rtw88: pci: Use DMA sync instead of remapping " Jian-Hong Pan
2019-07-09 16:15   ` Christoph Hellwig
2019-07-10  8:38     ` [PATCH v3 1/2] rtw88: pci: Rearrange the memory usage for skb " Jian-Hong Pan
2019-07-10  8:57       ` David Laight
2019-07-11  3:50         ` Jian-Hong Pan
2019-07-11  5:24           ` [PATCH v4 " Jian-Hong Pan
2019-07-11  5:24             ` [PATCH v4 2/2] rtw88: pci: Use DMA sync instead of remapping " Jian-Hong Pan
2019-07-11  5:30               ` Jian-Hong Pan
2019-07-11  5:28             ` [PATCH v4 1/2] rtw88: pci: Rearrange the memory usage for skb " Jian-Hong Pan
2019-07-24  6:13               ` Jian-Hong Pan
2019-07-24 11:49             ` Kalle Valo [this message]
2019-08-15 20:25       ` [PATCH v3 " Brian Norris
2019-07-10  8:38     ` [PATCH v3 2/2] rtw88: pci: Use DMA sync instead of remapping " Jian-Hong Pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190724114940.4436E6053D@smtp.codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=David.Laight@aculab.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=davem@davemloft.net \
    --cc=drake@endlessm.com \
    --cc=hch@infradead.org \
    --cc=jian-hong@endlessm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yhchuang@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.