Re: [linux-usb-devel] Fw: X is killed when trying to suspend withUSB Mouse plugged in

From: Alan Stern
Date: Mon Oct 18 2004 - 17:51:37 EST


On Mon, 18 Oct 2004, Andrew Morton wrote:

> Begin forwarded message:
>
> Date: Mon, 18 Oct 2004 20:55:16 +0200
> From: Nils Rennebarth <Nils.Rennebarth@xxxxxx>
> To: linux-kernel@xxxxxxxxxxxxxxx
> Cc: Suspend development list <softwaresuspend-devel@xxxxxxxxxxxxxxxx>
> Subject: X is killed when trying to suspend with USB Mouse plugged in
>
>
> Hi,
>
> When I try to suspend 2.6.9-rc[1-4] when X is runnning and my USB Mouse
> is plugged in, I get an Ooops. X is killed and the suspend as well.
>
> Attached is the oops with 2.6.9-rc4
> The oops comes at the moment, that uhci_hcd is removed. If I do not
> remove that module, suspend does work but the laptop hangs hard during
> resume.
>
> That only happens if I use /dev/input/mouse1 as input device for the
> mouse. With /dev/input/mice I can suspend and resume successfully.
>
> So is using /dev/input/mouse1 something I shouldn't have done in the
> first place (came from some experimentation when trying to use the
> synaptics driver for my alps touchpad) or does it point to a bug in the
> uhci driver? Or a bug in X?

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.

What your log showed was that some program was still using a USB device at
the time uhci-hcd was unloaded. There's nothing illegal or wrong about
that, but the unload procedure doesn't wait for the reference count to
drop to zero -- the module is unloaded from memory right away. Then some
time later on, when that other program finished using the device and the
reference count did go to zero, the system tried to call a release routine
in the unloaded module. The result was an oops, as you saw.

Alan Stern


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/