1. 08 Feb, 2017 6 commits
    • Stanislaw Gruszka's avatar
      rt2x00usb: fix anchor initialization · 0488a612
      Stanislaw Gruszka authored
      If device fail to initialize we can OOPS in rt2x00lib_remove_dev(), due
      to using uninitialized usb_anchor structure:
      
      [  855.435820] ieee80211 phy3: rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x1000 with error -19
      [  855.435826] ieee80211 phy3: rt2800_probe_rt: Error - Invalid RT chipset 0x0000, rev 0000 detected
      [  855.435829] ieee80211 phy3: rt2x00lib_probe_dev: Error - Failed to allocate device
      [  855.435845] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
      [  855.435900] IP: _raw_spin_lock_irq+0xd/0x30
      [  855.435926] PGD 0
      [  855.435953] Oops: 0002 [#1] SMP
      <snip>
      [  855.437011] Call Trace:
      [  855.437029]  ? usb_kill_anchored_urbs+0x27/0xc0
      [  855.437061]  rt2x00lib_remove_dev+0x190/0x1c0 [rt2x00lib]
      [  855.437097]  rt2x00lib_probe_dev+0x246/0x7a0 [rt2x00lib]
      [  855.437149]  ? ieee80211_roc_setup+0x9e/0xd0 [mac80211]
      [  855.437183]  ? __kmalloc+0x1af/0x1f0
      [  855.437207]  ? rt2x00usb_probe+0x13d/0xc50 [rt2x00usb]
      [  855.437240]  rt2x00usb_probe+0x155/0xc50 [rt2x00usb]
      [  855.437273]  rt2800usb_probe+0x15/0x20 [rt2800usb]
      [  855.437304]  usb_probe_interface+0x159/0x2d0
      [  855.437333]  driver_probe_device+0x2bb/0x460
      
      Patch changes initialization sequence to fix the problem.
      
      Cc: Vishal Thanki <vishalthanki@gmail.com>
      Fixes: 8b4c0009 ("rt2x00usb: Use usb anchor to manage URB")
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      0488a612
    • Stanislaw Gruszka's avatar
      rt2x00usb: do not anchor rx and tx urb's · 93c7018e
      Stanislaw Gruszka authored
      We might kill TX or RX urb during rt2x00usb_flush_entry(), what can
      cause anchor list corruption like shown below:
      
      [ 2074.035633] WARNING: CPU: 2 PID: 14480 at lib/list_debug.c:33 __list_add+0xac/0xc0
      [ 2074.035634] list_add corruption. prev->next should be next (ffff88020f362c28), but was dead000000000100. (prev=ffff8801d161bb70).
      <snip>
      [ 2074.035670] Call Trace:
      [ 2074.035672]  [<ffffffff813bde47>] dump_stack+0x63/0x8c
      [ 2074.035674]  [<ffffffff810a2231>] __warn+0xd1/0xf0
      [ 2074.035676]  [<ffffffff810a22af>] warn_slowpath_fmt+0x5f/0x80
      [ 2074.035678]  [<ffffffffa073855d>] ? rt2x00usb_register_write_lock+0x3d/0x60 [rt2800usb]
      [ 2074.035679]  [<ffffffff813dbe4c>] __list_add+0xac/0xc0
      [ 2074.035681]  [<ffffffff81591c6c>] usb_anchor_urb+0x4c/0xa0
      [ 2074.035683]  [<ffffffffa07322af>] rt2x00usb_kick_rx_entry+0xaf/0x100 [rt2x00usb]
      [ 2074.035684]  [<ffffffffa0732322>] rt2x00usb_clear_entry+0x22/0x30 [rt2x00usb]
      
      To fix do not anchor TX and RX urb's, it is not needed as during
      shutdown we kill those urbs in rt2x00usb_free_entries().
      
      Cc: Vishal Thanki <vishalthanki@gmail.com>
      Fixes: 8b4c0009 ("rt2x00usb: Use usb anchor to manage URB")
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      93c7018e
    • Larry Finger's avatar
      rtlwifi: Move items out of rtl_pci_priv and rtl_usb_priv · d5efe153
      Larry Finger authored
      In commit 6773386f ("rtlwifi: rtl8192c-common: Fix "BUG: KASAN:"),
      a BUG detected when CONFIG_KASAN=y was fixed by reordering the layouts
      of struct rtl_pci_priv, and struct rtl_usb_priv so that the variables
      used by both PCI and USB drivers have the same offsets in both structs.
      The better fix of relocating the critical variables into struct rtl_priv
      was deferred as these changes do not have to be applied to stable
      kernels.
      
      This change also removes CamelCase variables with pLed0 => pled0.
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      d5efe153
    • Rafał Miłecki's avatar
      brcmfmac: merge two remaining brcmf_err macros · d0630555
      Rafał Miłecki authored
      Now we always have __brcmf_err function we can do perfectly fine with
      just one macro.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      d0630555
    • Rafał Miłecki's avatar
      brcmfmac: switch to C function (__brcmf_err) for printing errors · 087fa712
      Rafał Miłecki authored
      This will allow extending code and using more detailed messages e.g.
      with the help of dev_err.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      087fa712
    • Rafał Miłecki's avatar
      brcmfmac: merge two brcmf_err macros into one · 9587a01a
      Rafał Miłecki authored
      This allows simplifying the code by adding a simple IS_ENABLED check for
      CONFIG_BRCMDB symbol.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9587a01a
  2. 07 Feb, 2017 24 commits
  3. 06 Feb, 2017 10 commits