linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hesse, Christian" <mail@earthworm.de>
To: Pavel Roskin <proski@gnu.org>
Cc: James Ketrenos <jketreno@linux.intel.com>,
	linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net
Subject: Re: [ANNOUNCE] d80211 based driver for Intel PRO/Wireless 3945ABG
Date: Tue, 13 Feb 2007 11:41:20 +0100	[thread overview]
Message-ID: <200702131141.25883.mail@earthworm.de> (raw)
In-Reply-To: <1171349229.2326.91.camel@dv>

[-- Attachment #1: Type: text/plain, Size: 2094 bytes --]

On Tuesday 13 February 2007 07:47, Pavel Roskin wrote:
> Hello!
>
> On Sun, 2007-02-11 at 14:17 +0100, Hesse, Christian wrote:
> > lsmod shows a use count of 4294967295 (2^32 - 1), no oopses or the like.
> > This is reproducable all the time.
>
> Although I cannot reproduce the problem (I'm on current wireless-dev),
> here's my interpretation.
>
> The iwlwifi driver includes both a driver and a rate control algorithm.
> It passes THIS_MODULE (i.e. a handle to itself) to the generic rate
> control code, which locks the caller i.e. iwlwifi.  Therefore, iwlwifi
> has locked itself in memory.
>
> To counteract that, the driver "puts" the module, i.e. decreases its use
> count after the rate control is registered.  Conversely, the module
> "gets" itself when the rate control is unregistered.
>
> One thing that is clearly wrong is that try_module_get() comes after
> ieee80211_rate_control_unregister(), not before.  This means that the
> use count would go negative between those calls.  If the kernel starts
> checking for this, the driver is in trouble.
>
> Further, why do we need this self-locking/unlocking trick?  The driver
> can just set priv->rate_control.module to NULL and prevent self-locking.
>
> It would only make sense to put THIS_MODULE there is the rate control
> were implemented as a separate module, which it probably a good idea in
> the long term.
>
> But a simple fix would be just to get rid of all references to
> THIS_MODULE and let the kernel do the right thing.
>
> Most likely, your kernel doesn't use the priv->rate_control.module field
> to lock the module, so it would help in your case.
>
> Please try this patch:
>
> [ patch snipped ]

This patch solves the problem. The module's use count is zero and I can unload 
and load the module.
However I have processes in status D when restarting the device. Is it 
possible that some functions (i.e. escape_essid()) from old and new ieee80211 
stack conflict? I will recompile my kernel without the old stack and see if 
anything changes.
-- 
Regards,
Chris

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-02-13 10:41 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 21:12 [ANNOUNCE] d80211 based driver for Intel PRO/Wireless 3945ABG James Ketrenos
2007-02-09 22:14 ` Alon Bar-Lev
2007-02-09 22:26 ` Neil Brown
2007-02-09 21:52   ` James Ketrenos
2007-02-10  3:26     ` Nick Kossifidis
2007-02-09 22:37   ` Stefan Schmidt
2007-02-09 22:43 ` Pavel Roskin
2007-02-09 22:18   ` James Ketrenos
2007-02-09 23:17     ` Pavel Roskin
2007-02-09 22:45       ` James Ketrenos
2007-02-10  0:46 ` [ipw3945-devel] " Norbert Preining
2007-02-13 23:23   ` James Ketrenos
2007-02-10 13:23 ` Hesse, Christian
2007-02-10 14:25   ` Hesse, Christian
2007-02-12 16:32     ` [ipw3945-devel] " dragoran
2007-02-12 18:35     ` James Ketrenos
2007-02-13 12:18       ` Hesse, Christian
2007-02-11  0:55   ` Pavel Roskin
2007-02-11 13:17     ` Hesse, Christian
2007-02-13  6:47       ` Pavel Roskin
2007-02-13 10:41         ` Hesse, Christian [this message]
2007-02-11 13:19   ` Johannes Berg
2007-02-10 16:22 ` Theodore Tso
2007-02-10 16:39   ` John W. Linville
2007-02-10 17:53     ` [ipw3945-devel] " Pavel Roskin
2007-02-10 22:41       ` John W. Linville
2007-02-10 18:42   ` Michael Buesch
2007-02-13 13:58 ` Ismail Dönmez
2007-02-13 15:10   ` Jeff Chua
2007-02-13 16:57     ` Ismail Dönmez
2007-02-13 22:55       ` James Ketrenos
2007-02-13 18:13 ` Pavel Machek
2007-02-13 18:36   ` Johannes Berg
2007-02-13 23:18     ` James Ketrenos
2007-02-14  0:16   ` [ipw3945-devel] " James Ketrenos
2007-02-19 22:44     ` Pavel Machek
2007-02-21  6:23       ` iwlwifi warnings Stephen Hemminger
2007-02-21  7:32         ` Randy Dunlap
2007-02-21 19:38         ` Pavel Machek
2007-02-23  5:44           ` Pavel Roskin

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=200702131141.25883.mail@earthworm.de \
    --to=mail@earthworm.de \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=jketreno@linux.intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=proski@gnu.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 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).