]> git.hungrycats.org Git - linux/commit
drm/lcdif: Do not disable clocks on already suspended hardware
authorMarek Vasut <marex@denx.de>
Mon, 26 Feb 2024 08:26:27 +0000 (09:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:49:32 +0000 (09:49 +0200)
commitad6e78798da4b4a7e861bbc9dc4e8a46da17bd0a
tree6f7287eaeec849cf367910c1f8a2108a8a365e96
parent1a5d37fb567754e1f07ebbfe91ce39f5870f8415
drm/lcdif: Do not disable clocks on already suspended hardware

[ Upstream commit 172695f145fb4798ab605e8a73f6e87711930124 ]

In case the LCDIF is enabled in DT but unused, the clocks used by the
LCDIF are not enabled. Those clocks may even have a use count of 0 in
case there are no other users of those clocks. This can happen e.g. in
case the LCDIF drives HDMI bridge which has no panel plugged into the
HDMI connector.

Do not attempt to disable clocks in the suspend callback and re-enable
clocks in the resume callback unless the LCDIF is enabled and was in
use before the system entered suspend, otherwise the driver might end
up trying to disable clocks which are already disabled with use count
0, and would trigger a warning from clock core about this condition.

Note that the lcdif_rpm_suspend() and lcdif_rpm_resume() functions
internally perform the clocks disable and enable operations and act
as runtime PM hooks too.

Reviewed-by: Liu Ying <victor.liu@nxp.com>
Fixes: 9db35bb349a0 ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240226082644.32603-1-marex@denx.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/mxsfb/lcdif_drv.c