1. 19 2月, 2019 3 次提交
  2. 08 2月, 2019 5 次提交
  3. 01 2月, 2019 5 次提交
  4. 10 1月, 2019 5 次提交
    • H
      brcmfmac: Use firmware_request_nowarn for the clm_blob · 4ad0be16
      Hans de Goede 提交于
      The linux-firmware brcmfmac firmware files contain an embedded table with
      per country allowed channels and strength info.
      
      For recent hardware these versions of the firmware are specially build for
      linux-firmware, the firmware files directly available from Cypress rely on
      a separate clm_blob file for this info.
      
      For some unknown reason Cypress refuses to provide the standard firmware
      files + clm_blob files it uses elsewhere for inclusion into linux-firmware,
      instead relying on these special builds with the clm_blob info embedded.
      This means that the linux-firmware firmware versions often lag behind,
      but I digress.
      
      The brcmfmac driver does support the separate clm_blob file and always
      tries to load this. Currently we use request_firmware for this. This means
      that on any standard install, using the standard combo of linux-kernel +
      linux-firmware, we will get a warning:
      "Direct firmware load for ... failed with error -2"
      
      On top of this, brcmfmac itself prints: "no clm_blob available (err=-2),
      device may have limited channels available".
      
      This commit switches to firmware_request_nowarn, fixing almost any brcmfmac
      device logging the warning (it leaves the brcmfmac info message in place).
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      4ad0be16
    • L
      brcmfmac: fix system warning message during wowl suspend · 3a33bd84
      Lo-Hsiang Lo 提交于
      There is a system warning message, warn_slowpath-fmt, during suspend
      while using supplicant join AP and enable wowl feature by IW command.
      It's caused by brcmf_pno_remove_request path can't find the reqid.
      This fix will not go to remove pno request function if there is no
      pno scan.
      Acked-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: NLo-Hsiang Lo <double.lo@cypress.com>
      Signed-off-by: NChi-Hsien Lin <chi-hsien.lin@cypress.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      3a33bd84
    • K
      brcmfmac: add a check for the status of usb_register · 42daad33
      Kangjie Lu 提交于
      usb_register() may fail, so let's check its status and issue an error
      message if it fails.
      Signed-off-by: NKangjie Lu <kjlu@umn.edu>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      42daad33
    • H
      brcmfmac: Add DMI nvram filename quirk for PoV TAB-P1006W-232 tablet · 4d95f99c
      Hans de Goede 提交于
      The Point of View TAB-P1006W-232 tablet contains quite generic names in
      the sys_vendor and product_name DMI strings, without this patch brcmfmac
      will try to load: brcmfmac43340-sdio.Insyde-BayTrail.txt as nvram file
      which is a bit too generic.
      
      Add a DMI quirk so that a unique and clearly identifiable nvram file
      name is used on the PoV TAB-P1006W-232 tablet.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      4d95f99c
    • Y
      brcmsmac: remove set but not used variables 'phybw40, maxtargetpwr' · 6375d403
      YueHaibing 提交于
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:1202:5: warning: variable 'phybw40' set but not used [-Wunused-but-set-variable]
      drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:4625:5: warning: variable 'phybw40' set but not used [-Wunused-but-set-variable]
      drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:4834:5: warning: variable 'phybw40' set but not used [-Wunused-but-set-variable]
      
      drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:3085:17: warning: variable 'maxtargetpwr' set but not used [-Wunused-but-set-variable]
      drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c:4215:17: warning: variable 'maxtargetpwr' set but not used [-Wunused-but-set-variable]
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      6375d403
  5. 08 1月, 2019 1 次提交
  6. 20 12月, 2018 2 次提交
  7. 13 12月, 2018 13 次提交
  8. 29 11月, 2018 6 次提交
    • L
      brcmfmac: Fix out of bounds memory access during fw load · b72c51a5
      Lyude Paul 提交于
      I ended up tracking down some rather nasty issues with f2fs (and other
      filesystem modules) constantly crashing on my kernel down to a
      combination of out of bounds memory accesses, one of which was coming
      from brcmfmac during module load:
      
      [   30.891382] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4356-sdio for chip BCM4356/2
      [   30.894437] ==================================================================
      [   30.901581] BUG: KASAN: global-out-of-bounds in brcmf_fw_alloc_request+0x42c/0x480 [brcmfmac]
      [   30.909935] Read of size 1 at addr ffff2000024865df by task kworker/6:2/387
      [   30.916805]
      [   30.918261] CPU: 6 PID: 387 Comm: kworker/6:2 Tainted: G           O      4.20.0-rc3Lyude-Test+ #19
      [   30.927251] Hardware name: amlogic khadas-vim2/khadas-vim2, BIOS 2018.07-rc2-armbian 09/11/2018
      [   30.935964] Workqueue: events brcmf_driver_register [brcmfmac]
      [   30.941641] Call trace:
      [   30.944058]  dump_backtrace+0x0/0x3e8
      [   30.947676]  show_stack+0x14/0x20
      [   30.950968]  dump_stack+0x130/0x1c4
      [   30.954406]  print_address_description+0x60/0x25c
      [   30.959066]  kasan_report+0x1b4/0x368
      [   30.962683]  __asan_report_load1_noabort+0x18/0x20
      [   30.967547]  brcmf_fw_alloc_request+0x42c/0x480 [brcmfmac]
      [   30.967639]  brcmf_sdio_probe+0x163c/0x2050 [brcmfmac]
      [   30.978035]  brcmf_ops_sdio_probe+0x598/0xa08 [brcmfmac]
      [   30.983254]  sdio_bus_probe+0x190/0x398
      [   30.983270]  really_probe+0x2a0/0xa70
      [   30.983296]  driver_probe_device+0x1b4/0x2d8
      [   30.994901]  __driver_attach+0x200/0x280
      [   30.994914]  bus_for_each_dev+0x10c/0x1a8
      [   30.994925]  driver_attach+0x38/0x50
      [   30.994935]  bus_add_driver+0x330/0x608
      [   30.994953]  driver_register+0x140/0x388
      [   31.013965]  sdio_register_driver+0x74/0xa0
      [   31.014076]  brcmf_sdio_register+0x14/0x60 [brcmfmac]
      [   31.023177]  brcmf_driver_register+0xc/0x18 [brcmfmac]
      [   31.023209]  process_one_work+0x654/0x1080
      [   31.032266]  worker_thread+0x4f0/0x1308
      [   31.032286]  kthread+0x2a8/0x320
      [   31.039254]  ret_from_fork+0x10/0x1c
      [   31.039269]
      [   31.044226] The buggy address belongs to the variable:
      [   31.044351]  brcmf_firmware_path+0x11f/0xfffffffffffd3b40 [brcmfmac]
      [   31.055601]
      [   31.057031] Memory state around the buggy address:
      [   31.061800]  ffff200002486480: 04 fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
      [   31.068983]  ffff200002486500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [   31.068993] >ffff200002486580: 00 00 00 00 00 00 00 00 fa fa fa fa 00 00 00 00
      [   31.068999]                                                     ^
      [   31.069017]  ffff200002486600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [   31.096521]  ffff200002486680: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
      [   31.096528] ==================================================================
      [   31.096533] Disabling lock debugging due to kernel taint
      
      It appears that when trying to determine the length of the string in the
      alternate firmware path, we make the mistake of not handling the case
      where the firmware path is empty correctly. Since strlen(mp_path) can
      return 0, we'll end up accessing mp_path[-1] when the firmware_path
      isn't provided through the module arguments.
      
      So, fix this by just setting the end char to '\0' by default, and only
      changing it if we have a non-zero length. Additionally, use strnlen()
      with BRCMF_FW_ALTPATH_LEN instead of strlen() just to be extra safe.
      
      Fixes: 2baa3aae ("brcmfmac: introduce brcmf_fw_alloc_request() function")
      Cc: Hante Meuleman <hante.meuleman@broadcom.com>
      Cc: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
      Cc: Franky Lin <franky.lin@broadcom.com>
      Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: Arend Van Spriel <arend.vanspriel@broadcom.com>
      Cc: Himanshu Jha <himanshujha199640@gmail.com>
      Cc: Dan Haab <dhaab@luxul.com>
      Cc: Jia-Shyr Chuang <saint.chuang@cypress.com>
      Cc: Ian Molton <ian@mnementh.co.uk>
      Cc: <stable@vger.kernel.org> # v4.17+
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      b72c51a5
    • H
      brcmfmac: Call brcmf_dmi_probe before brcmf_of_probe · 554da386
      Hans de Goede 提交于
      ARM systems with UEFI may have both devicetree (of) and DMI data in this
      case we end up setting brcmf_mp_device.board_type twice.
      
      In this case we should prefer the devicetree data, because:
      1) The devicerree data is more reliable
      2) Some ARM systems (e.g. the Raspberry Pi 3 models) support both UEFI and
         classic uboot booting, the devicetree data is always there, so using it
         makes sure we ask for the same nvram file independent of how we booted.
      
      This commit moves the brcmf_dmi_probe call to before the brcmf_of_probe
      call, so that the latter can override the value of the first if both are
      set.
      
      Fixes: bd1e82bb ("brcmfmac: Set board_type from DMI on x86 based ...")
      Cc: Peter Robinson <pbrobinson@gmail.com>
      Tested-and-reported-by: NPeter Robinson <pbrobinson@gmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      554da386
    • D
      brcmfmac: support STA info struct v7 · 4282ff17
      Dan Haab 提交于
      The newest firmwares provide STA info using v7 of the struct. As v7
      isn't backward compatible, a union is needed.
      
      Even though brcmfmac does not use any of the new info it's important to
      provide the proper struct buffer. Without this change new firmwares will
      fallback to the very limited v3 instead of something in between such as
      v4.
      Signed-off-by: NDan Haab <dan.haab@luxul.com>
      Reviewed-by: NRafał Miłecki <rafal@milecki.pl>
      Reviewed-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      4282ff17
    • P
      b43: Use cordic algorithm from kernel library · d5a43355
      Priit Laes 提交于
      Kernel library has a common cordic algorithm which is identical
      to internally implemented one, so use it and drop the duplicate
      implementation.
      Acked-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NPriit Laes <plaes@plaes.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      d5a43355
    • L
      b43: Fix error in cordic routine · 8ea3819c
      Larry Finger 提交于
      The cordic routine for calculating sines and cosines that was added in
      commit 6f98e62a ("b43: update cordic code to match current specs")
      contains an error whereby a quantity declared u32 can in fact go negative.
      
      This problem was detected by Priit Laes who is switching b43 to use the
      routine in the library functions of the kernel.
      
      Fixes: 98650454 ("b43: make cordic common (LP-PHY and N-PHY need it)")
      Reported-by: NPriit Laes <plaes@plaes.org>
      Cc: Rafał Miłecki <zajec5@gmail.com>
      Cc: Stable <stable@vger.kernel.org> # 2.6.34
      Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NPriit Laes <plaes@plaes.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      8ea3819c
    • P
      brcmsmac: Use cordic-related macros from common cordic library · ea3edda9
      Priit Laes 提交于
      Current driver includes macro that is available from general cordic
      library. Use that and drop unused duplicate and unneeded internal
      definitions.
      Signed-off-by: NPriit Laes <plaes@plaes.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      ea3edda9