Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Inki Dae <inki.dae@samsung.com>
Cc: a.hajda@samsung.com, linux-samsung-soc@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/exynos: fix null pointer dereference issue
Date: Fri, 21 Nov 2014 12:41:11 -0200	[thread overview]
Message-ID: <20141121144111.GC3123@joana> (raw)
In-Reply-To: <546E9F5D.1060203@samsung.com>

2014-11-21 Inki Dae <inki.dae@samsung.com>:

> On 2014년 11월 21일 08:12, Gustavo Padovan wrote:
> > 2014-11-13 Inki Dae <inki.dae@samsung.com>:
> > 
> >> This patch fixes null pointer dereference issue incurred
> >> when ipp driver is enabled and Exynos drm driver is closed.
> >>
> >> Non kms driver should register its own sub driver to setup necessary
> >> resources, which is done by load(). So null pointer dereference
> >> occurs when ipp driver is enabled and Exynos drm driver is closed
> >> because ipp core device is registered after component_master_add_with_match
> >> call.
> >>
> >> This patch makes exynos_drm_device_subdrv_probe() to be called after all non
> >> kms drivers are registered.
> > 
> > This patch is breaking exynos initialization, exynos_drm_device_subdrv_probe()
> > needs the drvdata but it is still NULL at this point which make the whole
> > exynos init fails. The drvdata is only set in exynos_drm_load() so we need
> > call exynos_drm_device_subdrv_probe() after that.
> 
> There might be my missing point but with this patch,
> exynos_drm_device_subdrv_probe() will be called after exynos_drm_load()
> call because all kms drivers are probed before
> component_master_add_with_match call so exynos_drm_load() must be called
> by component_master_add_with_match function before
> exynos_drm_device_subdrv_probe call.
> 
> So could you show me the error messages you faced with? There might be a
> corner case I missed.

I've added some debug output to it. It fails on
exynos_drm_device_subdrv_probe() because the drvdata is NULL. I've added debug
output to exynos_drm_load() and as you can see it doesn't get called before
subdrv_probe(). I'm testing this on snow.

[    1.767835] [drm] Initialized drm 1.1.0 20060810
[    1.771120] [drm:exynos_drm_init] 
[    1.774774] [drm:exynos_drm_platform_probe] 
[    1.778760] platform exynos-drm: Driver exynos-drm requests probe deferral
[    1.786178] platform 145b0000.dp-controller: Driver exynos-dp requests
probe deferral
[    1.794374] exynos-drm-ipp exynos-drm-ipp: drm ipp registered successfully.
[    1.800372] [drm:exynos_drm_device_subdrv_probe] dev   (null)


	Gustavo
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-11-21 14:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  7:50 [PATCH 0/2] drm/exynos: fix null pointer dereferenece issue Inki Dae
2014-11-13  7:50 ` [PATCH 1/2] drm/exynos: fix null pointer dereference issue Inki Dae
2014-11-20 23:12   ` Gustavo Padovan
2014-11-21  2:11     ` Inki Dae
2014-11-21 14:41       ` Gustavo Padovan [this message]
2014-11-22 15:28         ` Inki Dae
2014-11-22 15:40           ` Inki Dae
2014-11-13  7:50 ` [PATCH 2/2] drm/exynos: remove ifdeferry from initialization code Inki Dae

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=20141121144111.GC3123@joana \
    --to=gustavo@padovan.org \
    --cc=a.hajda@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.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