mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
usb: dwc3: debugfs: Add LPM check for ep_info_register
Prevent unclocked access if this debugfs parameter is attempted to be read when USB controller is powered off. Change-Id: I5a563ea75807d95f0d6d6c5b037db48681d89625 Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
parent
28cf0d0908
commit
090d777fe3
1 changed files with 5 additions and 0 deletions
|
|
@ -921,6 +921,11 @@ static int dwc3_ep_info_register_show(struct seq_file *s, void *unused)
|
|||
u32 upper_32_bits;
|
||||
u32 reg;
|
||||
|
||||
if (atomic_read(&dwc->in_lpm)) {
|
||||
seq_puts(s, "USB device is powered off\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&dwc->lock, flags);
|
||||
reg = DWC3_GDBGLSPMUX_EPSELECT(dep->number);
|
||||
dwc3_writel(dwc->regs, DWC3_GDBGLSPMUX, reg);
|
||||
|
|
|
|||
Loading…
Reference in a new issue