summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2017-08-28 16:55:10 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit0cde7b84be45a1558765de97538ebbc017b98f2b (patch)
tree86051c989ba8a6b6533caa25dd752d814c6375dd /drivers/usb/cdns3
parent08e1e80f83c3ad724e702d36277eababc8b8ca07 (diff)
MLK-16221-6 usb: cdns3: gadget: fix non-initialized spinlock warning
The below warning is showed if we open lockdep debug, fix it by initializing spinlock before using it. [ 192.159535] INFO: trying to register non-static key. [ 192.164507] the code is fine but needs lockdep annotation. [ 192.169996] turning off the locking correctness validator. [ 192.175485] CPU: 1 PID: 2831 Comm: modprobe Not tainted 4.9.11-03045-g39aab30 #514 [ 192.183054] Hardware name: Freescale i.MX8QXP LPDDR4 ARM2 (DT) [ 192.188884] Call trace: [ 192.191348] [<ffff200008089234>] dump_backtrace+0x0/0x1e0 [ 192.196751] [<ffff200008089428>] show_stack+0x14/0x1c [ 192.201808] [<ffff2000084046f4>] dump_stack+0xb0/0xec [ 192.206865] [<ffff200008107570>] register_lock_class+0x510/0x538 [ 192.212873] [<ffff20000810b7c4>] __lock_acquire+0x84/0x6f0 [ 192.218363] [<ffff20000810c34c>] lock_acquire+0x68/0xc8 [ 192.223596] [<ffff200008bfe1f4>] _raw_spin_lock_irqsave+0x50/0x68 [ 192.229694] [<ffff200008857528>] usb_ss_gadget_udc_start+0x38/0x1b0 [ 192.235966] [<ffff20000889da8c>] udc_bind_to_driver+0xcc/0x11c [ 192.241803] [<ffff20000889e0e4>] usb_gadget_probe_driver+0xa4/0x150 [ 192.248077] [<ffff2000088983a8>] usb_composite_probe+0xb8/0xd8 [ 192.253923] [<ffff200000ce8018>] msg_init+0x18/0x1000 [g_mass_storage] [ 192.260456] [<ffff200008083960>] do_one_initcall+0x38/0x12c [ 192.266033] [<ffff200008187764>] do_init_module+0x98/0x214 [ 192.271523] [<ffff2000081465fc>] load_module+0x1014/0x10f0 [ 192.277012] [<ffff200008146970>] SyS_finit_module+0xc8/0xd4 [ 192.282590] [<ffff20000808374c>] __sys_trace_return+0x0/0x4 Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/gadget.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index e756221e3864..673d3b9bfb04 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -2070,6 +2070,7 @@ static int __cdns3_gadget_init(struct cdns3 *cdns)
usb_ss->gadget.name = "usb-ss-gadget";
usb_ss->gadget.sg_supported = 1;
usb_ss->is_connected = 0;
+ spin_lock_init(&usb_ss->lock);
usb_ss->in_standby_mode = 1;