diff mbox

drm/exynos: Make exynos_drm_init() call late during the bootup

Message ID 1400067585-31236-1-git-send-email-ch.naveen@samsung.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Naveen Krishna Chatradhi May 14, 2014, 11:39 a.m. UTC
exynos_drm_init() does probing of various drivers like dp_panel,
hdmi, fimd, mixer, etc in an order and finally binds them together.

Some of the drm devices (Eg: dp_panel) try to do regulator_get()
and enable few supplies during their probe.
Chances are that, these devices may get probed before the respective
supply/PMIC is hooked.  In such cases, dp_panel would continue with
"dummy regulator". Which is not what the system wants.

Lets give the core connectivity and regulators modules some time
to hookup the supplies before Exynos DRM devices comes into picture.

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
---
This change is proposed after
1. Discussing with I2C/SPI & DMA subsystem maintainers and Others
   @ https://lkml.org/lkml/2014/5/9/333
   Trying to change the I2C, SPI and DMA drivers as subsys_initcall()
   Which was strictly opposed, as a flaw was found in DRM subsystem.

2. -EPROBE_DEFER won't work well with the current sequency of
    platform_driver_register()s in exynos_drm_init()

3. bridge_panel mechanism is under RFC and no conclusions were drawn yet.

We should be able to probe each DRM device independently and let PROBE_DEFER
take care of dependencies. But, this could cause lot of bootup time.

late_initcall() of DRM works well and fixes all the above issues for now.
Kindly suggest, if an alternative/better mechanism is out there.

Thanks,
 drivers/gpu/drm/exynos/exynos_drm_drv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Naveen Krishna Ch May 21, 2014, 6:39 a.m. UTC | #1
Hello Everyone,

On 14 May 2014 17:09, Naveen Krishna Chatradhi <ch.naveen@samsung.com> wrote:
> exynos_drm_init() does probing of various drivers like dp_panel,
> hdmi, fimd, mixer, etc in an order and finally binds them together.
>
> Some of the drm devices (Eg: dp_panel) try to do regulator_get()
> and enable few supplies during their probe.
> Chances are that, these devices may get probed before the respective
> supply/PMIC is hooked.  In such cases, dp_panel would continue with
> "dummy regulator". Which is not what the system wants.
>
> Lets give the core connectivity and regulators modules some time
> to hookup the supplies before Exynos DRM devices comes into picture.
>
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> ---
> This change is proposed after
> 1. Discussing with I2C/SPI & DMA subsystem maintainers and Others
>    @ https://lkml.org/lkml/2014/5/9/333
>    Trying to change the I2C, SPI and DMA drivers as subsys_initcall()
>    Which was strictly opposed, as a flaw was found in DRM subsystem.
>
> 2. -EPROBE_DEFER won't work well with the current sequency of
>     platform_driver_register()s in exynos_drm_init()
>
> 3. bridge_panel mechanism is under RFC and no conclusions were drawn yet.
>
> We should be able to probe each DRM device independently and let PROBE_DEFER
> take care of dependencies. But, this could cause lot of bootup time.
>
> late_initcall() of DRM works well and fixes all the above issues for now.
> Kindly suggest, if an alternative/better mechanism is out there.
>
> Thanks,
>  drivers/gpu/drm/exynos/exynos_drm_drv.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 4cef88f..78c185a 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -692,7 +692,7 @@ static void exynos_drm_exit(void)
>         platform_driver_unregister(&exynos_drm_platform_driver);
>  }
>
> -module_init(exynos_drm_init);
> +late_initcall(exynos_drm_init);
>  module_exit(exynos_drm_exit);
>
>  MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
Kindly, show some light on this change.
Also adding more reviewers.
> --
> 1.7.9.5
>
Thierry Reding May 21, 2014, 3:46 p.m. UTC | #2
On Wed, May 14, 2014 at 05:09:45PM +0530, Naveen Krishna Chatradhi wrote:
> exynos_drm_init() does probing of various drivers like dp_panel,
> hdmi, fimd, mixer, etc in an order and finally binds them together.
> 
> Some of the drm devices (Eg: dp_panel) try to do regulator_get()
> and enable few supplies during their probe.
> Chances are that, these devices may get probed before the respective
> supply/PMIC is hooked.  In such cases, dp_panel would continue with
> "dummy regulator". Which is not what the system wants.
> 
> Lets give the core connectivity and regulators modules some time
> to hookup the supplies before Exynos DRM devices comes into picture.
> 
> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
> ---
> This change is proposed after
> 1. Discussing with I2C/SPI & DMA subsystem maintainers and Others
>    @ https://lkml.org/lkml/2014/5/9/333
>    Trying to change the I2C, SPI and DMA drivers as subsys_initcall()
>    Which was strictly opposed, as a flaw was found in DRM subsystem.
> 
> 2. -EPROBE_DEFER won't work well with the current sequency of
>     platform_driver_register()s in exynos_drm_init()

