You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
serial: 8250_mtk: Simplify clock sequencing and runtime PM
The 8250_mtk driver's runtime PM support has some issues:
- The bus clock is enabled (through runtime PM callback) later than a
register write
- runtime PM resume callback directly called in probe, but no
pm_runtime_set_active() call is present
- UART PM function calls the callbacks directly, _and_ calls runtime
PM API
- runtime PM callbacks try to do reference counting, adding yet another
count between runtime PM and clocks
This fragile setup worked in a way, but broke recently with runtime PM
support added to the serial core. The system would hang when the UART
console was probed and brought up.
Tony provided some potential fixes [1][2], though they were still a bit
complicated. The 8250_dw driver, which the 8250_mtk driver might have
been based on, has a similar structure but simpler runtime PM usage.
Simplify clock sequencing and runtime PM support in the 8250_mtk driver.
Specifically, the clock is acquired enabled and assumed to be active,
unless toggled through runtime PM suspend/resume. Reference counting is
removed and left to the runtime PM core. The serial pm function now
only calls the runtime PM API.
[1] https://lore.kernel.org/linux-serial/[email protected]/
[2] https://lore.kernel.org/linux-serial/[email protected]/
Fixes: 84a9582 ("serial: core: Start managing serial controllers to enable runtime PM")
Suggested-by: Tony Lindgren <[email protected]>
Signed-off-by: Chen-Yu Tsai <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Reviewed-by: Tony Lindgren <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
0 commit comments