Re: [PATCH 3/3] usb: renesas_usbhs: Reorder clock handling and power management in probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Prabhakark

Thank you for the patch

> Reorder the initialization sequence in `usbhs_probe()` to enable runtime
> PM before accessing registers, preventing potential crashes due to
> uninitialized clocks.
> 
> Currently, in the probe path, registers are accessed before enabling the
> clocks, leading to a synchronous external abort on the RZ/V2H SoC.
> The problematic call flow is as follows:
> 
>     usbhs_probe()
>         usbhs_sys_clock_ctrl()
>             usbhs_bset()
>                 usbhs_write()
>                     iowrite16()  <-- Register access before enabling clocks

This patch itself is not so bad idea, but basically, we should not assume
the power/clock was enabled since kernel boot.
In this driver, register access happen only during power enable <->  power
disable (except your issue case), and this is good idea. So, the strange
is usbhs_sys_clock_ctrl() call in usbhs_probe() (without power enable) I
guess.

According to the comment, it is just caring boot loader, and
usbhs_sys_clock_ctrl() itself will be called when usbhsc_power_ctrl() was
called anyway. And more, if my understanding was correct, Renesas clock
driver will stop all unused devices clock/power after boot.
So maybe we can just remove strange usbhs_sys_clock_ctrl() from usbhs_probe() ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux