From: Masami Hiramatsu <mhiramat@kernel.org>
To: "Arend van Spriel" <arend.vanspriel@broadcom.com>,
"Franky Lin" <franky.lin@broadcom.com>,
"Hante Meuleman" <hante.meuleman@broadcom.com>,
"Kalle Valo" <kvalo@codeaurora.org>,
"Pieter-Paul Giesberts" <pieterpg@broadcom.com>,
"Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
brcm80211-dev-list.pdl@broadcom.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [BUGFIX PATCH 0/2] Bugfixes for brcmfmac
Date: Mon, 15 Aug 2016 18:40:41 +0900 [thread overview]
Message-ID: <147125403645.9434.8008546579326856373.stgit@devbox> (raw)
Hi,
Here are 2 patches for fixing bugs which I recently faced on my PC.
There are 2 bugs I've hit on brcmfmac, one issue was critical,
the other was just found when I investigated the first issue.
1) when I shutdown or reboot my pc with wifi, it always stopped
when disabling networking. I tried to just disable wifi and saw
task hung up messages on dmesg.
All those taskes were blocked on rtnl_lock according to the
stacktrace, and found a suspicious task in the list. Actually
the wpa_supplicant is blocked while stopping the interface.
2) I also tried to get more information about that and enabled
DEBUG_ATOMIC_SLEEP and got another warning in brcmfmac. That
warned a mutex (which can yeild/sleep) is held in !TASK_RUNNING
state. I've found a mutex is held when in wait_event_timeout()
condition parameter.
I traced the source code and found that #1 was caused by double
locking of rtnl_lock in brcmfmac driver, because it doesn't
check the rtnl_lock is already held in a path (actually, other
paths checked that). So I fixed it by checking rtnl_locked and
skip locking rtnl_lock. It works, but not seems the best way
to fix, since original code (rtnl_lock locking around
cfg80211_unregister_wdev) itself looks add-hoc. Anyway, since
I don't have any knowladge of this subsystem, I'd like to ask
maintainer's help.
To fix #2 issue, I've checked the mutex (vif_event_lock) in
struct brcmf_cfg80211_vif_event just protect updating other
members and can be replaced by a spinlock because in the
protected regions are not involving any scheduler related
code.
Thank you,
---
Masami Hiramatsu (2):
brcmfmac: Check rtnl_lock is locked when removing interface
brcmfmac: Change vif_event_lock to spinlock
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 26 ++++++++++----------
.../broadcom/brcm80211/brcmfmac/cfg80211.h | 2 +-
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +-
.../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 8 ++++--
.../net/wireless/broadcom/brcm80211/brcmfmac/p2p.h | 2 +-
5 files changed, 21 insertions(+), 19 deletions(-)
--
Masami Hiramatsu <mhiramat@kernel.org>
next reply other threads:[~2016-08-15 9:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 9:40 Masami Hiramatsu [this message]
2016-08-15 9:40 ` [BUGFIX PATCH 1/2] brcmfmac: Check rtnl_lock is locked when removing interface Masami Hiramatsu
2016-08-15 10:41 ` Rafał Miłecki
2016-08-15 10:57 ` Kalle Valo
2016-08-15 11:52 ` Rafał Miłecki
2016-08-15 21:44 ` Arend Van Spriel
2016-08-16 2:27 ` Masami Hiramatsu
2016-08-24 13:14 ` [BUGFIX, " Kalle Valo
2016-08-15 9:41 ` [BUGFIX PATCH 2/2] brcmfmac: Change vif_event_lock to spinlock Masami Hiramatsu
2016-08-15 21:46 ` Arend Van Spriel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=147125403645.9434.8008546579326856373.stgit@devbox \
--to=mhiramat@kernel.org \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list.pdl@broadcom.com \
--cc=franky.lin@broadcom.com \
--cc=hante.meuleman@broadcom.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pieterpg@broadcom.com \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).