linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
@ 2022-09-27  2:47 Chris Packham
  2022-09-27  2:54 ` Chris Packham
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Chris Packham @ 2022-09-27  2:47 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr, bbrezillon
  Cc: Tony O'Brien, linux-mtd, linux-kernel, Chris Packham

From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>

Originally the absence of the marvell,nand-keep-config property caused
the setup_data_interface function to be provided. However when
setup_data_interface was moved into nand_controller_ops the logic was
unintentionally inverted. Update the logic so that only if the
marvell,nand-keep-config property is present the bootloader NAND config
kept.

Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

Notes:
    I think this is a bug that's been lurking for 4 years or so. I'm not
    sure that's particularly long in the life of an embedded device but it
    does make me wonder if there have been other bug reports about it.
    
    We noticed this because we had a bootloader that used maxed out NAND
    timings which made the time it took the kernel to do anything on the
    file system longer than we expected.

 drivers/mtd/nand/raw/marvell_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
index 2455a581fd70..b248c5f657d5 100644
--- a/drivers/mtd/nand/raw/marvell_nand.c
+++ b/drivers/mtd/nand/raw/marvell_nand.c
@@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
 	chip->controller = &nfc->controller;
 	nand_set_flash_node(chip, np);
 
-	if (!of_property_read_bool(np, "marvell,nand-keep-config"))
+	if (of_property_read_bool(np, "marvell,nand-keep-config"))
 		chip->options |= NAND_KEEP_TIMINGS;
 
 	mtd = nand_to_mtd(chip);
-- 
2.37.3


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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-09-27  2:47 [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config Chris Packham
@ 2022-09-27  2:54 ` Chris Packham
  2022-10-04 10:02   ` Miquel Raynal
  2022-10-03 21:46 ` Chris Packham
  2022-10-18  9:02 ` Miquel Raynal
  2 siblings, 1 reply; 10+ messages in thread
From: Chris Packham @ 2022-09-27  2:54 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr, bbrezillon
  Cc: Tony O'Brien, linux-mtd, linux-kernel


On 27/09/22 15:47, Chris Packham wrote:
> From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
>
> Originally the absence of the marvell,nand-keep-config property caused
> the setup_data_interface function to be provided. However when
> setup_data_interface was moved into nand_controller_ops the logic was
> unintentionally inverted. Update the logic so that only if the
> marvell,nand-keep-config property is present the bootloader NAND config
> kept.
>
> Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
> Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
>
> Notes:
>      I think this is a bug that's been lurking for 4 years or so. I'm not
>      sure that's particularly long in the life of an embedded device but it
>      does make me wonder if there have been other bug reports about it.
>      
>      We noticed this because we had a bootloader that used maxed out NAND
>      timings which made the time it took the kernel to do anything on the
>      file system longer than we expected.

I think there might be a similar logic inversion bug in 
drivers/mtd/nand/raw/denali.c but I lack the ability to test for that 
platform.

>   drivers/mtd/nand/raw/marvell_nand.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index 2455a581fd70..b248c5f657d5 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
>   	chip->controller = &nfc->controller;
>   	nand_set_flash_node(chip, np);
>   
> -	if (!of_property_read_bool(np, "marvell,nand-keep-config"))
> +	if (of_property_read_bool(np, "marvell,nand-keep-config"))
>   		chip->options |= NAND_KEEP_TIMINGS;
>   
>   	mtd = nand_to_mtd(chip);

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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-09-27  2:47 [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config Chris Packham
  2022-09-27  2:54 ` Chris Packham
@ 2022-10-03 21:46 ` Chris Packham
  2022-10-04  6:25   ` Boris Brezillon
  2022-10-04 10:00   ` Miquel Raynal
  2022-10-18  9:02 ` Miquel Raynal
  2 siblings, 2 replies; 10+ messages in thread
From: Chris Packham @ 2022-10-03 21:46 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr, bbrezillon
  Cc: Tony O'Brien, linux-mtd, linux-kernel

Hi All,

On 27/09/22 15:47, Chris Packham wrote:
> From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
>
> Originally the absence of the marvell,nand-keep-config property caused
> the setup_data_interface function to be provided. However when
> setup_data_interface was moved into nand_controller_ops the logic was
> unintentionally inverted. Update the logic so that only if the
> marvell,nand-keep-config property is present the bootloader NAND config
> kept.
>
> Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
> Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Just following up on this. I know things have probably been busy with 
the 6.0 release but it's been a week so I figured I'd give this a bump.

