netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mmc: core: Fix Marvell WiFi reset by adding SDIO API to replug card
@ 2019-07-16 16:42 Douglas Anderson
  2019-07-16 16:42 ` [PATCH 1/2] mmc: core: Add sdio_trigger_replug() API Douglas Anderson
  2019-07-16 16:42 ` [PATCH 2/2] mwifiex: Make use of the new sdio_trigger_replug() API to reset Douglas Anderson
  0 siblings, 2 replies; 5+ messages in thread
From: Douglas Anderson @ 2019-07-16 16:42 UTC (permalink / raw)
  To: Ulf Hansson, Kalle Valo, Adrian Hunter
  Cc: Ganapathi Bhat, linux-wireless, Brian Norris, Amitkumar Karwar,
	linux-rockchip, Wolfram Sang, Nishant Sarmukadam, netdev,
	Avri Altman, linux-mmc, davem, Xinming Hu, Douglas Anderson,
	Jiong Wu, Ritesh Harjani, linux-kernel, Thomas Gleixner,
	Greg Kroah-Hartman, Niklas Söderlund

As talked about in the thread at:

http://lkml.kernel.org/r/CAD=FV=X7P2F1k_zwHc0mbtfk55-rucTz_GoDH=PL6zWqKYcpuw@mail.gmail.com

...when the Marvell WiFi card tries to reset itself it kills
Bluetooth.  It was observed that we could re-init the card properly by
unbinding / rebinding the host controller.  It was also observed that
in the downstream Chrome OS codebase the solution used was
mmc_remove_host() / mmc_add_host(), which is similar to the solution
in this series.

So far I've only done testing of this series using the reset test
source that can be simulated via sysfs.  Specifically I ran this test:

for i in $(seq 1000); do
  echo "LOOP $i --------"
  echo 1 > /sys/kernel/debug/mwifiex/mlan0/reset

  while true; do
    if ! ping -w15 -c1 "${GW}" >/dev/null 2>&1; then
      fail=$(( fail + 1 ))
      echo "Fail WiFi ${fail}"
      if [[ ${fail} == 3 ]]; then
        exit 1
      fi
    else
      fail=0
      break
    fi
  done

  hciconfig hci0 down
  sleep 1
  if ! hciconfig hci0 up; then
    echo "Fail BT"
    exit 1
  fi
done

I ran this several times and got several hundred iterations each
before a failure.  When I saw failures:

* Once I saw a "Fail BT"; manually resetting the card again fixed it.
  I didn't give it time to see if it would have detected this
  automatically.
* Once I saw the ping fail because (for some reason) my device only
  got an IPv6 address from my router and the IPv4 ping failed.  I
  changed my script to use 'ping6' to see if that would help.
* Once I saw the ping fail because the higher level network stack
  ("shill" in my case) seemed to crash.  A few minutes later the
  system recovered itself automatically.  https://crbug.com/984593 if
  you want more details.
* Sometimes while I was testing I saw "Fail WiFi 1" indicating a
  transitory failure.  Usually this was an association failure, but in
  one case I saw the device do "Firmware wakeup failed" after I
  triggered the reset.  This caused the driver to trigger a re-reset
  of itself which eventually recovered things.  This was good because
  it was an actual test of the normal reset flow (not the one
  triggered via sysfs).


Douglas Anderson (2):
  mmc: core: Add sdio_trigger_replug() API
  mwifiex: Make use of the new sdio_trigger_replug() API to reset

 drivers/mmc/core/core.c                     | 28 +++++++++++++++++++--
 drivers/mmc/core/sdio_io.c                  | 20 +++++++++++++++
 drivers/net/wireless/marvell/mwifiex/sdio.c | 14 +++--------
 include/linux/mmc/host.h                    | 15 ++++++++++-
 include/linux/mmc/sdio_func.h               |  2 ++
 5 files changed, 65 insertions(+), 14 deletions(-)

-- 
2.22.0.510.g264f2c817a-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-22 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 16:42 [PATCH 0/2] mmc: core: Fix Marvell WiFi reset by adding SDIO API to replug card Douglas Anderson
2019-07-16 16:42 ` [PATCH 1/2] mmc: core: Add sdio_trigger_replug() API Douglas Anderson
2019-07-22 19:35   ` Matthias Kaehlcke
2019-07-16 16:42 ` [PATCH 2/2] mwifiex: Make use of the new sdio_trigger_replug() API to reset Douglas Anderson
2019-07-19 23:36   ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).