* [PATCH] mtd: rawnand: marvell: select target before setting up data interface
@ 2019-03-21 21:20 Daniel Mack
2019-03-22 8:30 ` Miquel Raynal
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Mack @ 2019-03-21 21:20 UTC (permalink / raw)
To: boris.brezillon
Cc: haojian.zhuang, linux-mtd, linux-arm-kernel, miquel.raynal,
stable, robert.jarzmik, Daniel Mack
Now that the nand drivers are responsible for selecting the target
prior to hardware access, a call to marvell_nfc_select_target() is
necessary from marvell_nfc_setup_data_interface().
This is a regression introduced by commit b25251414f6e ("mtd:
rawnand: marvell: Stop implementing ->select_chip()").
Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Daniel Mack <daniel@zonque.org>
---
drivers/mtd/nand/raw/marvell_nand.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index 84283c6bb0ff..93abe5be8995 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
struct marvell_nfc_timings nfc_tmg;
int read_delay;
+ marvell_nfc_select_target(chip, chip->cur_cs);
+
sdr = nand_get_sdr_timings(conf);
if (IS_ERR(sdr))
return PTR_ERR(sdr);
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-21 21:20 [PATCH] mtd: rawnand: marvell: select target before setting up data interface Daniel Mack
@ 2019-03-22 8:30 ` Miquel Raynal
2019-03-22 9:05 ` Boris Brezillon
2019-03-22 18:48 ` Daniel Mack
0 siblings, 2 replies; 10+ messages in thread
From: Miquel Raynal @ 2019-03-22 8:30 UTC (permalink / raw)
To: Daniel Mack
Cc: Richard Weinberger, stable, boris.brezillon, linux-mtd,
haojian.zhuang, robert.jarzmik, linux-arm-kernel
Hi Daniel,
+ Richard: this is fixes materials
Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
+0100:
> Now that the nand drivers are responsible for selecting the target
> prior to hardware access, a call to marvell_nfc_select_target() is
> necessary from marvell_nfc_setup_data_interface().
>
> This is a regression introduced by commit b25251414f6e ("mtd:
> rawnand: marvell: Stop implementing ->select_chip()").
>
> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Daniel Mack <daniel@zonque.org>
> ---
> drivers/mtd/nand/raw/marvell_nand.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index 84283c6bb0ff..93abe5be8995 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
> struct marvell_nfc_timings nfc_tmg;
> int read_delay;
>
> + marvell_nfc_select_target(chip, chip->cur_cs);
> +
> sdr = nand_get_sdr_timings(conf);
> if (IS_ERR(sdr))
> return PTR_ERR(sdr);
I had a short look yesterday and this is very likely to be the root
cause of the regression, thank you very much!
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-22 8:30 ` Miquel Raynal
@ 2019-03-22 9:05 ` Boris Brezillon
2019-03-22 18:48 ` Daniel Mack
1 sibling, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2019-03-22 9:05 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, stable, linux-mtd, haojian.zhuang,
Daniel Mack, robert.jarzmik, linux-arm-kernel
On Fri, 22 Mar 2019 09:30:46 +0100
Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> Hi Daniel,
>
> + Richard: this is fixes materials
>
> Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
> +0100:
>
> > Now that the nand drivers are responsible for selecting the target
> > prior to hardware access, a call to marvell_nfc_select_target() is
> > necessary from marvell_nfc_setup_data_interface().
> >
> > This is a regression introduced by commit b25251414f6e ("mtd:
> > rawnand: marvell: Stop implementing ->select_chip()").
> >
> > Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
> > Cc: Boris Brezillon <boris.brezillon@collabora.com>
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Daniel Mack <daniel@zonque.org>
> > ---
> > drivers/mtd/nand/raw/marvell_nand.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> > index 84283c6bb0ff..93abe5be8995 100644
> > --- a/drivers/mtd/nand/raw/marvell_nand.c
> > +++ b/drivers/mtd/nand/raw/marvell_nand.c
> > @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
> > struct marvell_nfc_timings nfc_tmg;
> > int read_delay;
> >
> > + marvell_nfc_select_target(chip, chip->cur_cs);
Maybe s/chip->cur_cs/chipnr/
> > +
> > sdr = nand_get_sdr_timings(conf);
> > if (IS_ERR(sdr))
> > return PTR_ERR(sdr);
>
> I had a short look yesterday and this is very likely to be the root
> cause of the regression, thank you very much!
>
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
>
> Thanks,
> Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-22 8:30 ` Miquel Raynal
2019-03-22 9:05 ` Boris Brezillon
@ 2019-03-22 18:48 ` Daniel Mack
2019-03-25 9:09 ` Miquel Raynal
1 sibling, 1 reply; 10+ messages in thread
From: Daniel Mack @ 2019-03-22 18:48 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, stable, boris.brezillon, linux-mtd,
haojian.zhuang, robert.jarzmik, linux-arm-kernel
Hi Miquel,
On 22/3/2019 9:30 AM, Miquel Raynal wrote:
> + Richard: this is fixes materials
>
> Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
> +0100:
>
>> Now that the nand drivers are responsible for selecting the target
>> prior to hardware access, a call to marvell_nfc_select_target() is
>> necessary from marvell_nfc_setup_data_interface().
>>
>> This is a regression introduced by commit b25251414f6e ("mtd:
>> rawnand: marvell: Stop implementing ->select_chip()").
>>
>> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
>> Cc: Boris Brezillon <boris.brezillon@collabora.com>
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Daniel Mack <daniel@zonque.org>
>> ---
>> drivers/mtd/nand/raw/marvell_nand.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
>> index 84283c6bb0ff..93abe5be8995 100644
>> --- a/drivers/mtd/nand/raw/marvell_nand.c
>> +++ b/drivers/mtd/nand/raw/marvell_nand.c
>> @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
>> struct marvell_nfc_timings nfc_tmg;
>> int read_delay;
>>
>> + marvell_nfc_select_target(chip, chip->cur_cs);
>> +
>> sdr = nand_get_sdr_timings(conf);
>> if (IS_ERR(sdr))
>> return PTR_ERR(sdr);
>
> I had a short look yesterday and this is very likely to be the root
> cause of the regression, thank you very much!
Yes it is, it fixes the regression I have reported.
Do you want me to resend with that nit addressed you mentioned? My
version works well, I know that much :)
Thanks,
Daniel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-22 18:48 ` Daniel Mack
@ 2019-03-25 9:09 ` Miquel Raynal
2019-03-25 16:21 ` Daniel Mack
0 siblings, 1 reply; 10+ messages in thread
From: Miquel Raynal @ 2019-03-25 9:09 UTC (permalink / raw)
To: Daniel Mack
Cc: Richard Weinberger, stable, boris.brezillon, linux-mtd,
haojian.zhuang, robert.jarzmik, linux-arm-kernel
Hi Daniel,
Daniel Mack <daniel@zonque.org> wrote on Fri, 22 Mar 2019 19:48:08
+0100:
> Hi Miquel,
>
> On 22/3/2019 9:30 AM, Miquel Raynal wrote:
> > + Richard: this is fixes materials
> >
> > Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
> > +0100:
> >
> >> Now that the nand drivers are responsible for selecting the target
> >> prior to hardware access, a call to marvell_nfc_select_target() is
> >> necessary from marvell_nfc_setup_data_interface().
> >>
> >> This is a regression introduced by commit b25251414f6e ("mtd:
> >> rawnand: marvell: Stop implementing ->select_chip()").
> >>
> >> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
> >> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> >> Cc: <stable@vger.kernel.org>
> >> Signed-off-by: Daniel Mack <daniel@zonque.org>
> >> ---
> >> drivers/mtd/nand/raw/marvell_nand.c | 2 ++
> >> 1 file changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> >> index 84283c6bb0ff..93abe5be8995 100644
> >> --- a/drivers/mtd/nand/raw/marvell_nand.c
> >> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> >> @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
> >> struct marvell_nfc_timings nfc_tmg;
> >> int read_delay;
> >>
> >> + marvell_nfc_select_target(chip, chip->cur_cs);
> >> +
> >> sdr = nand_get_sdr_timings(conf);
> >> if (IS_ERR(sdr))
> >> return PTR_ERR(sdr);
> >
> > I had a short look yesterday and this is very likely to be the root
> > cause of the regression, thank you very much!
>
> Yes it is, it fixes the regression I have reported.
>
> Do you want me to resend with that nit addressed you mentioned? My
> version works well, I know that much :)
Yes please, resent with Boris' comment addressed and we'll be fine.
Thanks,
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-25 9:09 ` Miquel Raynal
@ 2019-03-25 16:21 ` Daniel Mack
2019-03-30 18:09 ` Boris Brezillon
2019-03-30 18:20 ` Boris Brezillon
0 siblings, 2 replies; 10+ messages in thread
From: Daniel Mack @ 2019-03-25 16:21 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, stable, boris.brezillon, linux-mtd,
haojian.zhuang, robert.jarzmik, linux-arm-kernel
Hi Miquel,
On 25/3/2019 10:09 AM, Miquel Raynal wrote:
> Daniel Mack <daniel@zonque.org> wrote on Fri, 22 Mar 2019 19:48:08
> +0100:
>
>> Hi Miquel,
>>
>> On 22/3/2019 9:30 AM, Miquel Raynal wrote:
>>> + Richard: this is fixes materials
>>>
>>> Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
>>> +0100:
>>>
>>>> Now that the nand drivers are responsible for selecting the target
>>>> prior to hardware access, a call to marvell_nfc_select_target() is
>>>> necessary from marvell_nfc_setup_data_interface().
>>>>
>>>> This is a regression introduced by commit b25251414f6e ("mtd:
>>>> rawnand: marvell: Stop implementing ->select_chip()").
>>>>
>>>> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
>>>> Cc: Boris Brezillon <boris.brezillon@collabora.com>
>>>> Cc: <stable@vger.kernel.org>
>>>> Signed-off-by: Daniel Mack <daniel@zonque.org>
>>>> ---
>>>> drivers/mtd/nand/raw/marvell_nand.c | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
>>>> index 84283c6bb0ff..93abe5be8995 100644
>>>> --- a/drivers/mtd/nand/raw/marvell_nand.c
>>>> +++ b/drivers/mtd/nand/raw/marvell_nand.c
>>>> @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
>>>> struct marvell_nfc_timings nfc_tmg;
>>>> int read_delay;
>>>>
>>>> + marvell_nfc_select_target(chip, chip->cur_cs);
>>>> +
>>>> sdr = nand_get_sdr_timings(conf);
>>>> if (IS_ERR(sdr))
>>>> return PTR_ERR(sdr);
>>>
>>> I had a short look yesterday and this is very likely to be the root
>>> cause of the regression, thank you very much!
>>
>> Yes it is, it fixes the regression I have reported.
>>
>> Do you want me to resend with that nit addressed you mentioned? My
>> version works well, I know that much :)
>
> Yes please, resent with Boris' comment addressed and we'll be fine.
I tried this now, and with 'chip->cur_cs' instead of 'chipnr', the
regression is back. This function is invoked twice during boot, and in
both cases, 'chip->cur_cs' is -1, while 'chipnr' is 0. The 2nd time this
function is invoked, the 'selected_die' cache value is 0, so
marvell_nfc_select_target() bails early, which seems to be a problem.
I can't quite make sense of that yet, all I know is that calling
marvell_nfc_select_target() with -1 from
marvell_nfc_setup_data_interface() makes the driver functional again. Hmm.
Thanks,
Daniel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-25 16:21 ` Daniel Mack
@ 2019-03-30 18:09 ` Boris Brezillon
2019-03-30 18:20 ` Boris Brezillon
1 sibling, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2019-03-30 18:09 UTC (permalink / raw)
To: Daniel Mack
Cc: Richard Weinberger, haojian.zhuang, linux-mtd, stable,
Miquel Raynal, robert.jarzmik, linux-arm-kernel
On Mon, 25 Mar 2019 17:21:42 +0100
Daniel Mack <daniel@zonque.org> wrote:
> Hi Miquel,
>
> On 25/3/2019 10:09 AM, Miquel Raynal wrote:
> > Daniel Mack <daniel@zonque.org> wrote on Fri, 22 Mar 2019 19:48:08
> > +0100:
> >
> >> Hi Miquel,
> >>
> >> On 22/3/2019 9:30 AM, Miquel Raynal wrote:
> >>> + Richard: this is fixes materials
> >>>
> >>> Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
> >>> +0100:
> >>>
> >>>> Now that the nand drivers are responsible for selecting the target
> >>>> prior to hardware access, a call to marvell_nfc_select_target() is
> >>>> necessary from marvell_nfc_setup_data_interface().
> >>>>
> >>>> This is a regression introduced by commit b25251414f6e ("mtd:
> >>>> rawnand: marvell: Stop implementing ->select_chip()").
> >>>>
> >>>> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
> >>>> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> >>>> Cc: <stable@vger.kernel.org>
> >>>> Signed-off-by: Daniel Mack <daniel@zonque.org>
> >>>> ---
> >>>> drivers/mtd/nand/raw/marvell_nand.c | 2 ++
> >>>> 1 file changed, 2 insertions(+)
> >>>>
> >>>> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> >>>> index 84283c6bb0ff..93abe5be8995 100644
> >>>> --- a/drivers/mtd/nand/raw/marvell_nand.c
> >>>> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> >>>> @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>>> struct marvell_nfc_timings nfc_tmg;
> >>>> int read_delay;
> >>>>
> >>>> + marvell_nfc_select_target(chip, chip->cur_cs);
> >>>> +
> >>>> sdr = nand_get_sdr_timings(conf);
> >>>> if (IS_ERR(sdr))
> >>>> return PTR_ERR(sdr);
> >>>
> >>> I had a short look yesterday and this is very likely to be the root
> >>> cause of the regression, thank you very much!
> >>
> >> Yes it is, it fixes the regression I have reported.
> >>
> >> Do you want me to resend with that nit addressed you mentioned? My
> >> version works well, I know that much :)
> >
> > Yes please, resent with Boris' comment addressed and we'll be fine.
>
> I tried this now, and with 'chip->cur_cs' instead of 'chipnr', the
> regression is back. This function is invoked twice during boot, and in
> both cases, 'chip->cur_cs' is -1, while 'chipnr' is 0. The 2nd time this
> function is invoked, the 'selected_die' cache value is 0, so
> marvell_nfc_select_target() bails early, which seems to be a problem.
>
> I can't quite make sense of that yet, all I know is that calling
> marvell_nfc_select_target() with -1 from
> marvell_nfc_setup_data_interface() makes the driver functional again. Hmm.
I had a quick look at the marvell_nfc_setup_data_interface() function
and it doesn't make sense to call marvell_nfc_select_target() there.
The fact that calling marvell_nfc_select_target(cur_cs) fixes your
problem is probably a side effect, and the bug might come from other
changes I made in b25251414f6e (missing call to
marvell_nfc_select_target() somewhere else in the driver?).
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-25 16:21 ` Daniel Mack
2019-03-30 18:09 ` Boris Brezillon
@ 2019-03-30 18:20 ` Boris Brezillon
2019-04-01 15:29 ` Daniel Mack
2019-04-05 9:48 ` Miquel Raynal
1 sibling, 2 replies; 10+ messages in thread
From: Boris Brezillon @ 2019-03-30 18:20 UTC (permalink / raw)
To: Daniel Mack
Cc: Richard Weinberger, haojian.zhuang, linux-mtd, stable,
Miquel Raynal, robert.jarzmik, linux-arm-kernel
On Mon, 25 Mar 2019 17:21:42 +0100
Daniel Mack <daniel@zonque.org> wrote:
> Hi Miquel,
>
> On 25/3/2019 10:09 AM, Miquel Raynal wrote:
> > Daniel Mack <daniel@zonque.org> wrote on Fri, 22 Mar 2019 19:48:08
> > +0100:
> >
> >> Hi Miquel,
> >>
> >> On 22/3/2019 9:30 AM, Miquel Raynal wrote:
> >>> + Richard: this is fixes materials
> >>>
> >>> Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
> >>> +0100:
> >>>
> >>>> Now that the nand drivers are responsible for selecting the target
> >>>> prior to hardware access, a call to marvell_nfc_select_target() is
> >>>> necessary from marvell_nfc_setup_data_interface().
> >>>>
> >>>> This is a regression introduced by commit b25251414f6e ("mtd:
> >>>> rawnand: marvell: Stop implementing ->select_chip()").
> >>>>
> >>>> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
> >>>> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> >>>> Cc: <stable@vger.kernel.org>
> >>>> Signed-off-by: Daniel Mack <daniel@zonque.org>
> >>>> ---
> >>>> drivers/mtd/nand/raw/marvell_nand.c | 2 ++
> >>>> 1 file changed, 2 insertions(+)
> >>>>
> >>>> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> >>>> index 84283c6bb0ff..93abe5be8995 100644
> >>>> --- a/drivers/mtd/nand/raw/marvell_nand.c
> >>>> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> >>>> @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>>> struct marvell_nfc_timings nfc_tmg;
> >>>> int read_delay;
> >>>>
> >>>> + marvell_nfc_select_target(chip, chip->cur_cs);
> >>>> +
> >>>> sdr = nand_get_sdr_timings(conf);
> >>>> if (IS_ERR(sdr))
> >>>> return PTR_ERR(sdr);
> >>>
> >>> I had a short look yesterday and this is very likely to be the root
> >>> cause of the regression, thank you very much!
> >>
> >> Yes it is, it fixes the regression I have reported.
> >>
> >> Do you want me to resend with that nit addressed you mentioned? My
> >> version works well, I know that much :)
> >
> > Yes please, resent with Boris' comment addressed and we'll be fine.
>
> I tried this now, and with 'chip->cur_cs' instead of 'chipnr', the
> regression is back. This function is invoked twice during boot, and in
> both cases, 'chip->cur_cs' is -1, while 'chipnr' is 0. The 2nd time this
> function is invoked, the 'selected_die' cache value is 0, so
> marvell_nfc_select_target() bails early, which seems to be a problem.
>
> I can't quite make sense of that yet, all I know is that calling
> marvell_nfc_select_target() with -1 from
> marvell_nfc_setup_data_interface() makes the driver functional again. Hmm.
Can you try with the following diff applied?
--->8---
diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index f38e5c1b87e4..e8eccf6afc8f 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -722,9 +722,6 @@ static void marvell_nfc_select_target(struct nand_chip *chip,
struct marvell_nfc *nfc = to_marvell_nfc(chip->controller);
u32 ndcr_generic;
- if (chip == nfc->selected_chip && die_nr == marvell_nand->selected_die)
- return;
-
writel_relaxed(marvell_nand->ndtr0, nfc->regs + NDTR0);
writel_relaxed(marvell_nand->ndtr1, nfc->regs + NDTR1);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-30 18:20 ` Boris Brezillon
@ 2019-04-01 15:29 ` Daniel Mack
2019-04-05 9:48 ` Miquel Raynal
1 sibling, 0 replies; 10+ messages in thread
From: Daniel Mack @ 2019-04-01 15:29 UTC (permalink / raw)
To: Boris Brezillon
Cc: Richard Weinberger, haojian.zhuang, linux-mtd, stable,
Miquel Raynal, robert.jarzmik, linux-arm-kernel
Hi Boris,
On 30/3/2019 7:20 PM, Boris Brezillon wrote:
> On Mon, 25 Mar 2019 17:21:42 +0100
> Daniel Mack <daniel@zonque.org> wrote:
>> I can't quite make sense of that yet, all I know is that calling
>> marvell_nfc_select_target() with -1 from
>> marvell_nfc_setup_data_interface() makes the driver functional again. Hmm.
>
> Can you try with the following diff applied?
> --->8---
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index f38e5c1b87e4..e8eccf6afc8f 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -722,9 +722,6 @@ static void marvell_nfc_select_target(struct nand_chip *chip,
> struct marvell_nfc *nfc = to_marvell_nfc(chip->controller);
> u32 ndcr_generic;
>
> - if (chip == nfc->selected_chip && die_nr == marvell_nand->selected_die)
> - return;
> -
> writel_relaxed(marvell_nand->ndtr0, nfc->regs + NDTR0);
> writel_relaxed(marvell_nand->ndtr1, nfc->regs + NDTR1);
Yes, this works. Thanks a lot!
Do you want to submit a patch for that? You can have my
Tested-by: Daniel Mack <daniel@zonque.org>
Best regards,
Daniel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] mtd: rawnand: marvell: select target before setting up data interface
2019-03-30 18:20 ` Boris Brezillon
2019-04-01 15:29 ` Daniel Mack
@ 2019-04-05 9:48 ` Miquel Raynal
1 sibling, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2019-04-05 9:48 UTC (permalink / raw)
To: Boris Brezillon
Cc: linux-arm-kernel, Richard Weinberger, stable, linux-mtd,
haojian.zhuang, robert.jarzmik, Daniel Mack
Hi Daniel,
Boris Brezillon <boris.brezillon@collabora.com> wrote on Sat, 30 Mar
2019 19:20:36 +0100:
> On Mon, 25 Mar 2019 17:21:42 +0100
> Daniel Mack <daniel@zonque.org> wrote:
>
> > Hi Miquel,
> >
> > On 25/3/2019 10:09 AM, Miquel Raynal wrote:
> > > Daniel Mack <daniel@zonque.org> wrote on Fri, 22 Mar 2019 19:48:08
> > > +0100:
> > >
> > >> Hi Miquel,
> > >>
> > >> On 22/3/2019 9:30 AM, Miquel Raynal wrote:
> > >>> + Richard: this is fixes materials
> > >>>
> > >>> Daniel Mack <daniel@zonque.org> wrote on Thu, 21 Mar 2019 22:20:10
> > >>> +0100:
> > >>>
> > >>>> Now that the nand drivers are responsible for selecting the target
> > >>>> prior to hardware access, a call to marvell_nfc_select_target() is
> > >>>> necessary from marvell_nfc_setup_data_interface().
> > >>>>
> > >>>> This is a regression introduced by commit b25251414f6e ("mtd:
> > >>>> rawnand: marvell: Stop implementing ->select_chip()").
> > >>>>
> > >>>> Fixes: b25251414f6e ("mtd: rawnand: marvell: Stop implementing ->select_chip()")
> > >>>> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> > >>>> Cc: <stable@vger.kernel.org>
> > >>>> Signed-off-by: Daniel Mack <daniel@zonque.org>
> > >>>> ---
> > >>>> drivers/mtd/nand/raw/marvell_nand.c | 2 ++
> > >>>> 1 file changed, 2 insertions(+)
> > >>>>
> > >>>> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> > >>>> index 84283c6bb0ff..93abe5be8995 100644
> > >>>> --- a/drivers/mtd/nand/raw/marvell_nand.c
> > >>>> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> > >>>> @@ -2325,6 +2325,8 @@ static int marvell_nfc_setup_data_interface(struct nand_chip *chip, int chipnr,
> > >>>> struct marvell_nfc_timings nfc_tmg;
> > >>>> int read_delay;
> > >>>>
> > >>>> + marvell_nfc_select_target(chip, chip->cur_cs);
> > >>>> +
> > >>>> sdr = nand_get_sdr_timings(conf);
> > >>>> if (IS_ERR(sdr))
> > >>>> return PTR_ERR(sdr);
> > >>>
> > >>> I had a short look yesterday and this is very likely to be the root
> > >>> cause of the regression, thank you very much!
> > >>
> > >> Yes it is, it fixes the regression I have reported.
> > >>
> > >> Do you want me to resend with that nit addressed you mentioned? My
> > >> version works well, I know that much :)
> > >
> > > Yes please, resent with Boris' comment addressed and we'll be fine.
> >
> > I tried this now, and with 'chip->cur_cs' instead of 'chipnr', the
> > regression is back. This function is invoked twice during boot, and in
> > both cases, 'chip->cur_cs' is -1, while 'chipnr' is 0. The 2nd time this
> > function is invoked, the 'selected_die' cache value is 0, so
> > marvell_nfc_select_target() bails early, which seems to be a problem.
> >
> > I can't quite make sense of that yet, all I know is that calling
> > marvell_nfc_select_target() with -1 from
> > marvell_nfc_setup_data_interface() makes the driver functional again. Hmm.
>
> Can you try with the following diff applied?
> --->8---
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index f38e5c1b87e4..e8eccf6afc8f 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -722,9 +722,6 @@ static void marvell_nfc_select_target(struct nand_chip *chip,
> struct marvell_nfc *nfc = to_marvell_nfc(chip->controller);
> u32 ndcr_generic;
>
> - if (chip == nfc->selected_chip && die_nr == marvell_nand->selected_die)
> - return;
> -
> writel_relaxed(marvell_nand->ndtr0, nfc->regs + NDTR0);
> writel_relaxed(marvell_nand->ndtr1, nfc->regs + NDTR1);
>
I tested on a pxa board and an armada board and I don't reproduce the
bug without this change. What is special with your setup?
I was trying to understand the fix to write a decent commit log but as
I cannot reproduce I am stuck. So if you need this fix please send the
patch with, hopefully, an explanation of what's wrong.
Thank you!
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-04-05 9:48 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21 21:20 [PATCH] mtd: rawnand: marvell: select target before setting up data interface Daniel Mack
2019-03-22 8:30 ` Miquel Raynal
2019-03-22 9:05 ` Boris Brezillon
2019-03-22 18:48 ` Daniel Mack
2019-03-25 9:09 ` Miquel Raynal
2019-03-25 16:21 ` Daniel Mack
2019-03-30 18:09 ` Boris Brezillon
2019-03-30 18:20 ` Boris Brezillon
2019-04-01 15:29 ` Daniel Mack
2019-04-05 9:48 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).