Bug 7548
Summary: | Slot 0 not NULL on disconnecting SN9C10x PC Camera | ||
---|---|---|---|
Product: | Drivers | Reporter: | Rafał Bilski (rafalbilski) |
Component: | USB | Assignee: | Greg Kroah-Hartman (greg) |
Status: | CLOSED PATCH_ALREADY_AVAILABLE | ||
Severity: | normal | CC: | bunk, mchehab |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 2.6.19-rc4 | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Attachments: |
Log from Linux 2.6.19-rc6
My personal config for Linux 2.6.19-rc6 Balance usb_get_dev() and usb_put_dev() calls. |
Description
Rafał Bilski
2006-11-18 07:14:31 UTC
Created attachment 9560 [details]
Log from Linux 2.6.19-rc6
Thats all what left in log. There was "fatal exception in interrupt
<beeeeeeep>" too.
Created attachment 9561 [details]
My personal config for Linux 2.6.19-rc6
On 11/18/06, bugme-daemon@bugzilla.kernel.org <bugme-daemon@bugzilla.kernel.org> wrote: > http://bugzilla.kernel.org/show_bug.cgi?id=7548 > > ------- Additional Comments From rafalbilski@interia.pl 2006-11-18 13:33 ------- > Created an attachment (id=9560) > --> (http://bugzilla.kernel.org/attachment.cgi?id=9560&action=view) > Log from Linux 2.6.19-rc6 > > Thats all what left in log. There was "fatal exception in interrupt > <beeeeeeep>" too. > Rafa, you posted 2 different stack traces so there may be more than one bug... On the second stack trace, it looks like you disconnected it then reconnected it 6 seconds later. Is that correct? Do you think you could post a stack trace again but this time include everything from the point where the driver is modprobed? Luca, there is one thing I noticed, in sn9c102_open(): 1501 err = wait_event_interruptible_exclusive(cam->open, 1502 cam->state & DEV_DISCONNECTED 1503 || !cam->users); The problem is that we're holding the sn9c102_disconnect lock so I don't think cam->state & DEV_DISCONNECTED is ever going to be true. regards, dan carpenter > Rafał, you posted 2 different stack traces First was for 2.6.19-rc4. Error was always the same. Second is for 2.6.19-rc6 because it is always good to check newest version. These two kernels seems to fail in different way. I'm using 2.6.19-rc6 now. > it looks like you disconnected it then reconnected it 6 seconds later. Is that correct? Yes. It looks interesting isn't it? > Do you think you could post a stack trace again but this time include > everything from the point where the driver is modprobed? I have tried but I don't have luck this time. This is all what left in log. Nov 20 07:35:07 elke Linux video capture interface: v2.00 Nov 20 07:35:07 elke sn9c102: V4L2 driver for SN9C10x PC Camera Controllers v1:1.27 Nov 20 07:35:07 elke usb 2-2: SN9C10[12] PC Camera Controller detected (vid/pid 0x0C45/0x602C) Nov 20 07:35:07 elke usb 2-2: OV7630 image sensor detected Nov 20 07:35:07 elke usb 2-2: Initialization succeeded Nov 20 07:35:07 elke usb 2-2: V4L2 device registered as /dev/video0 Nov 20 07:35:07 elke usbcore: registered new interface driver sn9c102 About 12s later a lot of messages was printed (to fast for me). This is part of last: via_driver_irq_handler+0x11/0x157 [via] [<c01270f9>] handle_IRQ_event+0x1a/0x3f [<c0128106>] handle_level_irq+0x66/0xa3 [<c0104248>] do_IRQ+0x68/0x80 [<c01029aa>] common_interrupt+0x1a/0x20 Kernel painc - not syncing: Fatal exception in interrupt And next time computer just lock up after 10s. Without any messages. I can disconnect mass storage class USB devices and spca5 camera without any problems. Created attachment 9572 [details]
Balance usb_get_dev() and usb_put_dev() calls.
I don't have the hardware so I haven't tested the attached patch beyond
compiling it.
Based on your messages, it doesn't look like you are using the camera when you
unplug it. It looks like in that code path we don't call usb_get_dev() but we
do call usb_put_dev()
Reply-To: luca.risolia@studio.unibo.it The patch below should fix the bug. Signed-off-by: Luca Risolia <luca.risolia@studio.unibo.it> --- diff -uprN -X a/Documentation/dontdiff a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c --- a/drivers/media/video/et61x251/et61x251_core.c 2006-11-20 14:08:16.000000000 +0100 +++ b/drivers/media/video/et61x251/et61x251_core.c 2006-11-20 14:21:54.000000000 +0100 @@ -1182,8 +1182,6 @@ static void et61x251_release_resources(s video_set_drvdata(cam->v4ldev, NULL); video_unregister_device(cam->v4ldev); - usb_put_dev(cam->usbdev); - mutex_unlock(&et61x251_sysfs_lock); kfree(cam->control_buffer); @@ -1275,6 +1273,7 @@ static int et61x251_release(struct inode if (cam->state & DEV_DISCONNECTED) { et61x251_release_resources(cam); + usb_put_dev(cam->usbdev); mutex_unlock(&cam->dev_mutex); kfree(cam); return 0; diff -uprN -X a/Documentation/dontdiff a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c --- a/drivers/media/video/sn9c102/sn9c102_core.c 2006-11-20 14:08:16.000000000 +0100 +++ b/drivers/media/video/sn9c102/sn9c102_core.c 2006-11-20 14:20:39.000000000 +0100 @@ -1462,8 +1462,6 @@ static void sn9c102_release_resources(st video_set_drvdata(cam->v4ldev, NULL); video_unregister_device(cam->v4ldev); - usb_put_dev(cam->usbdev); - mutex_unlock(&sn9c102_sysfs_lock); kfree(cam->control_buffer); @@ -1555,6 +1553,7 @@ static int sn9c102_release(struct inode* if (cam->state & DEV_DISCONNECTED) { sn9c102_release_resources(cam); + usb_put_dev(cam->usbdev); mutex_unlock(&cam->dev_mutex); kfree(cam); return 0; Alle 06:16, luned Thank You. Both patches are removing the problem. |