From: Inki Dae <inki.dae@samsung.com>
To: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Cc: dri-devel@lists.freedesktop.org, airlied@linux.ie,
linux-samsung-soc@vger.kernel.org, khilman@deeprootsystems.com
Subject: Re: [PATCH] drm/exynos: fix infinite loop issue incurred by no pair
Date: Tue, 18 Nov 2014 17:20:57 +0900 [thread overview]
Message-ID: <546B0169.4010602@samsung.com> (raw)
In-Reply-To: <1416297489.2480.5.camel@collabora.co.uk>
On 2014년 11월 18일 16:58, Sjoerd Simons wrote:
> On Tue, 2014-11-18 at 12:20 +0900, Inki Dae wrote:
>> This patch makes the deferred probe is tried up to 3 times in maximum.
>> However, this is considered only for Exynos drm so I think other SoC
>> drivers could also produce same issue. Therefore, the best way to resolve
>> this issue, infinite loop incurred by defered probe, would be that dd core
>> is fixed up corrrectly.
>
> At first sight this seems to make little to no sense. Unless i'm
> mistaken this would cause the exynos drm probe return -ENODEV to the dd
> core, causing it to stop trying to probe. Which obviously breaks your
> infinite loop, it also breaks situations where the probe needs to be
> retried more then 3 times.
Right, but at least, we could avoid kernel booting failure which is very
critical. Please know that this patch is temporary to avoid the kernel
booting failure although deferred probe request of Exynos drm could be
broken. For this, I will look into dd core to find out more generic way:
I suspect that this might be incurred in case that a driver is probed in
probe context of other driver or it might be really dd core bug.
Thanks,
Inki Dae
>
> I suspect with this patch once exynos DRM is loaded and actually validly
> needs to defer (iotw when the required modules do exist but simply
> aren't loaded just yet), it still jumps into an infinite loop which you
> break after 3 tries after which the display will simply never come up
> even if everything is in place because the core doesn't know it should
> re-probe....
>
>
>
>> Signed-off-by: Inki Dae <inki.dae@samsung.com>
>> ---
>> drivers/gpu/drm/exynos/exynos_drm_drv.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> index eab12f0..4d84f3a 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> @@ -38,6 +38,8 @@
>> #define DRIVER_MAJOR 1
>> #define DRIVER_MINOR 0
>>
>> +#define MAX_TRY_PROBE_DEFER 3
>> +
>> static struct platform_device *exynos_drm_pdev;
>>
>> static DEFINE_MUTEX(drm_component_lock);
>> @@ -481,6 +483,7 @@ static struct component_match *exynos_drm_match_add(struct device *dev)
>> struct component_match *match = NULL;
>> struct component_dev *cdev;
>> unsigned int attach_cnt = 0;
>> + static unsigned int try_probe_defer;
>>
>> mutex_lock(&drm_component_lock);
>>
>> @@ -527,6 +530,11 @@ out_lock:
>>
>> mutex_unlock(&drm_component_lock);
>>
>> + if (++try_probe_defer > MAX_TRY_PROBE_DEFER) {
>> + try_probe_defer = 0;
>> + return ERR_PTR(-ENODEV);
>> + }
>> +
>> return attach_cnt ? match : ERR_PTR(-EPROBE_DEFER);
>> }
>>
>
>
next prev parent reply other threads:[~2014-11-18 8:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 3:20 [PATCH] drm/exynos: fix infinite loop issue incurred by no pair Inki Dae
2014-11-18 7:58 ` Sjoerd Simons
2014-11-18 8:20 ` Inki Dae [this message]
2014-11-18 10:23 ` Javier Martinez Canillas
2014-11-18 10:45 ` Inki Dae
2014-11-18 10:48 ` Andrzej Hajda
2014-11-18 10:53 ` Javier Martinez Canillas
2014-11-18 13:31 ` 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=546B0169.4010602@samsung.com \
--to=inki.dae@samsung.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=khilman@deeprootsystems.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=sjoerd.simons@collabora.co.uk \
/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 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.