All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Benjamin Beichler <benjamin.beichler@uni-rostock.de>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v2 1/5] mac80211_hwsim: wait for deferred radio deletion on mod unload
Date: Mon, 11 Dec 2017 12:46:11 +0100	[thread overview]
Message-ID: <1512992771.26976.73.camel@sipsolutions.net> (raw)
In-Reply-To: <3a182eff-3f00-49bb-94ac-ec371ff1c26e@MAIL2.uni-rostock.de>

On Tue, 2017-11-21 at 13:17 +0100, Benjamin Beichler wrote:
> 
> +	/*wait for radios with deferred delete*/

please add spaces there

> +	spin_lock_bh(&hwsim_delete_lock);
> +	while (!list_empty(&delete_radios)) {
> +		pr_debug("mac80211_hwsim: wait for deferred radio remove\n");
> +		spin_unlock_bh(&hwsim_delete_lock);
> +		flush_work(&list_entry(&delete_radios,
> +				       struct mac80211_hwsim_data, list)
> +			   ->destroy_work);

This can't possibly be right ... you're locking the list_empty which is
a trivial pointer comparison, but not the actual list_entry() ...

I'd also prefer you actually didn't leave the problem in part as you
describe - and a new workqueue probably isn't that much overhead and
should introduce *less* new code than this, so IMHO that's worth it.

johannes

  reply	other threads:[~2017-12-11 11:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171121121744.23422-1-benjamin.beichler@uni-rostock.de>
2017-11-21 12:17 ` [PATCH v2 1/5] mac80211_hwsim: wait for deferred radio deletion on mod unload Benjamin Beichler
2017-12-11 11:46   ` Johannes Berg [this message]
2017-12-11 12:54     ` Benjamin Beichler
2017-12-11 12:57       ` Johannes Berg
2017-12-11 13:07         ` Benjamin Beichler
2017-11-21 12:17 ` [PATCH v2 2/5] mac80211_hwsim: add hashtable with mac address keys for faster lookup Benjamin Beichler
2017-11-21 12:17 ` [PATCH v2 3/5] mac80211_hwsim: add generation count for netlink dump operation Benjamin Beichler
2017-12-11 12:14   ` Johannes Berg
2017-12-11 12:37     ` Benjamin Beichler
2017-12-11 12:49       ` Johannes Berg
2017-12-11 13:02         ` Benjamin Beichler
2017-12-11 13:07           ` Johannes Berg
2017-12-11 13:29             ` Benjamin Beichler
2017-12-11 13:59               ` Johannes Berg
2017-11-21 12:17 ` [PATCH v2 4/5] mac80211_hwsim: add permanent mac address option for new radios Benjamin Beichler
2017-12-11 12:16   ` Johannes Berg
2017-11-21 12:17 ` [PATCH v2 5/5] mac80211_hwsim: add hwsim_tx_rate_flags to netlink attributes Benjamin Beichler

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=1512992771.26976.73.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=benjamin.beichler@uni-rostock.de \
    --cc=linux-wireless@vger.kernel.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.