[Freedreno] [PATCH 4.14 080/126] drm: msm: Fix return type of dsi_mgr_connector_mode_valid for kCFI

Greg Kroah-Hartman gregkh at linuxfoundation.org
Tue Mar 10 12:41:41 UTC 2020


From: John Stultz <john.stultz at linaro.org>

[ Upstream commit 7fd2dfc3694922eb7ace4801b7208cf9f62ebc7d ]

I was hitting kCFI crashes when building with clang, and after
some digging finally narrowed it down to the
dsi_mgr_connector_mode_valid() function being implemented as
returning an int, instead of an enum drm_mode_status.

This patch fixes it, and appeases the opaque word of the kCFI
gods (seriously, clang inlining everything makes the kCFI
backtraces only really rough estimates of where things went
wrong).

Thanks as always to Sami for his help narrowing this down.

Cc: Rob Clark <robdclark at gmail.com>
Cc: Sean Paul <sean at poorly.run>
Cc: Sami Tolvanen <samitolvanen at google.com>
Cc: Todd Kjos <tkjos at google.com>
Cc: Alistair Delva <adelva at google.com>
Cc: Amit Pundir <amit.pundir at linaro.org>
Cc: Sumit Semwal <sumit.semwal at linaro.org>
Cc: freedreno at lists.freedesktop.org
Cc: clang-built-linux at googlegroups.com
Signed-off-by: John Stultz <john.stultz at linaro.org>
Reviewed-by: Nick Desaulniers <ndesaulniers at google.com>
Tested-by: Amit Pundir <amit.pundir at linaro.org>
Signed-off-by: Rob Clark <robdclark at chromium.org>
Signed-off-by: Sasha Levin <sashal at kernel.org>
---
 drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index 855248132b2bd..7d46399a39b4d 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -400,7 +400,7 @@ static int dsi_mgr_connector_get_modes(struct drm_connector *connector)
 	return num;
 }
 
-static int dsi_mgr_connector_mode_valid(struct drm_connector *connector,
+static enum drm_mode_status dsi_mgr_connector_mode_valid(struct drm_connector *connector,
 				struct drm_display_mode *mode)
 {
 	int id = dsi_mgr_connector_get_id(connector);
-- 
2.20.1





More information about the Freedreno mailing list