summaryrefslogtreecommitdiffstats
path: root/lib/test_firmware.c
diff options
context:
space:
mode:
authorChen-Yu Tsai <wenst@chromium.org>2023-06-06 11:17:45 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-06 14:43:13 +0200
commitb6c7ff2693ddc24cdad3b032d969303f7b2ae3da (patch)
tree2e64ce1ba31388f42203f65ffb2187c7bb4378e0 /lib/test_firmware.c
parentserial: st-asc: fix typo in property name (diff)
downloadlinux-b6c7ff2693ddc24cdad3b032d969303f7b2ae3da.tar.xz
linux-b6c7ff2693ddc24cdad3b032d969303f7b2ae3da.zip
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/20230602092701.GP14287@atomide.com/ [2] https://lore.kernel.org/linux-serial/20230605061511.GW14287@atomide.com/ Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM") Suggested-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Tony Lindgren <tony@atomide.com> Message-ID: <20230606091747.2031168-1-wenst@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/test_firmware.c')
0 files changed, 0 insertions, 0 deletions