mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-kernel@vger.kernel.org,
	Nils Rennebarth <Nils.Rennebarth@web.de>,
	USB development list <linux-usb-devel@lists.sourceforge.net>
Subject: Re: [linux-usb-devel] Fw: X is killed when trying to suspend with USB Mouse plugged in
Date: Wed, 20 Oct 2004 01:45:27 -0500	[thread overview]
Message-ID: <200410200145.27952.dtor_core@ameritech.net> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0410191134090.1023-100000@ida.rowland.org>

On Tuesday 19 October 2004 10:35 am, Alan Stern wrote:
> On Mon, 18 Oct 2004, Dmitry Torokhov wrote:
> 
> > > I don't know about /dev/input/mouse1.  But the oops isn't a bug... it's a 
> > > weakness in the way Linux implements loadable kernel modules.
> > > 
> > 
> > Ugh, it is not module implementation weakness, it looks like refcounting
> > problem in USB.
> 
> Could you explain that more fully?  Are you talking about a particular 
> refcounting problem in the usbhid subsystem or do you mean a more 
> pervasive problem in the whole USB system?  And why do you say it's a 
> refcounting problem in the first place?
> 

I am not sure it it is HID-specific problem or a wider one but it looks
like usbhid can be unloaded while there are references to objects produced
by this module - hence refcounting problem. You either have to disallow
unloading while there are references (but this path leads to potential
deadlocks) or have a generic release function registered with the core that
pretty much always stays there. Then you can free all device-specific data
at unload time and mark the object as a zombie so anything that tries to
touch it releases it quickly and then the core routine will free skeleton
data at last.

The patch that I sent should hide the problem somewhat as at disconnect
time it will unregister corresponsing class devices thus dropping the
reference that was pinning usbhid structures.

-- 
Dmitry

      reply	other threads:[~2004-10-20  6:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20041018142745.60208c5b.akpm@osdl.org>
2004-10-18 22:48 ` Alan Stern
2004-10-19  1:12   ` Dmitry Torokhov
2004-10-19 15:35     ` Alan Stern
2004-10-20  6:45       ` Dmitry Torokhov [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=200410200145.27952.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=Nils.Rennebarth@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=stern@rowland.harvard.edu \
    /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

Powered by JetHome