2015-06-27 13:22:26

by Philippe Reynes

[permalink] [raw]
Subject: imx: apf27: the board no longer boot with latest git kernel

Hi all,

I've tested the lastest linus git kernel, and this kernel
no longer boot on my armadeus apf27. The last line of the
log are (after, the kernel is stalled) :

[ 0.000000] CPU identified as i.MX27, silicon rev 2.1
[ 0.000000] Switching to timer-based delay loop, resolution 60ns
[ 0.000024] sched_clock: 32 bits at 16MHz, resolution 60ns, wraps every 129171917793ns
[ 0.008172] clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 114963006693 ns
[ 0.020252] Console: colour dummy device 80x30
[ 0.024894] Calibrating delay loop (skipped), value calculated using timer frequency..

I've done a bisect and the commit that raise this issue is :
db2ae4b4f6b79bd11d6461d41bd0966b0006f20b
ARM: imx: provide gpt device specific irq functions

Do you also reproduce this issue please ? or may be I've missed
to enable an new option ?

Regards,
Philippe


2015-06-27 17:06:10

by Fabio Estevam

[permalink] [raw]
Subject: Re: imx: apf27: the board no longer boot with latest git kernel

Hi Philippe,

On Sat, Jun 27, 2015 at 10:21 AM, Philippe Reynes <[email protected]> wrote:
> Hi all,
>
> I've tested the lastest linus git kernel, and this kernel
> no longer boot on my armadeus apf27. The last line of the
> log are (after, the kernel is stalled) :
>
> [ 0.000000] CPU identified as i.MX27, silicon rev 2.1
> [ 0.000000] Switching to timer-based delay loop, resolution 60ns
> [ 0.000024] sched_clock: 32 bits at 16MHz, resolution 60ns, wraps every
> 129171917793ns
> [ 0.008172] clocksource mxc_timer1: mask: 0xffffffff max_cycles:
> 0xffffffff, max_idle_ns: 114963006693 ns
> [ 0.020252] Console: colour dummy device 80x30
> [ 0.024894] Calibrating delay loop (skipped), value calculated using
> timer frequency..
>
> I've done a bisect and the commit that raise this issue is :
> db2ae4b4f6b79bd11d6461d41bd0966b0006f20b
> ARM: imx: provide gpt device specific irq functions
>
> Do you also reproduce this issue please ? or may be I've missed
> to enable an new option ?

I don't have access to a mx27 board at the moment, but I am wondering
if the change below would fix the problem:

--- a/drivers/clocksource/timer-imx-gpt.c
+++ b/drivers/clocksource/timer-imx-gpt.c
@@ -528,6 +528,7 @@ static void __init imx6dl_timer_init_dt(struct device_node *
}

CLOCKSOURCE_OF_DECLARE(imx1_timer, "fsl,imx1-gpt", imx1_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx27_timer, "fsl,imx27-gpt", imx1_timer_init_dt);
CLOCKSOURCE_OF_DECLARE(imx21_timer, "fsl,imx21-gpt", imx21_timer_init_dt);
CLOCKSOURCE_OF_DECLARE(imx31_timer, "fsl,imx31-gpt", imx31_timer_init_dt);
CLOCKSOURCE_OF_DECLARE(imx25_timer, "fsl,imx25-gpt", imx31_timer_init_dt);

Regards,

Fabio Estevam

2015-06-27 17:26:24

by Philippe Reynes

[permalink] [raw]
Subject: Re: imx: apf27: the board no longer boot with latest git kernel

Hi Fabio,

On 27/06/15 19:05, Fabio Estevam wrote:
> Hi Philippe,
>
> On Sat, Jun 27, 2015 at 10:21 AM, Philippe Reynes<[email protected]> wrote:
>> Hi all,
>>
>> I've tested the lastest linus git kernel, and this kernel
>> no longer boot on my armadeus apf27. The last line of the
>> log are (after, the kernel is stalled) :
>>
>> [ 0.000000] CPU identified as i.MX27, silicon rev 2.1
>> [ 0.000000] Switching to timer-based delay loop, resolution 60ns
>> [ 0.000024] sched_clock: 32 bits at 16MHz, resolution 60ns, wraps every
>> 129171917793ns
>> [ 0.008172] clocksource mxc_timer1: mask: 0xffffffff max_cycles:
>> 0xffffffff, max_idle_ns: 114963006693 ns
>> [ 0.020252] Console: colour dummy device 80x30
>> [ 0.024894] Calibrating delay loop (skipped), value calculated using
>> timer frequency..
>>
>> I've done a bisect and the commit that raise this issue is :
>> db2ae4b4f6b79bd11d6461d41bd0966b0006f20b
>> ARM: imx: provide gpt device specific irq functions
>>
>> Do you also reproduce this issue please ? or may be I've missed
>> to enable an new option ?
>
> I don't have access to a mx27 board at the moment, but I am wondering
> if the change below would fix the problem:

I've got one, and I can do the test.

> --- a/drivers/clocksource/timer-imx-gpt.c
> +++ b/drivers/clocksource/timer-imx-gpt.c
> @@ -528,6 +528,7 @@ static void __init imx6dl_timer_init_dt(struct device_node *
> }
>
> CLOCKSOURCE_OF_DECLARE(imx1_timer, "fsl,imx1-gpt", imx1_timer_init_dt);
> +CLOCKSOURCE_OF_DECLARE(imx27_timer, "fsl,imx27-gpt", imx1_timer_init_dt);
> CLOCKSOURCE_OF_DECLARE(imx21_timer, "fsl,imx21-gpt", imx21_timer_init_dt);
> CLOCKSOURCE_OF_DECLARE(imx31_timer, "fsl,imx31-gpt", imx31_timer_init_dt);
> CLOCKSOURCE_OF_DECLARE(imx25_timer, "fsl,imx25-gpt", imx31_timer_init_dt);

I've looked the code in drivers/clocksource/timer-imx-gpt.c, in the definition
of imx_gpt_type, there is :
GPT_TYPE_IMX21, /* i.MX21/27 */

So I've done a little change in your patch, I've used imx21_timer_init_dt for
imx27 :

--- a/drivers/clocksource/timer-imx-gpt.c
+++ b/drivers/clocksource/timer-imx-gpt.c
@@ -529,6 +529,7 @@ static void __init imx6dl_timer_init_dt(struct device_node *np)

CLOCKSOURCE_OF_DECLARE(imx1_timer, "fsl,imx1-gpt", imx1_timer_init_dt);
CLOCKSOURCE_OF_DECLARE(imx21_timer, "fsl,imx21-gpt", imx21_timer_init_dt);
+CLOCKSOURCE_OF_DECLARE(imx27_timer, "fsl,imx27-gpt", imx21_timer_init_dt);
CLOCKSOURCE_OF_DECLARE(imx31_timer, "fsl,imx31-gpt", imx31_timer_init_dt);
CLOCKSOURCE_OF_DECLARE(imx25_timer, "fsl,imx25-gpt", imx31_timer_init_dt);
CLOCKSOURCE_OF_DECLARE(imx50_timer, "fsl,imx50-gpt", imx31_timer_init_dt);

I've tested it, and it works fine, now my apf27 (imx27) boot without any issue.
So good catch, thanks a lot for this patch.

I may send a patch on lkml if you want.

> Regards,
>
> Fabio Estevam

Regards,
Philippe

2015-06-27 17:34:25

by Fabio Estevam

[permalink] [raw]
Subject: Re: imx: apf27: the board no longer boot with latest git kernel

On Sat, Jun 27, 2015 at 2:26 PM, Philippe Reynes <[email protected]> wrote:

> I've looked the code in drivers/clocksource/timer-imx-gpt.c, in the
> definition
> of imx_gpt_type, there is :
> GPT_TYPE_IMX21, /* i.MX21/27 */
>
> So I've done a little change in your patch, I've used imx21_timer_init_dt
> for
> imx27 :
>
> --- a/drivers/clocksource/timer-imx-gpt.c
> +++ b/drivers/clocksource/timer-imx-gpt.c
> @@ -529,6 +529,7 @@ static void __init imx6dl_timer_init_dt(struct
> device_node *np)
> CLOCKSOURCE_OF_DECLARE(imx1_timer, "fsl,imx1-gpt", imx1_timer_init_dt);
> CLOCKSOURCE_OF_DECLARE(imx21_timer, "fsl,imx21-gpt", imx21_timer_init_dt);
> +CLOCKSOURCE_OF_DECLARE(imx27_timer, "fsl,imx27-gpt", imx21_timer_init_dt);
> CLOCKSOURCE_OF_DECLARE(imx31_timer, "fsl,imx31-gpt", imx31_timer_init_dt);
> CLOCKSOURCE_OF_DECLARE(imx25_timer, "fsl,imx25-gpt", imx31_timer_init_dt);
> CLOCKSOURCE_OF_DECLARE(imx50_timer, "fsl,imx50-gpt", imx31_timer_init_dt);
>
> I've tested it, and it works fine, now my apf27 (imx27) boot without any
> issue.
> So good catch, thanks a lot for this patch.

Excellent :-)

>
> I may send a patch on lkml if you want.

Yes, please submit a formal patch.

I thought it was imx1_timer_init_dt because in imx27.dtsi we have:

compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";

So I am wondering if this is correct or it should be

compatible = "fsl,imx27-gpt", "fsl,imx21-gpt"; instead?

Regards,

Fabio Estevam

2015-06-27 19:17:17

by Fabio Estevam

[permalink] [raw]
Subject: Re: imx: apf27: the board no longer boot with latest git kernel

Philippe,

On Sat, Jun 27, 2015 at 2:34 PM, Fabio Estevam <[email protected]> wrote:

> Yes, please submit a formal patch.
>
> I thought it was imx1_timer_init_dt because in imx27.dtsi we have:
>
> compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
>
> So I am wondering if this is correct or it should be
>
> compatible = "fsl,imx27-gpt", "fsl,imx21-gpt"; instead?

In addition to the drivers/clocksource/timer-imx-gpt.c patch, could
you also try the change below?

--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -108,7 +108,7 @@
};

gpt1: timer@10003000 {
- compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
reg = <0x10003000 0x1000>;
interrupts = <26>;
clocks = <&clks IMX27_CLK_GPT1_IPG_GATE>,
@@ -117,7 +117,7 @@
};

gpt2: timer@10004000 {
- compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
reg = <0x10004000 0x1000>;
interrupts = <25>;
clocks = <&clks IMX27_CLK_GPT2_IPG_GATE>,
@@ -126,7 +126,7 @@
};

gpt3: timer@10005000 {
- compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
reg = <0x10005000 0x1000>;
interrupts = <24>;
clocks = <&clks IMX27_CLK_GPT3_IPG_GATE>,
@@ -376,7 +376,7 @@
};

gpt4: timer@10019000 {
- compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
reg = <0x10019000 0x1000>;
interrupts = <4>;
clocks = <&clks IMX27_CLK_GPT4_IPG_GATE>,
@@ -385,7 +385,7 @@
};

gpt5: timer@1001a000 {
- compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
reg = <0x1001a000 0x1000>;
interrupts = <3>;
clocks = <&clks IMX27_CLK_GPT5_IPG_GATE>,
@@ -436,7 +436,7 @@
};

gpt6: timer@1001f000 {
- compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
+ compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
reg = <0x1001f000 0x1000>;
interrupts = <2>;
clocks = <&clks IMX27_CLK_GPT6_IPG_GATE>,

2015-06-27 20:38:24

by Philippe Reynes

[permalink] [raw]
Subject: Re: imx: apf27: the board no longer boot with latest git kernel

Hi Fabio,

On 27/06/15 21:17, Fabio Estevam wrote:
> Philippe,
>
> On Sat, Jun 27, 2015 at 2:34 PM, Fabio Estevam<[email protected]> wrote:
>
>> Yes, please submit a formal patch.
>>
>> I thought it was imx1_timer_init_dt because in imx27.dtsi we have:
>>
>> compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
>>
>> So I am wondering if this is correct or it should be
>>
>> compatible = "fsl,imx27-gpt", "fsl,imx21-gpt"; instead?
>
> In addition to the drivers/clocksource/timer-imx-gpt.c patch, could
> you also try the change below?

Yes, I do it

> --- a/arch/arm/boot/dts/imx27.dtsi
> +++ b/arch/arm/boot/dts/imx27.dtsi
> @@ -108,7 +108,7 @@
> };
>
> gpt1: timer@10003000 {
> - compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
> + compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
> reg =<0x10003000 0x1000>;
> interrupts =<26>;
> clocks =<&clks IMX27_CLK_GPT1_IPG_GATE>,
> @@ -117,7 +117,7 @@
> };
>
> gpt2: timer@10004000 {
> - compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
> + compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
> reg =<0x10004000 0x1000>;
> interrupts =<25>;
> clocks =<&clks IMX27_CLK_GPT2_IPG_GATE>,
> @@ -126,7 +126,7 @@
> };
>
> gpt3: timer@10005000 {
> - compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
> + compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
> reg =<0x10005000 0x1000>;
> interrupts =<24>;
> clocks =<&clks IMX27_CLK_GPT3_IPG_GATE>,
> @@ -376,7 +376,7 @@
> };
>
> gpt4: timer@10019000 {
> - compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
> + compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
> reg =<0x10019000 0x1000>;
> interrupts =<4>;
> clocks =<&clks IMX27_CLK_GPT4_IPG_GATE>,
> @@ -385,7 +385,7 @@
> };
>
> gpt5: timer@1001a000 {
> - compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
> + compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
> reg =<0x1001a000 0x1000>;
> interrupts =<3>;
> clocks =<&clks IMX27_CLK_GPT5_IPG_GATE>,
> @@ -436,7 +436,7 @@
> };
>
> gpt6: timer@1001f000 {
> - compatible = "fsl,imx27-gpt", "fsl,imx1-gpt";
> + compatible = "fsl,imx27-gpt", "fsl,imx21-gpt";
> reg =<0x1001f000 0x1000>;
> interrupts =<2>;
> clocks =<&clks IMX27_CLK_GPT6_IPG_GATE>,

I've tested this change, and it works fine.
In the file drivers/clocksource/timer-imx-gpt.c, there is :
#define imx21_gpt_irq_disable imx1_gpt_irq_disable
#define imx21_gpt_irq_enable imx1_gpt_irq_enable
So I think that using imx1 or imx21 has the same result;

Do you think I should put both change in on patch ?
Or is it better to do two patches please ?

Regards,
Philippe

2015-06-27 20:48:29

by Fabio Estevam

[permalink] [raw]
Subject: Re: imx: apf27: the board no longer boot with latest git kernel

Hi Philippe,

On Sat, Jun 27, 2015 at 5:38 PM, Philippe Reynes <[email protected]> wrote:

> I've tested this change, and it works fine.
> In the file drivers/clocksource/timer-imx-gpt.c, there is :
> #define imx21_gpt_irq_disable imx1_gpt_irq_disable
> #define imx21_gpt_irq_enable imx1_gpt_irq_enable
> So I think that using imx1 or imx21 has the same result;
>
> Do you think I should put both change in on patch ?
> Or is it better to do two patches please ?

I think they should be separate patches.

Let's do the following: you sent the
drivers/clocksource/timer-imx-gpt.c fix and I will send the dtsi
change.

Thanks,

Fabio Estevam