diff mbox

gpmc_cs_request() causes early boot hang

Message ID C8443D0743D26F4388EA172BF4E2A7A93E9E7881@DBDE01.ent.ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Afzal Mohammed Sept. 24, 2012, 11:13 a.m. UTC
Hi Mark,

On Mon, Sep 24, 2012 at 16:21:40, Mark Jackson wrote:
> On 24/09/12 05:51, Mohammed, Afzal wrote:


> > It seems you are using PSP Kernel.

> > 

> > Invoking omap_init_gpmc before gpmc request should help.

> 

> Okay ... I'm now using earlyprintk and omap_init_gpmc(), but I still get boot hangs.


> Surely omap-gpmc needs to be setup before any calls such as gpmc_cs_request() ?

> 

> Is there a method to delay my test code, or maybe get the omap-gpmc registered earlier ?


Hope below patch helps you (untested)

Regards
Afzal

----8<-------------------

----8<----------------

Comments

Mark Jackson Sept. 24, 2012, 11:26 a.m. UTC | #1
On 24/09/12 12:13, Mohammed, Afzal wrote:
> Hi Mark,
> 
> On Mon, Sep 24, 2012 at 16:21:40, Mark Jackson wrote:
>> On 24/09/12 05:51, Mohammed, Afzal wrote:
> 
>>> It seems you are using PSP Kernel.
>>>
>>> Invoking omap_init_gpmc before gpmc request should help.
>>
>> Okay ... I'm now using earlyprintk and omap_init_gpmc(), but I still get boot hangs.
> 
>> Surely omap-gpmc needs to be setup before any calls such as gpmc_cs_request() ?
>>
>> Is there a method to delay my test code, or maybe get the omap-gpmc registered earlier ?
> 
> Hope below patch helps you (untested)
> 
> Regards
> Afzal
> 
> ----8<-------------------
> 
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index 1c53c05..a4c6912 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -827,7 +827,19 @@ static struct platform_driver gpmc_driver = {
>         },
>  };
>  
> -module_platform_driver(gpmc_driver);
> +static __init int gpmc_init(void)
> +{
> +        return platform_driver_register(&gpmc_driver);
> +}
> +
> +static __exit void gpmc_exit(void)
> +{
> +        platform_driver_unregister(&gpmc_driver);
> +
> +}
> +
> +postcore_initcall(gpmc_init);
> +module_exit(gpmc_exit);
>  
>  int gpmc_suspend(void)
>  {
> ----8<----------------

Perfect !!

I also got it working by adding "late_init()" hooks into arch/arm/kernel/setup.c, but your code is
much simpler.

Regards
Mark J.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 1c53c05..a4c6912 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -827,7 +827,19 @@  static struct platform_driver gpmc_driver = {
        },
 };
 
-module_platform_driver(gpmc_driver);
+static __init int gpmc_init(void)
+{
+        return platform_driver_register(&gpmc_driver);
+}
+
+static __exit void gpmc_exit(void)
+{
+        platform_driver_unregister(&gpmc_driver);
+
+}
+
+postcore_initcall(gpmc_init);
+module_exit(gpmc_exit);
 
 int gpmc_suspend(void)
 {