This patch fixes an issue that the spin_lock_init() is not called
for almost all pipes. Otherwise, the lockdep output the following
message when we connect a usb cable using g_ncm:

 INFO: trying to register non-static key.
 the code is fine but needs lockdep annotation.
 turning off the locking correctness validator.

Reported-by: Kazuya Mizuguchi <>
Fixes: b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the 
driver stops")
Signed-off-by: Yoshihiro Shimoda <>
Tested-by: Kazuya Mizuguchi <>

 I'm sorry again and again. This patch is based on the latest Felipe's
 usb.git / testing/fixes branch (the commit id = b7d44c36a6f6d).

 Or, should I revert related patches first?
  b7d44c36a6f6 ("usb: renesas_usbhs: gadget: fix unused-but-set-variable 
  b8b9c974afee ("usb: renesas_usbhs: gadget: disable all eps when the driver 

 drivers/usb/renesas_usbhs/mod_gadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c 
index 2c8161b..5984fb1 100644
--- a/drivers/usb/renesas_usbhs/mod_gadget.c
+++ b/drivers/usb/renesas_usbhs/mod_gadget.c
@@ -1082,7 +1082,6 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
                ret = -ENOMEM;
                goto usbhs_mod_gadget_probe_err_gpriv;
-       spin_lock_init(&uep->lock);
        gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED);
        dev_info(dev, "%stransceiver found\n",
@@ -1132,6 +1131,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
                uep->            = uep->ep_name;
                uep->ep.ops             = &usbhsg_ep_ops;
+               spin_lock_init(&uep->lock);
                /* init DCP */
                if (usbhsg_is_dcp(uep)) {

To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to
More majordomo info at

Reply via email to