Hello Gregory Herrero,
The patch d17ee77b3044: "usb: dwc2: add controller hibernation
support" from Apr 29, 2015, leads to the following static checker
warning:
drivers/usb/dwc2/core.c:77 dwc2_backup_host_registers()
error: scheduling with locks held: 'spin_lock:lock'
drivers/usb/dwc2/core.c
67 static int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg)
68 {
69 struct dwc2_hregs_backup *hr;
70 int i;
71
72 dev_dbg(hsotg->dev, "%s\n", __func__);
73
74 /* Backup Host regs */
75 hr = hsotg->hr_backup;
76 if (!hr) {
77 hr = devm_kzalloc(hsotg->dev, sizeof(*hr), GFP_KERNEL);
^^^^^^^^^^
We can't sleep here because we are called under spin_lock. The call
tree is:
dwc2_handle_common_intr() <- takes a lock.
dwc2_handle_usb_suspend_intr()
dwc2_enter_hibernation()
dwc2_backup_host_registers()
78 if (!hr) {
79 dev_err(hsotg->dev, "%s: can't allocate host
regs\n",
80 __func__);
81 return -ENOMEM;
82 }
83
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html