[PATCH 2/6] usb/fsl_qe_udc: Fix recursive locking bug in ch9getstatus()

David Brownell david-b at pacbell.net
Tue Nov 18 12:59:42 EST 2008


On Tuesday 11 November 2008, Anton Vorontsov wrote:
> -       spin_lock_irqsave(&udc->lock, flags);
> +       if (lock)
> +               spin_lock_irqsave(lock, flags);

Ugly ugly ugly.  Conditional locking is error prone ... don't.

Couldn't you just have the usb_ep_queue() method wrap lock calls
around a common routine called by that and the status reporting code?

Or just have the status reporting code stuff the two bytes directly
into the FIFO?  (Which is what a lot of other drivers do.)

- Dave





More information about the Linuxppc-dev mailing list