Then this is the problem that you need to fix. If the driver doesn't
handle -EPROBE_DEFER properly then that means the driver is broken. No
amount of initcall ordering can fix this for you.

Thierry
Naveen Krishna Ch May 26, 2014, 5:39 a.m. UTC | #3
Hello Everyone,

On 21 May 2014 21:16, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Wed, May 14, 2014 at 05:09:45PM +0530, Naveen Krishna Chatradhi wrote:
>> exynos_drm_init() does probing of various drivers like dp_panel,
>> hdmi, fimd, mixer, etc in an order and finally binds them together.
>>
>> Some of the drm devices (Eg: dp_panel) try to do regulator_get()
>> and enable few supplies during their probe.
>> Chances are that, these devices may get probed before the respective
>> supply/PMIC is hooked.  In such cases, dp_panel would continue with
>> "dummy regulator". Which is not what the system wants.
>>
>> Lets give the core connectivity and regulators modules some time
>> to hookup the supplies before Exynos DRM devices comes into picture.
>>
>> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>> ---
>> This change is proposed after
>> 1. Discussing with I2C/SPI & DMA subsystem maintainers and Others
>>    @ https://lkml.org/lkml/2014/5/9/333
>>    Trying to change the I2C, SPI and DMA drivers as subsys_initcall()
>>    Which was strictly opposed, as a flaw was found in DRM subsystem.
>>
>> 2. -EPROBE_DEFER won't work well with the current sequency of
>>     platform_driver_register()s in exynos_drm_init()
>
> Then this is the problem that you need to fix. If the driver doesn't
> handle -EPROBE_DEFER properly then that means the driver is broken. No
> amount of initcall ordering can fix this for you.

We seem to have a problem with the probe sequencing and usage of _EPROBE_DEFER
in DRM.  Component way of registration doesnt seem to fix everything.

Inki Dae,
Is there any discussion or approach underway.
Anyone working on this.
>
> Thierry
Inki Dae May 27, 2014, 1:02 p.m. UTC | #4
On 2014? 05? 26? 14:39, Naveen Krishna Ch wrote:
> Hello Everyone,
> 
> On 21 May 2014 21:16, Thierry Reding <thierry.reding@gmail.com> wrote:
>> On Wed, May 14, 2014 at 05:09:45PM +0530, Naveen Krishna Chatradhi wrote:
>>> exynos_drm_init() does probing of various drivers like dp_panel,
>>> hdmi, fimd, mixer, etc in an order and finally binds them together.
>>>
>>> Some of the drm devices (Eg: dp_panel) try to do regulator_get()
>>> and enable few supplies during their probe.
>>> Chances are that, these devices may get probed before the respective
>>> supply/PMIC is hooked.  In such cases, dp_panel would continue with
>>> "dummy regulator". Which is not what the system wants.
>>>
>>> Lets give the core connectivity and regulators modules some time
>>> to hookup the supplies before Exynos DRM devices comes into picture.
>>>
>>> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>> ---
>>> This change is proposed after
>>> 1. Discussing with I2C/SPI & DMA subsystem maintainers and Others
>>>    @ https://lkml.org/lkml/2014/5/9/333
>>>    Trying to change the I2C, SPI and DMA drivers as subsys_initcall()
>>>    Which was strictly opposed, as a flaw was found in DRM subsystem.
>>>
>>> 2. -EPROBE_DEFER won't work well with the current sequency of
>>>     platform_driver_register()s in exynos_drm_init()
>>
>> Then this is the problem that you need to fix. If the driver doesn't
>> handle -EPROBE_DEFER properly then that means the driver is broken. No
>> amount of initcall ordering can fix this for you.
> 
> We seem to have a problem with the probe sequencing and usage of _EPROBE_DEFER
> in DRM.  Component way of registration doesnt seem to fix everything.
> 
> Inki Dae,
> Is there any discussion or approach underway.
> Anyone working on this.

Hi,

I have just posted a patch series, [PATCH 0/2] drm/exynos: consider
deferred probe case, to resolve that issue. With this, it wouldn't need
your patch anymore.

Thanks,
Inki Dae

>>
>> Thierry
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 4cef88f..78c185a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -692,7 +692,7 @@  static void exynos_drm_exit(void)
 	platform_driver_unregister(&exynos_drm_platform_driver);
 }
 
-module_init(exynos_drm_init);
+late_initcall(exynos_drm_init);
 module_exit(exynos_drm_exit);
 
 MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");