> ---
>
> Notes:
>      I think this is a bug that's been lurking for 4 years or so. I'm not
>      sure that's particularly long in the life of an embedded device but it
>      does make me wonder if there have been other bug reports about it.
>      
>      We noticed this because we had a bootloader that used maxed out NAND
>      timings which made the time it took the kernel to do anything on the
>      file system longer than we expected.
>
>   drivers/mtd/nand/raw/marvell_nand.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> index 2455a581fd70..b248c5f657d5 100644
> --- a/drivers/mtd/nand/raw/marvell_nand.c
> +++ b/drivers/mtd/nand/raw/marvell_nand.c
> @@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
>   	chip->controller = &nfc->controller;
>   	nand_set_flash_node(chip, np);
>   
> -	if (!of_property_read_bool(np, "marvell,nand-keep-config"))
> +	if (of_property_read_bool(np, "marvell,nand-keep-config"))
>   		chip->options |= NAND_KEEP_TIMINGS;
>   
>   	mtd = nand_to_mtd(chip);

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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-10-03 21:46 ` Chris Packham
@ 2022-10-04  6:25   ` Boris Brezillon
  2022-10-04 10:00   ` Miquel Raynal
  1 sibling, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2022-10-04  6:25 UTC (permalink / raw)
  To: Chris Packham
  Cc: miquel.raynal, richard, vigneshr, bbrezillon, Tony O'Brien,
	linux-mtd, linux-kernel

On Mon, 3 Oct 2022 21:46:31 +0000
Chris Packham <Chris.Packham@alliedtelesis.co.nz> wrote:

> Hi All,
> 
> On 27/09/22 15:47, Chris Packham wrote:
> > From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> >
> > Originally the absence of the marvell,nand-keep-config property caused
> > the setup_data_interface function to be provided. However when
> > setup_data_interface was moved into nand_controller_ops the logic was
> > unintentionally inverted. Update the logic so that only if the
> > marvell,nand-keep-config property is present the bootloader NAND config
> > kept.
> >
> > Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
> > Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>  
> 
> Just following up on this. I know things have probably been busy with 
> the 6.0 release but it's been a week so I figured I'd give this a bump.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

> 
> > ---
> >
> > Notes:
> >      I think this is a bug that's been lurking for 4 years or so. I'm not
> >      sure that's particularly long in the life of an embedded device but it
> >      does make me wonder if there have been other bug reports about it.
> >      
> >      We noticed this because we had a bootloader that used maxed out NAND
> >      timings which made the time it took the kernel to do anything on the
> >      file system longer than we expected.
> >
> >   drivers/mtd/nand/raw/marvell_nand.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> > index 2455a581fd70..b248c5f657d5 100644
> > --- a/drivers/mtd/nand/raw/marvell_nand.c
> > +++ b/drivers/mtd/nand/raw/marvell_nand.c
> > @@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
> >   	chip->controller = &nfc->controller;
> >   	nand_set_flash_node(chip, np);
> >   
> > -	if (!of_property_read_bool(np, "marvell,nand-keep-config"))
> > +	if (of_property_read_bool(np, "marvell,nand-keep-config"))
> >   		chip->options |= NAND_KEEP_TIMINGS;
> >   
> >   	mtd = nand_to_mtd(chip)  


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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-10-03 21:46 ` Chris Packham
  2022-10-04  6:25   ` Boris Brezillon
@ 2022-10-04 10:00   ` Miquel Raynal
  1 sibling, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2022-10-04 10:00 UTC (permalink / raw)
  To: Chris Packham
  Cc: richard, vigneshr, bbrezillon, Tony O'Brien, linux-mtd, linux-kernel

Hi Chris,

Chris.Packham@alliedtelesis.co.nz wrote on Mon, 3 Oct 2022 21:46:31
+0000:

> Hi All,
> 
> On 27/09/22 15:47, Chris Packham wrote:
> > From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> >
> > Originally the absence of the marvell,nand-keep-config property caused
> > the setup_data_interface function to be provided. However when
> > setup_data_interface was moved into nand_controller_ops the logic was
> > unintentionally inverted. Update the logic so that only if the
> > marvell,nand-keep-config property is present the bootloader NAND config
> > kept.
> >
> > Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
> > Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>  
> 
> Just following up on this. I know things have probably been busy with 
> the 6.0 release but it's been a week so I figured I'd give this a bump.

