Commit 22dc791a authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Liu Shixin
Browse files

drm/panel: ilitek-ili9881c: Fix warning with GPIO controllers that sleep

stable inclusion
from stable-v5.10.221
commit cae52f61fda0f5d2949dc177f984c9e187d4c6a0
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAGEP0
CVE: CVE-2024-42087

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cae52f61fda0f5d2949dc177f984c9e187d4c6a0



--------------------------------

[ Upstream commit ee7860cd8b5763017f8dc785c2851fecb7a0c565 ]

The ilitek-ili9881c controls the reset GPIO using the non-sleeping
gpiod_set_value() function. This complains loudly when the GPIO
controller needs to sleep. As the caller can sleep, use
gpiod_set_value_cansleep() to fix the issue.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240317154839.21260-1-laurent.pinchart@ideasonboard.com


Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240317154839.21260-1-laurent.pinchart@ideasonboard.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent d405cb4e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -506,10 +506,10 @@ static int ili9881c_prepare(struct drm_panel *panel)
	msleep(5);

	/* And reset it */
	gpiod_set_value(ctx->reset, 1);
	gpiod_set_value_cansleep(ctx->reset, 1);
	msleep(20);

	gpiod_set_value(ctx->reset, 0);
	gpiod_set_value_cansleep(ctx->reset, 0);
	msleep(20);

	for (i = 0; i < ctx->desc->init_length; i++) {
@@ -564,7 +564,7 @@ static int ili9881c_unprepare(struct drm_panel *panel)

	mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
	regulator_disable(ctx->power);
	gpiod_set_value(ctx->reset, 1);
	gpiod_set_value_cansleep(ctx->reset, 1);

	return 0;
}