* [HID] Fix hiddev devfs oops
@ 2004-10-05 12:49 Herbert Xu
2004-10-11 17:21 ` Marcelo Tosatti
0 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2004-10-05 12:49 UTC (permalink / raw)
To: Vojtech Pavlik, linux-usb-devel
Cc: Marcelo Tosatti, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 674 bytes --]
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 <herbert@gondor.apana.org.au>
Marcelo, the same fix is needed in 2.4 as well.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p-2.6 --]
[-- Type: text/plain, Size: 344 bytes --]
===== drivers/usb/input/hid-core.c 1.94 vs edited =====
--- 1.94/drivers/usb/input/hid-core.c 2004-08-25 22:01:29 +10:00
+++ edited/drivers/usb/input/hid-core.c 2004-10-05 22:44:03 +10:00
@@ -1859,8 +1859,8 @@
static void __exit hid_exit(void)
{
- hiddev_exit();
usb_deregister(&hid_driver);
+ hiddev_exit();
}
module_init(hid_init);
[-- Attachment #3: p-2.4 --]
[-- Type: text/plain, Size: 326 bytes --]
===== drivers/usb/hid-core.c 1.30 vs edited =====
--- 1.30/drivers/usb/hid-core.c 2004-08-08 18:59:53 +10:00
+++ edited/drivers/usb/hid-core.c 2004-10-05 22:33:52 +10:00
@@ -1459,8 +1459,8 @@
static void __exit hid_exit(void)
{
- hiddev_exit();
usb_deregister(&hid_driver);
+ hiddev_exit();
}
module_init(hid_init);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [HID] Fix hiddev devfs oops
2004-10-05 12:49 [HID] Fix hiddev devfs oops Herbert Xu
@ 2004-10-11 17:21 ` Marcelo Tosatti
2004-10-12 21:21 ` Herbert Xu
0 siblings, 1 reply; 7+ messages in thread
From: Marcelo Tosatti @ 2004-10-11 17:21 UTC (permalink / raw)
To: Herbert Xu; +Cc: Vojtech Pavlik, linux-usb-devel, Linux Kernel Mailing List
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 <herbert@gondor.apana.org.au>
>
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [HID] Fix hiddev devfs oops
2004-10-11 17:21 ` Marcelo Tosatti
@ 2004-10-12 21:21 ` Herbert Xu
2004-10-12 22:23 ` [linux-usb-devel] " Pete Zaitcev
0 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2004-10-12 21:21 UTC (permalink / raw)
To: Marcelo Tosatti
Cc: Vojtech Pavlik, linux-usb-devel, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 971 bytes --]
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 <herbert@gondor.apana.org.au>
> >
> > 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~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p-2.4 --]
[-- Type: text/plain, Size: 326 bytes --]
===== drivers/usb/hid-core.c 1.30 vs edited =====
--- 1.30/drivers/usb/hid-core.c 2004-08-08 18:59:53 +10:00
+++ edited/drivers/usb/hid-core.c 2004-10-05 22:33:52 +10:00
@@ -1459,8 +1459,8 @@
static void __exit hid_exit(void)
{
- hiddev_exit();
usb_deregister(&hid_driver);
+ hiddev_exit();
}
module_init(hid_init);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [linux-usb-devel] Re: [HID] Fix hiddev devfs oops
2004-10-12 21:21 ` Herbert Xu
@ 2004-10-12 22:23 ` Pete Zaitcev
2004-10-12 23:14 ` Herbert Xu
0 siblings, 1 reply; 7+ messages in thread
From: Pete Zaitcev @ 2004-10-12 22:23 UTC (permalink / raw)
To: Herbert Xu
Cc: Marcelo Tosatti, Vojtech Pavlik, linux-usb-devel,
Linux Kernel Mailing List
On Wed, 13 Oct 2004 07:21:54 +1000
Herbert Xu <herbert@gondor.apana.org.au> 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);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [linux-usb-devel] Re: [HID] Fix hiddev devfs oops
2004-10-12 22:23 ` [linux-usb-devel] " Pete Zaitcev
@ 2004-10-12 23:14 ` Herbert Xu
2004-10-13 0:51 ` Adam Kropelin
0 siblings, 1 reply; 7+ messages in thread
From: Herbert Xu @ 2004-10-12 23:14 UTC (permalink / raw)
To: Pete Zaitcev
Cc: Marcelo Tosatti, Vojtech Pavlik, linux-usb-devel,
Linux Kernel Mailing List
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~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [linux-usb-devel] Re: [HID] Fix hiddev devfs oops
2004-10-12 23:14 ` Herbert Xu
@ 2004-10-13 0:51 ` Adam Kropelin
2004-10-13 2:20 ` Herbert Xu
0 siblings, 1 reply; 7+ messages in thread
From: Adam Kropelin @ 2004-10-13 0:51 UTC (permalink / raw)
To: Herbert Xu, Pete Zaitcev
Cc: Marcelo Tosatti, Vojtech Pavlik, linux-usb-devel,
Linux Kernel Mailing List
Herbert Xu wrote:
> 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.
Another scenario to keep in mind is unplugging a USB device while a process
still has its corresponding hiddev node open. I fixed that issue in 2.6 a
while ago. I'm not sure if 2.4 is susceptible. It may or may not be
orthogonal to the problem your patch addresses.
--Adam
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-10-13 2:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-05 12:49 [HID] Fix hiddev devfs oops Herbert Xu
2004-10-11 17:21 ` Marcelo Tosatti
2004-10-12 21:21 ` Herbert Xu
2004-10-12 22:23 ` [linux-usb-devel] " Pete Zaitcev
2004-10-12 23:14 ` Herbert Xu
2004-10-13 0:51 ` Adam Kropelin
2004-10-13 2:20 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox