1. 28 7月, 2017 1 次提交
  2. 31 5月, 2017 1 次提交
  3. 18 5月, 2017 1 次提交
  4. 13 4月, 2017 1 次提交
  5. 05 4月, 2017 1 次提交
    • B
      mwifiex: catch mwifiex_fw_dpc() errors properly in reset · 755b37c9
      Brian Norris 提交于
      When resetting the device, we take a synchronous firmware-loading code
      path, which borrows a lot from the asynchronous path used at probe time.
      We don't catch errors correctly though, which means that in the PCIe
      driver, we may try to dereference the 'adapter' struct after
      mwifiex_fw_dpc() has freed it. See this (erronous) print in
      mwifiex_pcie_reset_notify():
      
      	mwifiex_dbg(adapter, INFO, "%s, successful\n", __func__);
      
      Let's instead refactor the synchronous (or "!req_fw_nowait") path so
      that we propagate errors and handle them properly.
      
      This fixes a use-after-free issue in the PCIe driver, as well as a
      misleading debug message ("successful"). It looks like the SDIO driver
      doesn't have these problems, since it doesn't do anything after
      mwifiex_reinit_sw().
      
      Fixes: 4c5dae59 ("mwifiex: add PCIe function level reset support")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      755b37c9
  6. 21 3月, 2017 2 次提交
    • B
      mwifiex: fix kernel crash after shutdown command timeout · 5caa7f38
      Brian Norris 提交于
      We observed a SHUTDOWN command timeout during reboot stress test due to
      a corner case firmware bug. It can lead to either a use-after-free +
      OOPS (on either the adapter structure, or the 'card' structure) or an
      abort (where, e.g., the PCI device is "disabled" before we're done
      dumping the FW).
      
      We can avoid this by canceling/flushing the FW dump work:
      
      (a) after we've terminated all other work queues (e.g., for processing
          commands which could time out)
      (b) after we've disabled all interrupts (which could also queue more
          work for us)
      (c) after we've unregistered the netdev and wiphy structures (and
          implicitly, and debugfs entries which could manually trigger FW dumps)
      (d) before we've actually disabled the device (e.g.,
          pci_device_disable())
      
      Altogether, this means no card->work will be scheduled if we sync at
      a point that satisfies the above. This can be done at the beginning of
      the .cleanup_if() callback.
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      5caa7f38
    • D
      mwifiex: fix for unaligned reads · 92c70a95
      Devidas Puranik 提交于
      Using the accessor function e.g. get_unaligned_le32 instead of
      le32_to_cpu to avoid the unaligned access. This is for the
      architectures that don't handle the unaligned memory access
      Signed-off-by: NDevidas Puranik <devidas@marvell.com>
      Signed-off-by: NGanapathi Bhat <gbhat@marvell.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      92c70a95
  7. 12 1月, 2017 8 次提交
  8. 30 12月, 2016 1 次提交
  9. 29 11月, 2016 2 次提交
    • K
      mwifiex: Removed unused 'pkt_type' variable · 67dd2a75
      Kirtika Ruchandani 提交于
      Commit 92263a84 introduced mwifiex_deaggr_sdio_pkt which initializes
      variable pkt_type but does not use it. Compiling with W=1 gives the following
      warning, fix it.
      mwifiex/sdio.c: In function ‘mwifiex_deaggr_sdio_pkt’:
      mwifiex/sdio.c:1198:6: warning: variable ‘pkt_type’ set but not used [-Wunused-but-set-variable]
      
      Fixes: 92263a84 ("mwifiex: add SDIO rx single port aggregation")
      Cc: Zhaoyang Liu <liuzy@marvell.com>
      Cc: Amitkumar Karwar <akarwar@marvell.com>
      Signed-off-by: NKirtika Ruchandani <kirtika@google.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      67dd2a75
    • K
      mwifiex: Remove unused 'pm_flag' variable · e9f1db8b
      Kirtika Ruchandani 提交于
      mwifiex_sdio_resume() intializes pm_flag, just like
      mwifiex_sdio_suspend(), but does not use it. Compiling with W=1 gives
      the following warning, fix it.
      mwifiex/sdio.c: In function ‘mwifiex_sdio_resume’:
      mwifiex/sdio.c:234:16: warning: variable ‘pm_flag’ set but not used [-Wunused-but-set-variable]
      
      sdio_get_host_pm_caps() is just an acessor, so the call to it is safe
      to remove. The unused variable seems to be present since
      5e6e3a92 which introduced mwifiex_sdio_resume().
      
      Fixes: 5e6e3a92 ("wireless: mwifiex: initial commit for Marvell mwifiex driver")
      Cc: Bing Zhao <bzhao@marvell.com>
      Cc: Amitkumar Karwar <akarwar@marvell.com>
      Signed-off-by: NKirtika Ruchandani <kirtika@google.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      e9f1db8b
  10. 25 11月, 2016 1 次提交
  11. 19 11月, 2016 7 次提交
  12. 18 11月, 2016 1 次提交
    • B
      mwifiex: don't do unbalanced free()'ing in cleanup_if() · 66b9c182
      Brian Norris 提交于
      The cleanup_if() callback is the inverse of init_if(). We allocate our
      'card' interface structure in the probe() function, but we free it in
      cleanup_if(). That gives a few problems:
      (a) we leak this memory if probe() fails before we reach init_if()
      (b) we can't safely utilize 'card' after cleanup_if() -- namely, in
          remove() or suspend(), both of which might race with the cleanup
          paths in our asynchronous FW initialization path
      
      Solution: just use devm_kzalloc(), which will free this structure
      properly when the device is removed -- and drop the set_drvdata(...,
      NULL), since the driver core does this for us. This also removes the
      temptation to use drvdata == NULL as a hack for checking if the device
      has been "cleaned up."
      
      I *do* leave the set_drvdata(..., NULL) for the hacky SDIO
      mwifiex_recreate_adapter(), since the device core won't be able to clear
      that one for us.
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      66b9c182
  13. 17 11月, 2016 1 次提交
  14. 15 9月, 2016 1 次提交
  15. 09 9月, 2016 1 次提交
  16. 18 6月, 2016 1 次提交
    • A
      mwifiex: fix link error against sdio · 2095b142
      Arnd Bergmann 提交于
      Calling sdio_claim_host() from the interface independent part of
      the mwifiex driver is not only a layering violation, but also causes
      a link error if MMC support is disabled, or if CONFIG_MMC=m
      and CONFIG_MWIFIEX=y:
      
      drivers/net/built-in.o: In function `mwifiex_fw_dpc':
      :(.text+0xff138): undefined reference to `sdio_claim_host'
      :(.text+0xff158): undefined reference to `sdio_release_host'
      
      The right way to do this is to have the sdio specific code in the
      sdio driver front-end, and we already have a callback pointer that
      we can use for this after exporting the generic fw download
      function from the core driver.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 65c71efe ("mwifiex: fix racing condition when downloading firmware")
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      2095b142
  17. 16 6月, 2016 8 次提交
  18. 14 6月, 2016 1 次提交