All of lore.kernel.org
 help / color / mirror / Atom feed
From: wyang1 <Wei.Yang@windriver.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>, <wei.wyang@windriver.com>
Subject: Re: [PATCH] mac80211: refine ieee80211_rx() context requirement
Date: Wed, 8 May 2013 16:47:43 +0800	[thread overview]
Message-ID: <518A112F.3070903@windriver.com> (raw)
In-Reply-To: <1368002236.8279.15.camel@jlt4.sipsolutions.net>

On 05/08/2013 04:37 PM, Johannes Berg wrote:
> On Wed, 2013-05-08 at 10:36 +0200, Johannes Berg wrote:
>> On Wed, 2013-05-08 at 16:31 +0800, Wei.Yang@windriver.com wrote:
>>> From: Wei Yang <Wei.Yang@windriver.com>
>>>
>>> In case of RT kernel, the return value of softirq_count() always
>>> equal to 0, we need to use in_serving_softirq to decide whether
>>> the current context is in softirq context.
>>> -	WARN_ON_ONCE(softirq_count() == 0);
>>> +	WARN_ON_ONCE(!in_serving_softirq());
>> As I understand the code, I don't believe this change to be correct. The
>> function can happily run with softirqs disabled (e.g.
>> local_bh_disable()), for example by being called via ieee80211_rx_ni().
>> As I understand in_serving_softirq(), it checks that it's actually
>> inside handling a softirq, no?
> Arguably, it should be
> 	WARN_ON_ONCE(!in_softirq());
>
> but that's equivalent:

Yeah, but the softirq is threaded in rt kernel, the softirq_count always 
return 0. The warning should always happen with rt kernel.

Wei
>
> include/linux/hardirq.h
>
>   * in_softirq - Are we currently processing softirq or have bh disabled?
>
>   #define in_softirq()           (softirq_count())
>
> johannes
>
>
>


  reply	other threads:[~2013-05-08  8:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-08  8:31 [PATCH] mac80211: refine ieee80211_rx() context requirement Wei.Yang
2013-05-08  8:36 ` Johannes Berg
2013-05-08  8:37   ` Johannes Berg
2013-05-08  8:47     ` wyang1 [this message]
2013-05-08  8:57       ` Johannes Berg
2013-05-08  8:44   ` wyang1

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=518A112F.3070903@windriver.com \
    --to=wei.yang@windriver.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wei.wyang@windriver.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 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.