I was just off the past week :)

I will queue it soon.

> 
> > ---
> >
> > Notes:
> >      I think this is a bug that's been lurking for 4 years or so. I'm not
> >      sure that's particularly long in the life of an embedded device but it
> >      does make me wonder if there have been other bug reports about it.

I don't remember any... Indeed this must be fixed.

> >      We noticed this because we had a bootloader that used maxed out NAND
> >      timings which made the time it took the kernel to do anything on the
> >      file system longer than we expected.
> >
> >   drivers/mtd/nand/raw/marvell_nand.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> > index 2455a581fd70..b248c5f657d5 100644
> > --- a/drivers/mtd/nand/raw/marvell_nand.c
> > +++ b/drivers/mtd/nand/raw/marvell_nand.c
> > @@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
> >   	chip->controller = &nfc->controller;
> >   	nand_set_flash_node(chip, np);
> >   
> > -	if (!of_property_read_bool(np, "marvell,nand-keep-config"))
> > +	if (of_property_read_bool(np, "marvell,nand-keep-config"))
> >   		chip->options |= NAND_KEEP_TIMINGS;
> >   
> >   	mtd = nand_to_mtd(chip)  


Thanks,
Miquèl

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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-09-27  2:54 ` Chris Packham
@ 2022-10-04 10:02   ` Miquel Raynal
  2022-10-04 19:41     ` Chris Packham
  0 siblings, 1 reply; 10+ messages in thread
From: Miquel Raynal @ 2022-10-04 10:02 UTC (permalink / raw)
  To: Chris Packham
  Cc: richard, vigneshr, bbrezillon, Tony O'Brien, linux-mtd, linux-kernel

Hi Chris,

Chris.Packham@alliedtelesis.co.nz wrote on Tue, 27 Sep 2022 02:54:40
+0000:

> On 27/09/22 15:47, Chris Packham wrote:
> > From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> >
> > Originally the absence of the marvell,nand-keep-config property caused
> > the setup_data_interface function to be provided. However when
> > setup_data_interface was moved into nand_controller_ops the logic was
> > unintentionally inverted. Update the logic so that only if the
> > marvell,nand-keep-config property is present the bootloader NAND config
> > kept.
> >
> > Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
> > Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> > ---
> >
> > Notes:
> >      I think this is a bug that's been lurking for 4 years or so. I'm not
> >      sure that's particularly long in the life of an embedded device but it
> >      does make me wonder if there have been other bug reports about it.
> >      
> >      We noticed this because we had a bootloader that used maxed out NAND
> >      timings which made the time it took the kernel to do anything on the
> >      file system longer than we expected.  
> 
> I think there might be a similar logic inversion bug in 
> drivers/mtd/nand/raw/denali.c but I lack the ability to test for that 
> platform.

Agreed, the denali driver has the same issue. Could you please send a
patch?
 
> 
> >   drivers/mtd/nand/raw/marvell_nand.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
> > index 2455a581fd70..b248c5f657d5 100644
> > --- a/drivers/mtd/nand/raw/marvell_nand.c
> > +++ b/drivers/mtd/nand/raw/marvell_nand.c
> > @@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
> >   	chip->controller = &nfc->controller;
> >   	nand_set_flash_node(chip, np);
> >   
> > -	if (!of_property_read_bool(np, "marvell,nand-keep-config"))
> > +	if (of_property_read_bool(np, "marvell,nand-keep-config"))
> >   		chip->options |= NAND_KEEP_TIMINGS;
> >   
> >   	mtd = nand_to_mtd(chip)  


Thanks,
Miquèl

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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-10-04 10:02   ` Miquel Raynal
@ 2022-10-04 19:41     ` Chris Packham
  2022-10-04 21:21       ` Chris Packham
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Packham @ 2022-10-04 19:41 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: richard, vigneshr, bbrezillon, Tony O'Brien, linux-mtd, linux-kernel


On 4/10/22 23:02, Miquel Raynal wrote:
> Hi Chris,
>
> Chris.Packham@alliedtelesis.co.nz wrote on Tue, 27 Sep 2022 02:54:40
> +0000:
>
>> On 27/09/22 15:47, Chris Packham wrote:
>>> From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
>>>
>>> Originally the absence of the marvell,nand-keep-config property caused
>>> the setup_data_interface function to be provided. However when
>>> setup_data_interface was moved into nand_controller_ops the logic was
>>> unintentionally inverted. Update the logic so that only if the
>>> marvell,nand-keep-config property is present the bootloader NAND config
>>> kept.
>>>
>>> Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
>>> Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
>>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>>> ---
>>>
>>> Notes:
>>>       I think this is a bug that's been lurking for 4 years or so. I'm not
>>>       sure that's particularly long in the life of an embedded device but it
>>>       does make me wonder if there have been other bug reports about it.
>>>       
>>>       We noticed this because we had a bootloader that used maxed out NAND
>>>       timings which made the time it took the kernel to do anything on the
>>>       file system longer than we expected.
>> I think there might be a similar logic inversion bug in
>> drivers/mtd/nand/raw/denali.c but I lack the ability to test for that
>> platform.
> Agreed, the denali driver has the same issue. Could you please send a
> patch?
Sure although it'll be compile tested only.
>>>    drivers/mtd/nand/raw/marvell_nand.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
>>> index 2455a581fd70..b248c5f657d5 100644
>>> --- a/drivers/mtd/nand/raw/marvell_nand.c
>>> +++ b/drivers/mtd/nand/raw/marvell_nand.c
>>> @@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc,
>>>    	chip->controller = &nfc->controller;
>>>    	nand_set_flash_node(chip, np);
>>>    
>>> -	if (!of_property_read_bool(np, "marvell,nand-keep-config"))
>>> +	if (of_property_read_bool(np, "marvell,nand-keep-config"))
>>>    		chip->options |= NAND_KEEP_TIMINGS;
>>>    
>>>    	mtd = nand_to_mtd(chip)
>
> Thanks,
> Miquèl

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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-10-04 19:41     ` Chris Packham
@ 2022-10-04 21:21       ` Chris Packham
  2022-10-05  7:34         ` Miquel Raynal
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Packham @ 2022-10-04 21:21 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: richard, vigneshr, bbrezillon, Tony O'Brien, linux-mtd, linux-kernel


On 5/10/22 08:41, Chris Packham wrote:
>
> On 4/10/22 23:02, Miquel Raynal wrote:
>> Hi Chris,
>>
>> Chris.Packham@alliedtelesis.co.nz wrote on Tue, 27 Sep 2022 02:54:40
>> +0000:
>>
>>> On 27/09/22 15:47, Chris Packham wrote:
>>>> From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
>>>>
>>>> Originally the absence of the marvell,nand-keep-config property caused
>>>> the setup_data_interface function to be provided. However when
>>>> setup_data_interface was moved into nand_controller_ops the logic was
>>>> unintentionally inverted. Update the logic so that only if the
>>>> marvell,nand-keep-config property is present the bootloader NAND 
>>>> config
>>>> kept.
>>>>
>>>> Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() 
>>>> to nand_controller_ops")
>>>> Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
>>>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>>>> ---
>>>>
>>>> Notes:
>>>>       I think this is a bug that's been lurking for 4 years or so. 
>>>> I'm not
>>>>       sure that's particularly long in the life of an embedded 
>>>> device but it
>>>>       does make me wonder if there have been other bug reports 
>>>> about it.
>>>>             We noticed this because we had a bootloader that used 
>>>> maxed out NAND
>>>>       timings which made the time it took the kernel to do anything 
>>>> on the
>>>>       file system longer than we expected.
>>> I think there might be a similar logic inversion bug in
>>> drivers/mtd/nand/raw/denali.c but I lack the ability to test for that
>>> platform.
>> Agreed, the denali driver has the same issue. Could you please send a
>> patch?
> Sure although it'll be compile tested only.
Actually looks like it was already fixed in commit d311e0c27b8f ("mtd: 
rawnand: denali: get ->setup_data_interface() working again").
>>>>    drivers/mtd/nand/raw/marvell_nand.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/mtd/nand/raw/marvell_nand.c 
>>>> b/drivers/mtd/nand/raw/marvell_nand.c
>>>> index 2455a581fd70..b248c5f657d5 100644
>>>> --- a/drivers/mtd/nand/raw/marvell_nand.c
>>>> +++ b/drivers/mtd/nand/raw/marvell_nand.c
>>>> @@ -2672,7 +2672,7 @@ static int marvell_nand_chip_init(struct 
>>>> device *dev, struct marvell_nfc *nfc,
>>>>        chip->controller = &nfc->controller;
>>>>        nand_set_flash_node(chip, np);
>>>>    -    if (!of_property_read_bool(np, "marvell,nand-keep-config"))
>>>> +    if (of_property_read_bool(np, "marvell,nand-keep-config"))
>>>>            chip->options |= NAND_KEEP_TIMINGS;
>>>>           mtd = nand_to_mtd(chip)
>>
>> Thanks,
>> Miquèl

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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-10-04 21:21       ` Chris Packham
@ 2022-10-05  7:34         ` Miquel Raynal
  0 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2022-10-05  7:34 UTC (permalink / raw)
  To: Chris Packham
  Cc: richard, vigneshr, bbrezillon, Tony O'Brien, linux-mtd, linux-kernel

Hi Chris,

Chris.Packham@alliedtelesis.co.nz wrote on Tue, 4 Oct 2022 21:21:37
+0000:

> On 5/10/22 08:41, Chris Packham wrote:
> >
> > On 4/10/22 23:02, Miquel Raynal wrote:  
> >> Hi Chris,
> >>
> >> Chris.Packham@alliedtelesis.co.nz wrote on Tue, 27 Sep 2022 02:54:40
> >> +0000:
> >>  
> >>> On 27/09/22 15:47, Chris Packham wrote:  
> >>>> From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> >>>>
> >>>> Originally the absence of the marvell,nand-keep-config property caused
> >>>> the setup_data_interface function to be provided. However when
> >>>> setup_data_interface was moved into nand_controller_ops the logic was
> >>>> unintentionally inverted. Update the logic so that only if the
> >>>> marvell,nand-keep-config property is present the bootloader NAND 
> >>>> config
> >>>> kept.
> >>>>
> >>>> Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() 
> >>>> to nand_controller_ops")
> >>>> Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> >>>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> >>>> ---
> >>>>
> >>>> Notes:
> >>>>       I think this is a bug that's been lurking for 4 years or so. 
> >>>> I'm not
> >>>>       sure that's particularly long in the life of an embedded 
> >>>> device but it
> >>>>       does make me wonder if there have been other bug reports 
> >>>> about it.
> >>>>             We noticed this because we had a bootloader that used 
> >>>> maxed out NAND
> >>>>       timings which made the time it took the kernel to do anything 
> >>>> on the
> >>>>       file system longer than we expected.  
> >>> I think there might be a similar logic inversion bug in
> >>> drivers/mtd/nand/raw/denali.c but I lack the ability to test for that
> >>> platform.  
> >> Agreed, the denali driver has the same issue. Could you please send a
> >> patch?  
> > Sure although it'll be compile tested only.  
> Actually looks like it was already fixed in commit d311e0c27b8f ("mtd: 
> rawnand: denali: get ->setup_data_interface() working again").

Ok, perfect.

Thanks,
Miquèl

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

* Re: [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config
  2022-09-27  2:47 [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config Chris Packham
  2022-09-27  2:54 ` Chris Packham
  2022-10-03 21:46 ` Chris Packham
@ 2022-10-18  9:02 ` Miquel Raynal
  2 siblings, 0 replies; 10+ messages in thread
