mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* AM335x NAND write hungs
@ 2021-01-25  8:20 Alexander Shiyan
  2021-01-25  8:37 ` Ahmad Fatoum
  2021-01-25  9:21 ` [PATCH] mtd: nand: omap_gpmc: Fix wrong length check for real Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Shiyan @ 2021-01-25  8:20 UTC (permalink / raw)
  To: barebox

Hello.

I recently upgraded my barebox from 2020.11 to 2021.01 for a custom board
based on TI AM335x processor.
The update revealed the inoperability of writing to NAND. When trying to write,
the bootloader hangs forever.
Reverting the commit "mtd: nand: omap_gpmc: Fix wrong length check" helps
to solve the problem.
Does anyone have similar problems?

Thanks!

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: AM335x NAND write hungs
  2021-01-25  8:20 AM335x NAND write hungs Alexander Shiyan
@ 2021-01-25  8:37 ` Ahmad Fatoum
  2021-01-25  8:56   ` Alexander Shiyan
  2021-01-25  9:21 ` [PATCH] mtd: nand: omap_gpmc: Fix wrong length check for real Sascha Hauer
  1 sibling, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2021-01-25  8:37 UTC (permalink / raw)
  To: Alexander Shiyan, barebox

Hello,

On 25.01.21 09:20, Alexander Shiyan wrote:
> Hello.
> 
> I recently upgraded my barebox from 2020.11 to 2021.01 for a custom board
> based on TI AM335x processor.
> The update revealed the inoperability of writing to NAND. When trying to write,
> the bootloader hangs forever.
> Reverting the commit "mtd: nand: omap_gpmc: Fix wrong length check" helps
> to solve the problem.

What happens when changing the condition to len > 0?

> Does anyone have similar problems?
> 
> Thanks!
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: AM335x NAND write hungs
  2021-01-25  8:37 ` Ahmad Fatoum
@ 2021-01-25  8:56   ` Alexander Shiyan
  2021-01-25  9:21     ` Ahmad Fatoum
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Shiyan @ 2021-01-25  8:56 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Works as expected.
Can you commit this change into master?
Thanks!

пн, 25 янв. 2021 г. в 11:37, Ahmad Fatoum <a.fatoum@pengutronix.de>:
>
> Hello,
>
> On 25.01.21 09:20, Alexander Shiyan wrote:
> > Hello.
> >
> > I recently upgraded my barebox from 2020.11 to 2021.01 for a custom board
> > based on TI AM335x processor.
> > The update revealed the inoperability of writing to NAND. When trying to write,
> > the bootloader hangs forever.
> > Reverting the commit "mtd: nand: omap_gpmc: Fix wrong length check" helps
> > to solve the problem.
>
> What happens when changing the condition to len > 0?
>
> > Does anyone have similar problems?
> >
> > Thanks!
> >
> > _______________________________________________
> > barebox mailing list
> > barebox@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/barebox
> >
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: AM335x NAND write hungs
  2021-01-25  8:56   ` Alexander Shiyan
@ 2021-01-25  9:21     ` Ahmad Fatoum
  0 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2021-01-25  9:21 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On 25.01.21 09:56, Alexander Shiyan wrote:
> Works as expected.
> Can you commit this change into master?

I'd prefer Sascha did that (after confirming that's
the correct fix).

> Thanks!
> 
> пн, 25 янв. 2021 г. в 11:37, Ahmad Fatoum <a.fatoum@pengutronix.de>:
>>
>> Hello,
>>
>> On 25.01.21 09:20, Alexander Shiyan wrote:
>>> Hello.
>>>
>>> I recently upgraded my barebox from 2020.11 to 2021.01 for a custom board
>>> based on TI AM335x processor.
>>> The update revealed the inoperability of writing to NAND. When trying to write,
>>> the bootloader hangs forever.
>>> Reverting the commit "mtd: nand: omap_gpmc: Fix wrong length check" helps
>>> to solve the problem.
>>
>> What happens when changing the condition to len > 0?
>>
>>> Does anyone have similar problems?
>>>
>>> Thanks!
>>>
>>> _______________________________________________
>>> barebox mailing list
>>> barebox@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/barebox
>>>
>>
>> --
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH] mtd: nand: omap_gpmc: Fix wrong length check for real
  2021-01-25  8:20 AM335x NAND write hungs Alexander Shiyan
  2021-01-25  8:37 ` Ahmad Fatoum
@ 2021-01-25  9:21 ` Sascha Hauer
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2021-01-25  9:21 UTC (permalink / raw)
  To: Barebox List; +Cc: Alexander Shiyan

Check for length > 0 because otherwise len may become smaller than
0 in which case the loop never ends.

Reported-by: Alexander Shiyan <eagle.alexander923@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index db1ca88791..0f3ffa1c0e 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -636,7 +636,7 @@ static void omap_write_buf_pref(struct nand_chip *nand_chip,
 	gpmc_prefetch_enable(info->gpmc_cs,
 			PREFETCH_FIFOTHRESHOLD_MAX, 0x0, len, 0x1);
 
-	while (len) {
+	while (len > 0) {
 		w_count = readl(info->gpmc_base + GPMC_PREFETCH_STATUS);
 		w_count = GPMC_PREFETCH_STATUS_FIFO_CNT(w_count);
 		w_count = w_count >> 2;
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2021-01-25  9:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25  8:20 AM335x NAND write hungs Alexander Shiyan
2021-01-25  8:37 ` Ahmad Fatoum
2021-01-25  8:56   ` Alexander Shiyan
2021-01-25  9:21     ` Ahmad Fatoum
2021-01-25  9:21 ` [PATCH] mtd: nand: omap_gpmc: Fix wrong length check for real Sascha Hauer

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