2004-10-05 12:50:04

by Herbert Xu

[permalink] [raw]
Subject: [HID] Fix hiddev devfs oops

Hi:

There is a long-standing devfs_unregister oops in hid/hiddev. It's
caused by hid calling hiddev_exit before unregistering itself which
in turn calls hiddev_disconnect.

hiddev_exit removes the directory which contains the hiddev devices.
Therefore it needs to be called after the hiddev devices have been
disconnected.

This patch fixes that.

Signed-off-by: Herbert Xu <[email protected]>

Marcelo, the same fix is needed in 2.4 as well.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Attachments:
(No filename) (674.00 B)
p-2.6 (344.00 B)
p-2.4 (326.00 B)
Download all attachments

2004-10-12 14:26:54

by Marcelo Tosatti

[permalink] [raw]
Subject: Re: [HID] Fix hiddev devfs oops

On Tue, Oct 05, 2004 at 10:49:14PM +1000, Herbert Xu wrote:
> Hi:
>
> There is a long-standing devfs_unregister oops in hid/hiddev. It's
> caused by hid calling hiddev_exit before unregistering itself which
> in turn calls hiddev_disconnect.
>
> hiddev_exit removes the directory which contains the hiddev devices.
> Therefore it needs to be called after the hiddev devices have been
> disconnected.
>
> This patch fixes that.
>
> Signed-off-by: Herbert Xu <[email protected]>
>
> Marcelo, the same fix is needed in 2.4 as well.

Herbert,

Would be nice to have a version which applies to 2.4 also.

2004-10-12 21:22:30

by Herbert Xu

[permalink] [raw]
Subject: Re: [HID] Fix hiddev devfs oops

On Mon, Oct 11, 2004 at 02:21:47PM -0300, Marcelo Tosatti wrote:
> On Tue, Oct 05, 2004 at 10:49:14PM +1000, Herbert Xu wrote:
> >
> > There is a long-standing devfs_unregister oops in hid/hiddev. It's
> > caused by hid calling hiddev_exit before unregistering itself which
> > in turn calls hiddev_disconnect.
> >
> > hiddev_exit removes the directory which contains the hiddev devices.
> > Therefore it needs to be called after the hiddev devices have been
> > disconnected.
> >
> > This patch fixes that.
> >
> > Signed-off-by: Herbert Xu <[email protected]>
> >
> > Marcelo, the same fix is needed in 2.4 as well.
>
> Would be nice to have a version which applies to 2.4 also.

I did include a 2.4 patch in that email :)

Here it is again.
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Attachments:
(No filename) (971.00 B)
p-2.4 (326.00 B)
Download all attachments

2004-10-12 22:24:26

by Pete Zaitcev

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: [HID] Fix hiddev devfs oops

On Wed, 13 Oct 2004 07:21:54 +1000
Herbert Xu <[email protected]> wrote:

> > > Marcelo, the same fix is needed in 2.4 as well.
> >
> > Would be nice to have a version which applies to 2.4 also.
>
> I did include a 2.4 patch in that email :)

Herbert, I'm sorry for the wait. Marcelo asked me to take care of this,
but I kept postponing it because I wanted to look closer, and this and
that... It looks entirely reasonable and my hid devices continue to work,
but I haven't tested hiddev (UPS or something ?).

-- Pete

diff -urp -X dontdiff linux-2.4.28-pre3/drivers/usb/hid-core.c linux-2.4.28-pre3-usb/drivers/usb/hid-core.c
--- linux-2.4.28-pre3/drivers/usb/hid-core.c 2004-09-12 14:24:09.000000000 -0700
+++ linux-2.4.28-pre3-usb/drivers/usb/hid-core.c 2004-10-12 15:15:40.000000000 -0700
@@ -1459,8 +1459,8 @@ static int __init hid_init(void)

static void __exit hid_exit(void)
{
- hiddev_exit();
usb_deregister(&hid_driver);
+ hiddev_exit();
}

module_init(hid_init);

2004-10-12 23:15:36

by Herbert Xu

[permalink] [raw]
Subject: Re: [linux-usb-devel] Re: [HID] Fix hiddev devfs oops

On Tue, Oct 12, 2004 at 03:23:43PM -0700, Pete Zaitcev wrote:
>
> Herbert, I'm sorry for the wait. Marcelo asked me to take care of this,
> but I kept postponing it because I wanted to look closer, and this and
> that... It looks entirely reasonable and my hid devices continue to work,
> but I haven't tested hiddev (UPS or something ?).

Yes that's exactly the situation I'm in (APC UPS via USB) and it does fix
the OOPS for me when hid is unloaded with the UPS connected.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt