/*
  *             queue push/pop
  */
-static void usbhsg_queue_pop(struct usbhsg_uep *uep,
-                            struct usbhsg_request *ureq,
-                            int status)
+static void __usbhsg_queue_pop(struct usbhsg_uep *uep,
+                              struct usbhsg_request *ureq,
+                              int status)
 {
        struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep);
        struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);
        struct device *dev = usbhsg_gpriv_to_dev(gpriv);
+       struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv);
 
        dev_dbg(dev, "pipe %d : queue pop\n", usbhs_pipe_number(pipe));
 
        ureq->req.status = status;
+       spin_unlock(usbhs_priv_to_lock(priv));
        usb_gadget_giveback_request(&uep->ep, &ureq->req);
+       spin_lock(usbhs_priv_to_lock(priv));
+}
+
+static void usbhsg_queue_pop(struct usbhsg_uep *uep,
+                            struct usbhsg_request *ureq,
+                            int status)
+{
+       struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep);
+       struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv);
+       unsigned long flags;
+
+       usbhs_lock(priv, flags);
+       __usbhsg_queue_pop(uep, ureq, status);
+       usbhs_unlock(priv, flags);
 }
 
 static void usbhsg_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)