Hello Dan Carpenter, Yousaf Kaukab did a patch to embed those backup registers in struct dwc2_hsotg. This way, there is no more allocation needed in dwc2_backup_host_registers(). Here is the patch title: "usb: dwc2: embed storage for reg backup in struct dwc2_hsotg" It has been submitted to linux-usb mailing list few weeks ago. Regards, Gregory Herrero -----Original Message----- From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx] Sent: Tuesday, June 23, 2015 3:12 PM To: Herrero, Gregory Cc: linux-usb@xxxxxxxxxxxxxxx Subject: re: usb: dwc2: add controller hibernation support 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 majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html