Re: [PATCH v8 0/3] add the GPMI controller driver for IMX23/IMX28

Koen Beel
2011-08-02T07:33:49Z

[-- Attachment #1: Type: text/plain, Size: 6148 bytes --]

Hi,

On Tue, Aug 2, 2011 at 8:37 AM, Huang Shijie <b32955@freescale.com> wrote:
> Hi,
>>
>> Hi,
>>
>> Don't think it's a hardware issue. After all it is working on the
>> mx23evk using the Freescale BSP based on 2.6.35.3.
>
> I doubt the Freescale BSP has fix the conflict, while the community kernel
> does not
> fix it.
> Anyway, I will do more test on the mx23 board myself.

Strange indeed. I suspect that the BSP used another way to mark bad blocks.

>
>
>
>> Now I tested using this kernel command line:
>> mtdparts=gpmi-nand:20m(boot),-(user) gpmi_debug_init
>> (So I removed the ubi rootfs stuff, see previous mails).
>>
>> Its booting fine now without complaining about dma timeouts.
>
> ok.

That's mainly because the ubi stuff is not done at startup.

>>
>> Have tried flash_eraseall /dev/mtd1. Now it's complaining and thinking
>> all blocks are bad. So a "flash_erase: Skipping bad block at 1db00000"
>> message for every erase block.
>> Writing 1 to /sys/devices/platform/imx23-gpmi-nand/ignorebad, makes to
>
> This is a very dangerous interface.

I know but it solved an issue here. Now flash_eraseall seems to be
working again without that ignorebad turned on (only finds one bad
erase blcok).
Again: I suspect that the BSP used another way to mark bad blocks.

>
>> go a little further giving 'only one' error but I doubt it's working
>> at all. See attached log file.
>>
>> When the trying ubiformat /dev/mtd1 its stopping with a dma timeout.
>
> echo 0x20 > /sys/devices/platform/imx23-gpmi-nand/gpmi_debug
>
> to show the GPMI register when the DMA timeout occurs.

Don't have this sysfs interface here. I also don't see where it is
registered in the driver code.
Anyway I have hardcoded GPMI_DEBUG_CRAZY in gpmi_debug_setup.

log file attached.

Regards,
Koen

>
>
> Best Regards
> Huang Shijie
>>
>> Every subsequent action (e.g. using ubiformat or flash_eraseall) using
>> that dma channel is failing.
>> I have put a printk in mxs-dma.c around line 387:
>>
>>     if (mxs_chan->status == DMA_IN_PROGRESS&&  !append)
>>     {
>>         pr_err("dma already in progess!\n");
>>         return NULL;
>>     }
>>
>> I see that printk also in the log file in attach. Seems like the
>> mxs-dma is failing at some point and for the rest of the time always
>> keeps it's status at DMA_IN_PROGRESS
>>
>> Any input or feedback is welcome.
>>
>> Regards,
>> Koen
>>
>>
>> On Sun, Jul 31, 2011 at 3:51 PM, Marek Vasut<marek.vasut@gmail.com>
>>  wrote:
>>>
>>> On Friday, July 29, 2011 05:00:48 PM Koen Beel wrote:
>>>>
>>>> On Fri, Jul 29, 2011 at 2:41 PM, Lothar Waßmann<LW@karo-electronics.de>
>>>
>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Koen Beel writes:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> On Fri, Jul 29, 2011 at 9:20 AM, Lothar
>>>>>> Waßmann<LW@karo-electronics.de>
>>>
>>> wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Koen Beel writes:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have test on mx23evk board. Still see the same issues.
>>>>>>>>
>>>>>>>> On Wed, Jul 27, 2011 at 3:53 AM, Huang Shijie<b32955@freescale.com>
>>>
>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Thanks for your test.
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> It's not really working for me.
>>>>>>>>>> I've applied all gpmi-nand driver patches and the dma driver
>>>>>>>>>> patches.
>>>>>>>>>>
>>>>>>>>>> I have added following kernel parameters:
>>>>>>>>>> mtdparts=gpmi-nand:20m(boot),-(user) ubi.mtd=1 root=ubi0:rootfs0
>>>>>>>>>> rootfstype=ubifs gpmi_debug_init
>>>>>>>>>>
>>>>>>>>>> During boot I get already get DMA timeout:
>>>>>>>>>> [    2.560000] [ start_dma_without_bch_irq : 392 ] DMA timeout,
>>>>>>>>>> last DMA
>>>>>>>>>>
>>>>>>>>>> :1
>>>>>>>>>>
>>>>>>>>>> [    3.560000] [ start_dma_with_bch_irq : 427 ] bch timeout!!!
>>>>>>>>>> ...
>>>>>>>>>> (see log file in attach line 89)
>>>>>>>>
>>>>>>>> I still see this DMA timeout when booting.
>>>>>>>> What kernel parameters do you use? I still use same as above.
>>>>>>>
>>>>>>> Do you have an SD card in the system? I'm getting the same error when
>>>>>>> accessing an SD card. Without SD card I can use the flash without any
>>>>>>> errors.
>>>>>>
>>>>>> No SD card in the system. At least not on my mx23evk board.
>>>>>> My real target hardware has a SDIO wifi chip.
>>>>>>
>>>>>> Are you also testing on the mx23evk board? Really strange it is not
>>>>>> reproducible here then.
>>>>>> Anyone using mx23evk please give:
>>>>>> - revision number of board (I have tested on rev C1)
>>>>>> - kernel parameter used (see previous mail for mine)
>>>>>
>>>>> It's getting ever more strange. I only have problems with concurrent
>>>>> access to the flash and SD-card when I do file system based accessed
>>>>> to the SD card.
>>>>> A 'dd if=/dev/mmcblk0 of=/dev/null' while excessively using the flash
>>>>> works well, while mounting the SD card and doing an 'ls' produces
>>>>> immediate BCH DMA timeouts.
>>>>>
>>>>> Perhaps someone can make anything out of that.
>>>>
>>>> I have checked and the function dma_irq_callback is never called
>>>> during my tests. This means the DMA transfer does not even works once.
>>>>
>>>> Also no clue here ...
>>>
>>> Aren't you getting some undervolt on the powerrail for example ? btw the
>>> driver
>>> looks a bit crappy to me, but let's believe it works ;-)
>>>
>>>>> Lothar Waßmann
>>>>> --
>>>>> ___________________________________________________________
>>>>>
>>>>> Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
>>>>> Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
>>>>> Geschäftsführer: Matthias Kaussen
>>>>> Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
>>>>>
>>>>> www.karo-electronics.de | info@karo-electronics.de
>>>>> ___________________________________________________________
>>>>
>>>> _______________________________________________
>>>> linux-arm-kernel mailing list
>>>> linux-arm-kernel@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
>

[-- Attachment #2: log2 --]
[-- Type: application/octet-stream, Size: 2897 bytes --]

# flash_eraseall /dev/mtd1
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
Erasing 512 Kibyte @ 5c00000 -- 2 % complete flash_erase: Skipping bad block at 05c80000
Erasing 512 Kibyte @ feb80000 -- 100 % complete
#
#
#
# ubiformat /dev/mtd0
ubiformat: mtd0 (nand), size 20971520 bytes (20.0 MiB), 40 eraseblocks of 524288 bytes (512.0 KiB), min. I/O size 4096 bytes
libscan: scanning eraseblock 0 -- 2 % complete [ 449.760000] [ start_dma_without_bch_irq : 392 ] DMA timeout, last DMA :1
[ 449.760000] [ gpmi_show_regs : 076 ] -------------- Show GPMI registers ----------
[ 449.770000] [ gpmi_show_regs : 079 ] offset 0x000 : 0x238010da
[ 449.780000] [ gpmi_show_regs : 079 ] offset 0x010 : 0x00000000
[ 449.780000] [ gpmi_show_regs : 079 ] offset 0x020 : 0x000011ff
[ 449.790000] [ gpmi_show_regs : 079 ] offset 0x030 : 0x000010da
[ 449.800000] [ gpmi_show_regs : 079 ] offset 0x040 : 0x40da4480
[ 449.800000] [ gpmi_show_regs : 079 ] offset 0x050 : 0x40d95000
[ 449.810000] [ gpmi_show_regs : 079 ] offset 0x060 : 0x0004000c
[ 449.820000] [ gpmi_show_regs : 079 ] offset 0x070 : 0x00010203
[ 449.820000] [ gpmi_show_regs : 079 ] offset 0x080 : 0x05000000
[ 449.830000] [ gpmi_show_regs : 079 ] offset 0x090 : 0x09020101
[ 449.840000] [ gpmi_show_regs : 079 ] offset 0x0a0 : 0x00000030
[ 449.840000] [ gpmi_show_regs : 079 ] offset 0x0b0 : 0x80000010
[ 449.850000] [ gpmi_show_regs : 079 ] offset 0x0c0 : 0x100000ba
[ 449.860000] [ gpmi_show_regs : 079 ] offset 0x0d0 : 0x03000000
[ 449.860000] [ gpmi_show_regs : 081 ] -------------- Show GPMI registers end ----------
[ 449.870000] Kernel panic - not syncing: -----------DMA FAILED------------------
[ 449.880000] [<c033b9b0>] (unwind_backtrace+0x0/0xf0) from [<c05cfacc>] (panic+0x58/0x18c)
[ 449.890000] [<c05cfacc>] (panic+0x58/0x18c) from [<c0518ac4>] (start_dma_without_bch_irq+0x98/0xac)
[ 449.900000] [<c0518ac4>] (start_dma_without_bch_irq+0x98/0xac) from [<c0518b04>] (start_dma_with_bch_irq+0x2c/0x78)
[ 449.910000] [<c0518b04>] (start_dma_with_bch_irq+0x2c/0x78) from [<c051975c>] (gpmi_read_page+0x160/0x1cc)
[ 449.920000] [<c051975c>] (gpmi_read_page+0x160/0x1cc) from [<c051822c>] (mil_ecc_read_page+0x64/0x1dc)
[ 449.930000] [<c051822c>] (mil_ecc_read_page+0x64/0x1dc) from [<c051348c>] (nand_do_read_ops+0x1d8/0x468)
[ 449.940000] [<c051348c>] (nand_do_read_ops+0x1d8/0x468) from [<c0513a90>] (nand_read+0x94/0xb0)