From: Kalle Valo <kvalo@codeaurora.org>
To: Jia-Ju Bai <baijiaju1990@163.com>
Cc: pizza@shaftnet.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jia-Ju Bai <baijiaju1990@163.com>
Subject: Re: cw1200: Fix a sleep-in-atomic bug in cw1200_tx_confirm_cb and cw1200_cqm_bssloss_sm
Date: Thu, 1 Jun 2017 09:48:25 +0000 (UTC) [thread overview]
Message-ID: <20170601094825.02EF96074D@smtp.codeaurora.org> (raw)
In-Reply-To: <1496284574-11056-1-git-send-email-baijiaju1990@163.com>
Jia-Ju Bai <baijiaju1990@163.com> wrote:
> The driver may sleep under a spin lock, and the function call path is:
> cw1200_tx_confirm_cb (acquire the lock by spin_lock)
> __cw1200_cqm_bssloss_sm
> cancel_work_sync --> may sleep
>
> cw1200_cqm_bssloss_sm
> __cw1200_cqm_bssloss_sm
> cancel_work_sync --> may sleep
>
> To fix it, the lock is released before cancel_work_sync, and the lock
> is acquired again after this function.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
I assume that you haven't tested this on a real device and only compile tested.
You should mention that in the commit log.
Releasing a lock held by calling function is evil. Did you do any lock analysis
or are you just blindly releasing locks to fix a warning in your tool?
Also I would like to have an ack from a reviewer before I can take patches like
this.
Patch set to Changes Requested.
--
https://patchwork.kernel.org/patch/9758613/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2017-06-01 9:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 2:36 [PATCH] cw1200: Fix a sleep-in-atomic bug in cw1200_tx_confirm_cb and cw1200_cqm_bssloss_sm Jia-Ju Bai
2017-06-01 9:48 ` Kalle Valo [this message]
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=20170601094825.02EF96074D@smtp.codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=baijiaju1990@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pizza@shaftnet.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.