Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: chipidea: debug: add runtime pm for register access

Add runtime pm operations for registers access to avoid system hang.

Signed-off-by: Li Jun <jun.li@freescale.com>

authored by

Li Jun and committed by
Peter Chen
bc249379 158ec071

+6
+6
drivers/usb/chipidea/debug.c
··· 66 66 unsigned long flags; 67 67 unsigned mode; 68 68 69 + pm_runtime_get_sync(ci->dev); 69 70 spin_lock_irqsave(&ci->lock, flags); 70 71 mode = hw_port_test_get(ci); 71 72 spin_unlock_irqrestore(&ci->lock, flags); 73 + pm_runtime_put_sync(ci->dev); 72 74 73 75 seq_printf(s, "mode = %u\n", mode); 74 76 ··· 100 98 if (sscanf(buf, "%u", &mode) != 1) 101 99 return -EINVAL; 102 100 101 + pm_runtime_get_sync(ci->dev); 103 102 spin_lock_irqsave(&ci->lock, flags); 104 103 ret = hw_port_test_set(ci, mode); 105 104 spin_unlock_irqrestore(&ci->lock, flags); 105 + pm_runtime_put_sync(ci->dev); 106 106 107 107 return ret ? ret : count; 108 108 } ··· 320 316 if (role == CI_ROLE_END || role == ci->role) 321 317 return -EINVAL; 322 318 319 + pm_runtime_get_sync(ci->dev); 323 320 ci_role_stop(ci); 324 321 ret = ci_role_start(ci, role); 322 + pm_runtime_put_sync(ci->dev); 325 323 326 324 return ret ? ret : count; 327 325 }