Skip to content

Commit

Permalink
usb: gadget: pch_udc: Fix disconnect issue
Browse files Browse the repository at this point in the history
ISSUE:
When the driver notifies a gadget of a disconnect event, a system
rarely freezes.

CAUSE:
When the driver calls dev->driver->disconnect(), it is not calling
spin_unlock().

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Tomoya MORINAGA authored and Felipe Balbi committed Jan 24, 2012
1 parent 294f78e commit c50a3bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/gadget/pch_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2335,8 +2335,11 @@ static void pch_udc_svc_ur_interrupt(struct pch_udc_dev *dev)
/* Complete request queue */
empty_req_queue(ep);
}
if (dev->driver && dev->driver->disconnect)
if (dev->driver && dev->driver->disconnect) {
spin_unlock(&dev->lock);
dev->driver->disconnect(&dev->gadget);
spin_lock(&dev->lock);
}
}

/**
Expand Down

0 comments on commit c50a3bf

Please sign in to comment.