usb: isp1760: move to regmap for register access
Hello Rui Miguel Silva,
The patch 1da9e1c06873: "usb: isp1760: move to regmap for register access" from May 13, 2021, leads to the following static checker warning:
drivers/usb/isp1760/isp1760-hcd.c:264 isp1760_hcd_set_and_wait_swap() warn: sleeping in atomic context
drivers/usb/isp1760/isp1760-hcd.c
256 static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field,
257 u32 timeout_us)
258 {
259 struct isp1760_hcd *priv = hcd_to_priv(hcd);
260 u32 val;
261
262 isp1760_hcd_set(hcd, field);
263
--> 264 return regmap_field_read_poll_timeout(priv->fields[field], val,
265 !val, 10, timeout_us);
^^This used to call something else but it was still a sleep function.
The call tree is:
--> isp1760_stop() <-- takes a spinlock
--> ehci_reset()
--> isp1760_hcd_set_and_wait_swap()
266 }regards,
dan carpenter
Hi Dan,
Quoted 21 lines · Dan Carpenter
Hello Rui Miguel Silva,
The patch
1da9e1c06873: "usb: isp1760: move to regmap for register access" from May 13, 2021, leads to the following static checker warning:drivers/usb/isp1760/isp1760-hcd.c:264 isp1760_hcd_set_and_wait_swap() warn: sleeping in atomic context
drivers/usb/isp1760/isp1760-hcd.c256 static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field, 257 u32 timeout_us) 258 { 259 struct isp1760_hcd *priv = hcd_to_priv(hcd); 260 u32 val; 261 262 isp1760_hcd_set(hcd, field); 263 --> 264 return regmap_field_read_poll_timeout(priv->fields[field], val, 265 !val, 10, timeout_us); ^^
Quoted 6 lines
This used to call something else but it was still a sleep function.
The call tree is:
-->isp1760_stop()<-- takes a spinlock--> ehci_reset() --> isp1760_hcd_set_and_wait_swap()
Thanks for both reports, I will send fix for this soon.
------
Cheers,
Rui