Am Donnerstag 22 November 2001 04:37 schrieb Frank Zago:
> Hi,
>
> I'm using linux 2.4.14 with a UMAX 2200 USB scanner. When I do a "modprobe
> scanner" and "rmmod scanner", the rmmod process get stuck forever.
> The problem comes from disconnect_scanner(). It does a
>   down (&(scn->sem));
> then calls usb_unlink_urb().
> For some reason an interrupt is generated during that moment, so
> irq_scanner() is called. irq_scanner() also does a
>   down (&(scn->sem));
>
> ==> problem.
>
> I think the  down (&(scn->sem)); / up (&(scn->sem)); in
> disconnect_scanner() is unnecessary because the module cannot be removed
> if a process is using it, so that function will not be called. Removing
> them solves my problem.

The module cannot be removed, but the device can be removed. In a addition 
disconnect_scanner() can very well be called while no scanner is open.
The semaphore is thus needed.
The right remedy is to kill the interrupt URB before you down the semaphore, 
but after increasing the module use count.

>
> Also in probe_scanner(), there is a couple  up(&scn_mutex); missing before
> the next 2 return NULL;

Yes, you are right. Good spotting.

        Regards
                Oliver

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to