All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/msm/dsi: do not use uninitialized kms
@ 2021-07-05 23:36 David Heidelberg
  2021-07-06 23:17 ` Dmitry Baryshkov
  0 siblings, 1 reply; 3+ messages in thread
From: David Heidelberg @ 2021-07-05 23:36 UTC (permalink / raw)
  To: Sean Paul, robdclark; +Cc: linux-arm-msm, David Heidelberg

Without this patch boot ends at NULL ptr exception at msm_dsi_manager_setup_encoder
on devices like Nexus 7 with MDP4 version 4.4.

Fixes: 03436e3ec69c ("drm/msm/dsi: Move setup_encoder to modeset_init")

Signed-off-by: David Heidelberg <david@ixit.cz>
---

v2: typo in Fixes commit reference

 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 4ebfedc4a9ac..8114612b34b0 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -230,7 +230,7 @@ void msm_dsi_manager_setup_encoder(int id)
 	struct msm_kms *kms = priv->kms;
 	struct drm_encoder *encoder = msm_dsi_get_encoder(msm_dsi);
 
-	if (encoder && kms->funcs->set_encoder_mode)
+	if (encoder && kms && kms->funcs->set_encoder_mode)
 		kms->funcs->set_encoder_mode(kms, encoder,
 					     dsi_mgr_is_cmd_mode(msm_dsi));
 }
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] drm/msm/dsi: do not use uninitialized kms
  2021-07-05 23:36 [PATCH v2] drm/msm/dsi: do not use uninitialized kms David Heidelberg
@ 2021-07-06 23:17 ` Dmitry Baryshkov
  2021-07-07 13:04   ` David Heidelberg
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Baryshkov @ 2021-07-06 23:17 UTC (permalink / raw)
  To: David Heidelberg, Sean Paul, robdclark; +Cc: linux-arm-msm

On 06/07/2021 02:36, David Heidelberg wrote:
> Without this patch boot ends at NULL ptr exception at msm_dsi_manager_setup_encoder
> on devices like Nexus 7 with MDP4 version 4.4.
> 
> Fixes: 03436e3ec69c ("drm/msm/dsi: Move setup_encoder to modeset_init")
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>

Being not an expert in the mdp4 sources, I suspect that the fix is not 
quite correct. I'd suggest setting priv->kms in the mdp4_kms_init() 
before calling modeset_init().

> ---
> 
> v2: typo in Fixes commit reference
> 
>   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 4ebfedc4a9ac..8114612b34b0 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> @@ -230,7 +230,7 @@ void msm_dsi_manager_setup_encoder(int id)
>   	struct msm_kms *kms = priv->kms;
>   	struct drm_encoder *encoder = msm_dsi_get_encoder(msm_dsi);
>   
> -	if (encoder && kms->funcs->set_encoder_mode)
> +	if (encoder && kms && kms->funcs->set_encoder_mode)
>   		kms->funcs->set_encoder_mode(kms, encoder,
>   					     dsi_mgr_is_cmd_mode(msm_dsi));
>   }
> 


-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] drm/msm/dsi: do not use uninitialized kms
  2021-07-06 23:17 ` Dmitry Baryshkov
@ 2021-07-07 13:04   ` David Heidelberg
  0 siblings, 0 replies; 3+ messages in thread
From: David Heidelberg @ 2021-07-07 13:04 UTC (permalink / raw)
  To: Dmitry Baryshkov; +Cc: Sean Paul, robdclark, linux-arm-msm

Thank you,

tried your proposed solution, works for me (also seems better).

Sending another patch.
Best regards
David Heidelberg

On Wed, Jul 7 2021 at 02:17:14 +0300, Dmitry Baryshkov 
<dmitry.baryshkov@linaro.org> wrote:
> On 06/07/2021 02:36, David Heidelberg wrote:
>> Without this patch boot ends at NULL ptr exception at 
>> msm_dsi_manager_setup_encoder
>> on devices like Nexus 7 with MDP4 version 4.4.
>> 
>> Fixes: 03436e3ec69c ("drm/msm/dsi: Move setup_encoder to 
>> modeset_init")
>> 
>> Signed-off-by: David Heidelberg <david@ixit.cz>
> 
> Being not an expert in the mdp4 sources, I suspect that the fix is 
> not quite correct. I'd suggest setting priv->kms in the 
> mdp4_kms_init() before calling modeset_init().
> 
>> ---
>> 
>> v2: typo in Fixes commit reference
>> 
>>   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 4ebfedc4a9ac..8114612b34b0 100644
>> --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
>> +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
>> @@ -230,7 +230,7 @@ void msm_dsi_manager_setup_encoder(int id)
>>   	struct msm_kms *kms = priv->kms;
>>   	struct drm_encoder *encoder = msm_dsi_get_encoder(msm_dsi);
>>   \x7f-	if (encoder && kms->funcs->set_encoder_mode)
>> +	if (encoder && kms && kms->funcs->set_encoder_mode)
>>   		kms->funcs->set_encoder_mode(kms, encoder,
>>   					     dsi_mgr_is_cmd_mode(msm_dsi));
>>   }
>> 
> 
> 
> --
> With best wishes
> Dmitry



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-07 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 23:36 [PATCH v2] drm/msm/dsi: do not use uninitialized kms David Heidelberg
2021-07-06 23:17 ` Dmitry Baryshkov
2021-07-07 13:04   ` David Heidelberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.