dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Abhinav Kumar <abhinavk@codeaurora.org>
To: Sean Paul <sean@poorly.run>
Cc: jhugo@codeaurora.org, linux-arm-msm@vger.kernel.org,
	dri-devel@lists.freedesktop.org, seanpaul@chromium.org,
	hoegsberg@google.com, chandanu@codeaurora.org
Subject: Re: [PATCH] drm/msm/dsi: add protection against NULL dsi device
Date: Thu, 07 Mar 2019 14:02:03 -0800	[thread overview]
Message-ID: <cd4c2e25f2785bc09da77e715a3d6c30@codeaurora.org> (raw)
In-Reply-To: <20190307215947.GG114153@art_vandelay>

On 2019-03-07 13:59, Sean Paul wrote:
> On Wed, Mar 06, 2019 at 05:28:54PM -0800, Abhinav Kumar wrote:
>> When panel probe happens after DSI probe, the DSI probe
>> is deferred as per current design. In the probe defer path
>> dsi device is destroyed. This NULL dsi device could be
>> deferenced by the panel probe in the mipi_dsi_attach path.
>> 
>> Check for NULL dsi device before accessing it.
> 
> It would be really nice to sort all of this out in a manner that's not
> sprinkling NULL checks around the driver. I spent 5 minutes looking 
> around and
> couldn't really make sense of how all of these pieces interact, but 
> this seems
> like it might be an architectural problem (perhaps since dpu was using 
> its own
> panel stuff instead of drm_panel?).
> 
> Anyways, it'd be nice to fix that.
> 
> In the meantime, could you please add a big comment like the !dev check 
> in this
> function explaining how this situation can come to pass? That way the 
> knowledge
> isn't lost and whoever comes along to clean up all of these probe 
> checks will
> have some clue as to what's going on.
> 
> Sean
[Abhinav] Sure Sean, will add a detailed comment to explain the scenario
> 
>> 
>> Reported-by: Jeffrey Hugo <jhugo@codeaurora.org>
>> Tested-by: Jeffrey Hugo <jhugo@codeaurora.org>
>> Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.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 80aa634..cc2569d 100644
>> --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
>> +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
>> @@ -769,7 +769,7 @@ bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 
>> dma_base, u32 len)
>>  void msm_dsi_manager_attach_dsi_device(int id, u32 device_flags)
>>  {
>>  	struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id);
>> -	struct drm_device *dev = msm_dsi->dev;
>> +	struct drm_device *dev = msm_dsi ? msm_dsi->dev : NULL;
>>  	struct msm_drm_private *priv;
>>  	struct msm_kms *kms;
>>  	struct drm_encoder *encoder;
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-03-07 22:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07  1:28 [PATCH] drm/msm/dsi: add protection against NULL dsi device Abhinav Kumar
2019-03-07 21:59 ` Sean Paul
2019-03-07 22:02   ` Abhinav Kumar [this message]
2019-05-29 20:43     ` Jeffrey Hugo
2019-05-29 21:19       ` Abhinav Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd4c2e25f2785bc09da77e715a3d6c30@codeaurora.org \
    --to=abhinavk@codeaurora.org \
    --cc=chandanu@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@google.com \
    --cc=jhugo@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=sean@poorly.run \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox