public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nand: gpmi-nand: Fix clock registration
@ 2012-09-23 18:31 Fabio Estevam
  2012-10-08  2:45 ` Huang Shijie
  0 siblings, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2012-09-23 18:31 UTC (permalink / raw)
  To: artem.bityutskiy; +Cc: marex, b32955, shawn.guo, linux-mtd, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

On a mx28 board the following error happens since commit 638064e56c 
(mtd: gpmi: change the code for clocks):

gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12

Acquire the clock using "NULL" as it was done previously, so that the driver
can register on mx23/mx28 as well.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index c46be6c..1f23cb4 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
 	int i;
 
 	/* The main clock is stored in the first. */
-	r->clock[0] = clk_get(this->dev, "gpmi_io");
+	r->clock[0] = clk_get(this->dev, NULL);
 	if (IS_ERR(r->clock[0]))
 		goto err_clock;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-09-23 18:31 [PATCH] nand: gpmi-nand: Fix clock registration Fabio Estevam
@ 2012-10-08  2:45 ` Huang Shijie
  2012-10-08  3:15   ` Marek Vasut
  2012-10-08  3:22   ` Fabio Estevam
  0 siblings, 2 replies; 12+ messages in thread
From: Huang Shijie @ 2012-10-08  2:45 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: marex, artem.bityutskiy, shawn.guo, linux-mtd, Fabio Estevam

于 2012年09月24日 02:31, Fabio Estevam 写道:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> On a mx28 board the following error happens since commit 638064e56c 
> (mtd: gpmi: change the code for clocks):
>
> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>
> Acquire the clock using "NULL" as it was done previously, so that the driver
> can register on mx23/mx28 as well.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index c46be6c..1f23cb4 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
>  	int i;
>  
>  	/* The main clock is stored in the first. */
> -	r->clock[0] = clk_get(this->dev, "gpmi_io");
> +	r->clock[0] = clk_get(this->dev, NULL);
Please do not change this line.

The gpmi_io is for mx6q.
If you replace it with `NULL`. The mx6q can not find the proper clock.

thanks
Huang Shijie
>  	if (IS_ERR(r->clock[0]))
>  		goto err_clock;
>  

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  2:45 ` Huang Shijie
@ 2012-10-08  3:15   ` Marek Vasut
  2012-10-08  3:34     ` Huang Shijie
  2012-10-08  3:22   ` Fabio Estevam
  1 sibling, 1 reply; 12+ messages in thread
From: Marek Vasut @ 2012-10-08  3:15 UTC (permalink / raw)
  To: Huang Shijie
  Cc: Fabio Estevam, artem.bityutskiy, shawn.guo, Fabio Estevam,
	linux-mtd

Dear Huang Shijie,

> 于 2012年09月24日 02:31, Fabio Estevam 写道:
> > From: Fabio Estevam <fabio.estevam@freescale.com>
> > 
> > On a mx28 board the following error happens since commit 638064e56c
> > (mtd: gpmi: change the code for clocks):
> > 
> > gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
> > 
> > Acquire the clock using "NULL" as it was done previously, so that the
> > driver can register on mx23/mx28 as well.
> > 
> > Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> > 
> >  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index c46be6c..1f23cb4 100644
> > --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct
> > gpmi_nand_data *this)
> > 
> >  	int i;
> >  	
> >  	/* The main clock is stored in the first. */
> > 
> > -	r->clock[0] = clk_get(this->dev, "gpmi_io");
> > +	r->clock[0] = clk_get(this->dev, NULL);
> 
> Please do not change this line.
> 
> The gpmi_io is for mx6q.
> If you replace it with `NULL`. The mx6q can not find the proper clock.

Suggestion is really welcome though, please :) This is a problem, GPMI NAND is 
broken on anything != mx6q. Huang, can you please also test the changes you do 
to GPMI NAND on mx28/mx23 so we can avoid this breakage in the future?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  2:45 ` Huang Shijie
  2012-10-08  3:15   ` Marek Vasut
@ 2012-10-08  3:22   ` Fabio Estevam
  2012-10-08  3:32     ` Huang Shijie
  2012-10-10  2:44     ` Huang Shijie
  1 sibling, 2 replies; 12+ messages in thread
From: Fabio Estevam @ 2012-10-08  3:22 UTC (permalink / raw)
  To: Huang Shijie; +Cc: marex, artem.bityutskiy, shawn.guo, linux-mtd, Fabio Estevam

On Sun, Oct 7, 2012 at 11:45 PM, Huang Shijie <b32955@freescale.com> wrote:
> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> On a mx28 board the following error happens since commit 638064e56c
>> (mtd: gpmi: change the code for clocks):
>>
>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>>
>> Acquire the clock using "NULL" as it was done previously, so that the driver
>> can register on mx23/mx28 as well.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>> ---
>>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> index c46be6c..1f23cb4 100644
>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
>>       int i;
>>
>>       /* The main clock is stored in the first. */
>> -     r->clock[0] = clk_get(this->dev, "gpmi_io");
>> +     r->clock[0] = clk_get(this->dev, NULL);
> Please do not change this line.
>
> The gpmi_io is for mx6q.
> If you replace it with `NULL`. The mx6q can not find the proper clock.

What about this?

index 42978f1b..7b1aded 100644
--- a/drivers/clk/mxs/clk-imx28.c
+++ b/drivers/clk/mxs/clk-imx28.c
@@ -139,7 +139,7 @@ enum imx28_clk {
        ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll,
        emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div,
        clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0,
-       ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm,
+       ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm,
        fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out,
        clk_max
 };
@@ -208,7 +208,7 @@ int __init mx28_clocks_init(void)
        clks[ssp1] = mxs_clk_gate("ssp1", "ssp1_div", SSP1, 31);
        clks[ssp2] = mxs_clk_gate("ssp2", "ssp2_div", SSP2, 31);
        clks[ssp3] = mxs_clk_gate("ssp3", "ssp3_div", SSP3, 31);
-       clks[gpmi] = mxs_clk_gate("gpmi", "gpmi_div", GPMI, 31);
+       clks[gpmi_io] = mxs_clk_gate("gpmi_io", "gpmi_div", GPMI, 31);
        clks[spdif] = mxs_clk_gate("spdif", "spdif_div", SPDIF, 31);
        clks[emi] = mxs_clk_gate("emi", "emi_sel", EMI, 31);
        clks[saif0] = mxs_clk_gate("saif0", "saif0_div", SAIF0, 31);

Can you please test it on mx28?

Regards,

Fabio Estevam

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:32     ` Huang Shijie
@ 2012-10-08  3:31       ` Fabio Estevam
  2012-10-08  3:46         ` Fabio Estevam
  2012-10-08  4:53         ` Huang Shijie
  0 siblings, 2 replies; 12+ messages in thread
From: Fabio Estevam @ 2012-10-08  3:31 UTC (permalink / raw)
  To: Huang Shijie; +Cc: marex, artem.bityutskiy, shawn.guo, linux-mtd, Fabio Estevam

On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie <b32955@freescale.com> wrote:
>
> This patch is really not needed.
>
> The clk_get() can get the right clock in the mx23/mx28. I tested them.

Please test it on linux-next.

gpmi nand can not event be probed.

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:22   ` Fabio Estevam
@ 2012-10-08  3:32     ` Huang Shijie
  2012-10-08  3:31       ` Fabio Estevam
  2012-10-10  2:44     ` Huang Shijie
  1 sibling, 1 reply; 12+ messages in thread
From: Huang Shijie @ 2012-10-08  3:32 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: marex, artem.bityutskiy, shawn.guo, linux-mtd, Fabio Estevam

于 2012年10月08日 11:22, Fabio Estevam 写道:
> On Sun, Oct 7, 2012 at 11:45 PM, Huang Shijie <b32955@freescale.com> wrote:
>> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>>
>>> On a mx28 board the following error happens since commit 638064e56c
>>> (mtd: gpmi: change the code for clocks):
>>>
>>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>>>
>>> Acquire the clock using "NULL" as it was done previously, so that the driver
>>> can register on mx23/mx28 as well.
>>>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>>> ---
>>>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> index c46be6c..1f23cb4 100644
>>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
>>>       int i;
>>>
>>>       /* The main clock is stored in the first. */
>>> -     r->clock[0] = clk_get(this->dev, "gpmi_io");
>>> +     r->clock[0] = clk_get(this->dev, NULL);
>> Please do not change this line.
>>
>> The gpmi_io is for mx6q.
>> If you replace it with `NULL`. The mx6q can not find the proper clock.
> What about this?
>
> index 42978f1b..7b1aded 100644
> --- a/drivers/clk/mxs/clk-imx28.c
> +++ b/drivers/clk/mxs/clk-imx28.c
> @@ -139,7 +139,7 @@ enum imx28_clk {
>         ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll,
>         emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div,
>         clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0,
> -       ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm,
> +       ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm,
>         fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out,
>         clk_max
>  };
> @@ -208,7 +208,7 @@ int __init mx28_clocks_init(void)
>         clks[ssp1] = mxs_clk_gate("ssp1", "ssp1_div", SSP1, 31);
>         clks[ssp2] = mxs_clk_gate("ssp2", "ssp2_div", SSP2, 31);
>         clks[ssp3] = mxs_clk_gate("ssp3", "ssp3_div", SSP3, 31);
> -       clks[gpmi] = mxs_clk_gate("gpmi", "gpmi_div", GPMI, 31);
> +       clks[gpmi_io] = mxs_clk_gate("gpmi_io", "gpmi_div", GPMI, 31);
:)

This patch is really not needed.

The clk_get() can get the right clock in the mx23/mx28. I tested them.

Please read the code of clk_get().


BR
Huang Shijie


>         clks[spdif] = mxs_clk_gate("spdif", "spdif_div", SPDIF, 31);
>         clks[emi] = mxs_clk_gate("emi", "emi_sel", EMI, 31);
>         clks[saif0] = mxs_clk_gate("saif0", "saif0_div", SAIF0, 31);
>
> Can you please test it on mx28?
>
> Regards,
>
> Fabio Estevam
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:15   ` Marek Vasut
@ 2012-10-08  3:34     ` Huang Shijie
  2012-10-08  3:37       ` Marek Vasut
  0 siblings, 1 reply; 12+ messages in thread
From: Huang Shijie @ 2012-10-08  3:34 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Fabio Estevam, artem.bityutskiy, shawn.guo, Fabio Estevam,
	linux-mtd

于 2012年10月08日 11:15, Marek Vasut 写道:
> Dear Huang Shijie,
>
>> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>>
>>> On a mx28 board the following error happens since commit 638064e56c
>>> (mtd: gpmi: change the code for clocks):
>>>
>>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>>>
>>> Acquire the clock using "NULL" as it was done previously, so that the
>>> driver can register on mx23/mx28 as well.
>>>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>>> ---
>>>
>>>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index c46be6c..1f23cb4 100644
>>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct
>>> gpmi_nand_data *this)
>>>
>>>  	int i;
>>>  	
>>>  	/* The main clock is stored in the first. */
>>>
>>> -	r->clock[0] = clk_get(this->dev, "gpmi_io");
>>> +	r->clock[0] = clk_get(this->dev, NULL);
>> Please do not change this line.
>>
>> The gpmi_io is for mx6q.
>> If you replace it with `NULL`. The mx6q can not find the proper clock.
> Suggestion is really welcome though, please :) This is a problem, GPMI NAND is 
> broken on anything != mx6q. Huang, can you please also test the changes you do 
> to GPMI NAND on mx28/mx23 so we can avoid this breakage in the future?
yes. I tested in the mx23/mx28. It's ok, do not worry.

BR
Huang Shijie
> Best regards,
> Marek Vasut
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:34     ` Huang Shijie
@ 2012-10-08  3:37       ` Marek Vasut
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2012-10-08  3:37 UTC (permalink / raw)
  To: Huang Shijie
  Cc: Fabio Estevam, artem.bityutskiy, shawn.guo, Fabio Estevam,
	linux-mtd

Dear Huang Shijie,

> 于 2012年10月08日 11:15, Marek Vasut 写道:
> > Dear Huang Shijie,
> > 
> >> 于 2012年09月24日 02:31, Fabio Estevam 写道:
> >>> From: Fabio Estevam <fabio.estevam@freescale.com>
> >>> 
> >>> On a mx28 board the following error happens since commit 638064e56c
> >>> (mtd: gpmi: change the code for clocks):
> >>> 
> >>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
> >>> 
> >>> Acquire the clock using "NULL" as it was done previously, so that the
> >>> driver can register on mx23/mx28 as well.
> >>> 
> >>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> >>> ---
> >>> 
> >>>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>> 
> >>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> >>> b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index c46be6c..1f23cb4 100644
> >>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> >>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> >>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct
> >>> gpmi_nand_data *this)
> >>> 
> >>>  	int i;
> >>>  	
> >>>  	/* The main clock is stored in the first. */
> >>> 
> >>> -	r->clock[0] = clk_get(this->dev, "gpmi_io");
> >>> +	r->clock[0] = clk_get(this->dev, NULL);
> >> 
> >> Please do not change this line.
> >> 
> >> The gpmi_io is for mx6q.
> >> If you replace it with `NULL`. The mx6q can not find the proper clock.
> > 
> > Suggestion is really welcome though, please :) This is a problem, GPMI
> > NAND is broken on anything != mx6q. Huang, can you please also test the
> > changes you do to GPMI NAND on mx28/mx23 so we can avoid this breakage
> > in the future?
> 
> yes. I tested in the mx23/mx28. It's ok, do not worry.

I won't be posting here that it's broken in the first place if it was ok ;-)

Give it one more go with latest -next ...

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:31       ` Fabio Estevam
@ 2012-10-08  3:46         ` Fabio Estevam
  2012-10-08  3:52           ` Marek Vasut
  2012-10-08  4:53         ` Huang Shijie
  1 sibling, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2012-10-08  3:46 UTC (permalink / raw)
  To: Huang Shijie; +Cc: marex, artem.bityutskiy, shawn.guo, linux-mtd, Fabio Estevam

On Mon, Oct 8, 2012 at 12:31 AM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie <b32955@freescale.com> wrote:
>>
>> This patch is really not needed.
>>
>> The clk_get() can get the right clock in the mx23/mx28. I tested them.
>
> Please test it on linux-next.
>
> gpmi nand can not event be probed.

What about this?

--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -495,7 +495,11 @@ static int __devinit gpmi_get_clks(struct
gpmi_nand_data *this)
        int i;

        /* The main clock is stored in the first. */
-       r->clock[0] = clk_get(this->dev, "gpmi_io");
+       if (GPMI_IS_MX6Q(this))
+               r->clock[0] = clk_get(this->dev, "gpmi_io");
+       else
+               r->clock[0] = clk_get(this->dev, NULL);
+
        if (IS_ERR(r->clock[0]))
                goto err_clock;

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:46         ` Fabio Estevam
@ 2012-10-08  3:52           ` Marek Vasut
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2012-10-08  3:52 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Fabio Estevam, Huang Shijie, shawn.guo, linux-mtd,
	artem.bityutskiy

Dear Fabio Estevam,

> On Mon, Oct 8, 2012 at 12:31 AM, Fabio Estevam <festevam@gmail.com> wrote:
> > On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie <b32955@freescale.com> wrote:
> >> This patch is really not needed.
> >> 
> >> The clk_get() can get the right clock in the mx23/mx28. I tested them.
> > 
> > Please test it on linux-next.
> > 
> > gpmi nand can not event be probed.
> 
> What about this?

I don't like this one ... such condition shouldn't be in the driver.

> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -495,7 +495,11 @@ static int __devinit gpmi_get_clks(struct
> gpmi_nand_data *this)
>         int i;
> 
>         /* The main clock is stored in the first. */
> -       r->clock[0] = clk_get(this->dev, "gpmi_io");
> +       if (GPMI_IS_MX6Q(this))
> +               r->clock[0] = clk_get(this->dev, "gpmi_io");
> +       else
> +               r->clock[0] = clk_get(this->dev, NULL);
> +
>         if (IS_ERR(r->clock[0]))
>                 goto err_clock;

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:31       ` Fabio Estevam
  2012-10-08  3:46         ` Fabio Estevam
@ 2012-10-08  4:53         ` Huang Shijie
  1 sibling, 0 replies; 12+ messages in thread
From: Huang Shijie @ 2012-10-08  4:53 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: marex, artem.bityutskiy, shawn.guo, linux-mtd, Fabio Estevam

于 2012年10月08日 11:31, Fabio Estevam 写道:
> On Mon, Oct 8, 2012 at 12:32 AM, Huang Shijie<b32955@freescale.com>  wrote:
>> This patch is really not needed.
>>
>> The clk_get() can get the right clock in the mx23/mx28. I tested them.
> Please test it on linux-next.
>
> gpmi nand can not event be probed.
ok.

I will test the linux-next as soon as possible.


BR
Huang Shijie
> Regards,
>
> Fabio Estevam
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] nand: gpmi-nand: Fix clock registration
  2012-10-08  3:22   ` Fabio Estevam
  2012-10-08  3:32     ` Huang Shijie
@ 2012-10-10  2:44     ` Huang Shijie
  1 sibling, 0 replies; 12+ messages in thread
From: Huang Shijie @ 2012-10-10  2:44 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: marex, artem.bityutskiy, shawn.guo, linux-mtd, Fabio Estevam

于 2012年10月08日 11:22, Fabio Estevam 写道:
> On Sun, Oct 7, 2012 at 11:45 PM, Huang Shijie<b32955@freescale.com>  wrote:
>> 于 2012年09月24日 02:31, Fabio Estevam 写道:
>>> From: Fabio Estevam<fabio.estevam@freescale.com>
>>>
>>> On a mx28 board the following error happens since commit 638064e56c
>>> (mtd: gpmi: change the code for clocks):
>>>
>>> gpmi-nand: probe of 8000c000.gpmi-nand failed with error -12
>>>
>>> Acquire the clock using "NULL" as it was done previously, so that the driver
>>> can register on mx23/mx28 as well.
>>>
>>> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>
>>> ---
>>>   drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> index c46be6c..1f23cb4 100644
>>> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
>>> @@ -492,7 +492,7 @@ static int __devinit gpmi_get_clks(struct gpmi_nand_data *this)
>>>        int i;
>>>
>>>        /* The main clock is stored in the first. */
>>> -     r->clock[0] = clk_get(this->dev, "gpmi_io");
>>> +     r->clock[0] = clk_get(this->dev, NULL);
>> Please do not change this line.
>>
>> The gpmi_io is for mx6q.
>> If you replace it with `NULL`. The mx6q can not find the proper clock.
> What about this?
>
> index 42978f1b..7b1aded 100644
> --- a/drivers/clk/mxs/clk-imx28.c
> +++ b/drivers/clk/mxs/clk-imx28.c
> @@ -139,7 +139,7 @@ enum imx28_clk {
>          ssp0_div, ssp1_div, ssp2_div, ssp3_div, gpmi_div, emi_pll,
>          emi_xtal, lcdif_div, etm_div, ptp, saif0_div, saif1_div,
>          clk32k_div, rtc, lradc, spdif_div, clk32k, pwm, uart, ssp0,
> -       ssp1, ssp2, ssp3, gpmi, spdif, emi, saif0, saif1, lcdif, etm,
> +       ssp1, ssp2, ssp3, gpmi_io, spdif, emi, saif0, saif1, lcdif, etm,
>          fec, can0, can1, usb0, usb1, usb0_pwr, usb1_pwr, enet_out,
>          clk_max
>   };
> @@ -208,7 +208,7 @@ int __init mx28_clocks_init(void)
>          clks[ssp1] = mxs_clk_gate("ssp1", "ssp1_div", SSP1, 31);
>          clks[ssp2] = mxs_clk_gate("ssp2", "ssp2_div", SSP2, 31);
>          clks[ssp3] = mxs_clk_gate("ssp3", "ssp3_div", SSP3, 31);
> -       clks[gpmi] = mxs_clk_gate("gpmi", "gpmi_div", GPMI, 31);
> +       clks[gpmi_io] = mxs_clk_gate("gpmi_io", "gpmi_div", GPMI, 31);
>          clks[spdif] = mxs_clk_gate("spdif", "spdif_div", SPDIF, 31);
>          clks[emi] = mxs_clk_gate("emi", "emi_sel", EMI, 31);
>          clks[saif0] = mxs_clk_gate("saif0", "saif0_div", SAIF0, 31);
>
> Can you please test it on mx28?
I tested it in the linux-next with mx28-evk board. It did not works.

thanks a lot.

Huang Shijie
> Regards,
>
> Fabio Estevam
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-10-10  2:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-23 18:31 [PATCH] nand: gpmi-nand: Fix clock registration Fabio Estevam
2012-10-08  2:45 ` Huang Shijie
2012-10-08  3:15   ` Marek Vasut
2012-10-08  3:34     ` Huang Shijie
2012-10-08  3:37       ` Marek Vasut
2012-10-08  3:22   ` Fabio Estevam
2012-10-08  3:32     ` Huang Shijie
2012-10-08  3:31       ` Fabio Estevam
2012-10-08  3:46         ` Fabio Estevam
2012-10-08  3:52           ` Marek Vasut
2012-10-08  4:53         ` Huang Shijie
2012-10-10  2:44     ` Huang Shijie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox