1. 24 Jul, 2019 9 commits
    • Jian-Hong Pan's avatar
      rtw88: pci: Rearrange the memory usage for skb in RX ISR · ee6db78f
      Jian-Hong Pan authored
      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=204053Signed-off-by: default avatarJian-Hong Pan <jian-hong@endlessm.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      ee6db78f
    • Kevin Easton's avatar
      libertas: Add missing sentinel at end of if_usb.c fw_table · 764f3f1e
      Kevin Easton authored
      This sentinel tells the firmware loading process when to stop.
      
      Reported-and-tested-by: syzbot+98156c174c5a2cad9f8f@syzkaller.appspotmail.com
      Signed-off-by: default avatarKevin Easton <kevin@guarana.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      764f3f1e
    • Joe Perches's avatar
      rtw88: Fix misuse of GENMASK macro · 5ff29d83
      Joe Perches authored
      Arguments are supposed to be ordered high then low.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Acked-by: default avatarYan-Hsuan Chuang <yhchuang@realtek.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      5ff29d83
    • Colin Ian King's avatar
      wl3501_cs: remove redundant variable rc · c0324619
      Colin Ian King authored
      The variable rc is being initialized with a value that is never
      read and it is being updated later with a new value that is returned.
      The variable is redundant and can be replaced with a return 0 as
      there are no other return points in this function.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      c0324619
    • Colin Ian King's avatar
      libertas: remove redundant assignment to variable ret · 4c8a4685
      Colin Ian King authored
      The variable ret is being initialized with a value that is never
      read and it is being updated later with a new value. The
      initialization is redundant and can be removed.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4c8a4685
    • Chris Chiu's avatar
      rtl8xxxu: Fix wifi low signal strength issue of RTL8723BU · 18e71468
      Chris Chiu authored
      The WiFi tx power of RTL8723BU is extremely low after booting. So
      the WiFi scan gives very limited AP list and it always fails to
      connect to the selected AP. This module only supports 1x1 antenna
      and the antenna is switched to bluetooth due to some incorrect
      register settings.
      
      Compare with the vendor driver https://github.com/lwfinger/rtl8723bu,
      we realized that the 8723bu's enable_rf() does the same thing as
      rtw_btcoex_HAL_Initialize() in vendor driver. And it by default
      sets the antenna path to BTC_ANT_PATH_BT which we verified it's
      the cause of the wifi weak tx power. The vendor driver will set
      the antenna path to BTC_ANT_PATH_PTA in the consequent btcoexist
      mechanism, by the function halbtc8723b1ant_PsTdma.
      
      This commit hand over the antenna control to PTA(Packet Traffic
      Arbitration), which compares the weight of bluetooth/wifi traffic
      then determine whether to continue current wifi traffic or not.
      After PTA take control, The wifi signal will be back to normal and
      the bluetooth scan can also work at the same time. However, the
      btcoexist still needs to be handled under different circumstances.
      If there's a BT connection established, the wifi still fails to
      connect until BT disconnected.
      Signed-off-by: default avatarChris Chiu <chiu@endlessm.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      18e71468
    • Greg Kroah-Hartman's avatar
      rt2x00: no need to check return value of debugfs_create functions · 1dc24406
      Greg Kroah-Hartman authored
      When calling debugfs functions, there is no need to ever check the
      return value.  The function can work or not, but the code logic should
      never do something different based on this.
      
      Because we don't need to save the individual debugfs files and
      directories, remove the local storage of them and just remove the entire
      debugfs directory in a single call, making things a lot simpler.
      
      Cc: Stanislaw Gruszka <sgruszka@redhat.com>
      Cc: Helmut Schaa <helmut.schaa@googlemail.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-wireless@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      1dc24406
    • Soeren Moch's avatar
      rt2x00usb: remove unnecessary rx flag checks · 3b902fa8
      Soeren Moch authored
      In contrast to the TX path, there is no need to separately read the transfer
      status from the device after receiving RX data. Consequently, there is no
      real STATUS_PENDING RX processing queue entry state.
      Remove the unnecessary ENTRY_DATA_STATUS_PENDING flag checks from the RX path.
      Also remove the misleading comment about reading RX status from device.
      Suggested-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarSoeren Moch <smoch@web.de>
      Acked-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      3b902fa8
    • Enrico Weigelt's avatar
      rsi: return explicit error values · 231e83fd
      Enrico Weigelt authored
      Explicitly return constants instead of variable (and rely on
      it to be explicitly initialized), if the value is supposed
      to be fixed anyways. Align it with the rest of the driver,
      which does it the same way.
      Signed-off-by: default avatarEnrico Weigelt <info@metux.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      231e83fd
  2. 23 Jul, 2019 29 commits
  3. 22 Jul, 2019 2 commits