From: Miquel Raynal @ 2022-10-18  9:02 UTC (permalink / raw)
  To: Chris Packham, miquel.raynal, richard, vigneshr, bbrezillon
  Cc: Tony O'Brien, linux-mtd, linux-kernel

On Tue, 2022-09-27 at 02:47:28 UTC, Chris Packham wrote:
> From: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> 
> Originally the absence of the marvell,nand-keep-config property caused
> the setup_data_interface function to be provided. However when
> setup_data_interface was moved into nand_controller_ops the logic was
> unintentionally inverted. Update the logic so that only if the
> marvell,nand-keep-config property is present the bootloader NAND config
> kept.
> 
> Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops")
> Signed-off-by: Tony O'Brien <tony.obrien@alliedtelesis.co.nz>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.

Miquel

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

end of thread, other threads:[~2022-10-18  9:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27  2:47 [PATCH] mtd: rawnand: marvell: Use correct logic for nand-keep-config Chris Packham
2022-09-27  2:54 ` Chris Packham
2022-10-04 10:02   ` Miquel Raynal
2022-10-04 19:41     ` Chris Packham
2022-10-04 21:21       ` Chris Packham
2022-10-05  7:34         ` Miquel Raynal
2022-10-03 21:46 ` Chris Packham
2022-10-04  6:25   ` Boris Brezillon
2022-10-04 10:00   ` Miquel Raynal
2022-10-18  9:02 ` 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).