linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* GPMI iMX6ull timeout on DMA
@ 2019-07-29  6:41 Greg Ungerer
  2019-07-29  8:36 ` Miquel Raynal
  2021-10-04  5:54 ` Christian Eggers
  0 siblings, 2 replies; 85+ messages in thread
From: Greg Ungerer @ 2019-07-29  6:41 UTC (permalink / raw)
  To: Miquel Raynal; +Cc: linux-mtd

Hi Miquel,

I am experiencing a problem with NAND flash DMA timeouts on
iMX6ull based boards. The problem is very similar to that
described in:

   https://linux-mtd.infradead.narkive.com/JIUulfFB/gpmi-imx6ull-timeout-on-dma

That didn't come to any specific resolution that I could see
in that thread.

The boot trace on the console for me looks like this:

nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
nand: Micron MT29F2G08ABAEAWP
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
gpmi-nand 1806000.gpmi-nand: DMA timeout, last DMA
gpmi-nand 1806000.gpmi-nand: Show GPMI registers :
gpmi-nand 1806000.gpmi-nand: offset 0x000 : 0x20830002
gpmi-nand 1806000.gpmi-nand: offset 0x010 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x020 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x030 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x040 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x050 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x060 : 0x01c6800c
gpmi-nand 1806000.gpmi-nand: offset 0x070 : 0x00010101
gpmi-nand 1806000.gpmi-nand: offset 0x080 : 0xe0000000
gpmi-nand 1806000.gpmi-nand: offset 0x090 : 0x23023336
gpmi-nand 1806000.gpmi-nand: offset 0x0a0 : 0x000001ee
gpmi-nand 1806000.gpmi-nand: offset 0x0b0 : 0xff000001
gpmi-nand 1806000.gpmi-nand: offset 0x0c0 : 0x00000001
gpmi-nand 1806000.gpmi-nand: offset 0x0d0 : 0x05020000
gpmi-nand 1806000.gpmi-nand: Show BCH registers :
gpmi-nand 1806000.gpmi-nand: offset 0x000 : 0x00000100
gpmi-nand 1806000.gpmi-nand: offset 0x010 : 0x00000010
gpmi-nand 1806000.gpmi-nand: offset 0x020 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x030 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x040 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x050 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x060 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x070 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x080 : 0x030a2080
gpmi-nand 1806000.gpmi-nand: offset 0x090 : 0x083e2080
gpmi-nand 1806000.gpmi-nand: offset 0x0a0 : 0x070a4080
gpmi-nand 1806000.gpmi-nand: offset 0x0b0 : 0x10da4080
gpmi-nand 1806000.gpmi-nand: offset 0x0c0 : 0x070a4080
gpmi-nand 1806000.gpmi-nand: offset 0x0d0 : 0x10da4080
gpmi-nand 1806000.gpmi-nand: offset 0x0e0 : 0x070a4080
gpmi-nand 1806000.gpmi-nand: offset 0x0f0 : 0x10da4080
gpmi-nand 1806000.gpmi-nand: offset 0x100 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x110 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x120 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x130 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x140 : 0x00000000
gpmi-nand 1806000.gpmi-nand: offset 0x150 : 0x20484342
gpmi-nand 1806000.gpmi-nand: offset 0x160 : 0x01000000
gpmi-nand 1806000.gpmi-nand: offset 0x170 : 0x00000000
gpmi-nand 1806000.gpmi-nand: BCH Geometry :
GF length              : 13
ECC Strength           : 8
Page Size in Bytes     : 2110
Metadata Size in Bytes : 10
ECC Chunk0 Size in Bytes: 512
ECC Chunkn Size in Bytes: 512
ECC Chunk Count        : 4
Payload Size in Bytes  : 2048
Auxiliary Size in Bytes: 16
Auxiliary Status Offset: 12
Block Mark Byte Offset : 1999
Block Mark Bit Offset  : 0
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -110
nand: timing mode 5 not acknowledged by the NAND chip
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
Scanning device for bad blocks
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
....
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -22
5 fixed-partitions partitions found on MTD device gpmi-nand
Creating 5 MTD partitions on "gpmi-nand":
0x000000000000-0x000000500000 : "u-boot"
0x000000500000-0x000000600000 : "u-boot-env"
0x000000600000-0x000000800000 : "log"
0x000000800000-0x000010000000 : "flash"
0x000000000000-0x000010000000 : "all"
gpmi-nand 1806000.gpmi-nand: driver registered.


This is using a linux kernel v5.1.14. I have seen this happen on
a number of boards I have here - but it is only occasional. It
only happens once in a while on boot, maybe 1 in 40 or more times.
So it can take quite a while to reproduce (using a boot loop setup).

As per the email thread I pointed to above I looked at reverting
those patches, but that was not at all easy given how much the gpmi
driver code had moved. So instead I modified the code with this:

--- a/linux/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
+++ b/linux/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
@@ -481,6 +481,7 @@ static void gpmi_nfc_compute_timings(struct gpmi_nand_data *this,
  
  void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
  {
+#if 0
         struct gpmi_nfc_hardware_timing *hw = &this->hw;
         struct resources *r = &this->resources;
         void __iomem *gpmi_regs = r->gpmi_regs;
@@ -505,6 +512,7 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
  
         /* Wait for the DLL to settle. */
         udelay(dll_wait_time_us);
+#endif
  }
  
  int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,

So far after a couple of days of testing with this I no longer
see the DMA timeout.

Any thoughts?

Regards
Greg


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 85+ messages in thread
* GPMI IMX6ull timeout on dma
@ 2018-10-02 13:22 Michael Nazzareno Trimarchi
  2018-10-04 14:36 ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 85+ messages in thread
From: Michael Nazzareno Trimarchi @ 2018-10-02 13:22 UTC (permalink / raw)
  To: Han Xu, Boris Brezillon; +Cc: linux-mtd

Hi all

I have a strange problem on booting an imx6ull system. The problem is
not systematic and seems that it depends on how bootloader is using
the nand on first stage boot. BTW kernel can not always pass to go to
edo time 5 (even 4). If I power off and power on the unit the nand
work properly.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.17.0-rc1 (michael@panicking) (gcc
version 6.4.0 (Buildroot 2018.02-rc2-00006-g39101b7)) #2 SMP Tue Oct 2
08:24:58 CEST 2018

[    1.612357] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0xda
[    1.618905] nand: Micron MT29F2G08ABAEAH4
[    1.623126] nand: 256 MiB, SLC, erase size: 128 KiB, page size:
2048, OOB size: 64
[    2.651940] gpmi-nand 1806000.gpmi-nand: DMA timeout, last DMA :2
[    2.658146] gpmi-nand 1806000.gpmi-nand: Show GPMI registers :
[    2.664203] gpmi-nand 1806000.gpmi-nand: offset 0x000 : 0x20830002
[    2.670474] gpmi-nand 1806000.gpmi-nand: offset 0x010 : 0x00000000
[    2.676849] gpmi-nand 1806000.gpmi-nand: offset 0x020 : 0x00000000
[    2.683217] gpmi-nand 1806000.gpmi-nand: offset 0x030 : 0x00000000
[    2.689482] gpmi-nand 1806000.gpmi-nand: offset 0x040 : 0x00000000
[    2.695840] gpmi-nand 1806000.gpmi-nand: offset 0x050 : 0x00000000
[    2.702202] gpmi-nand 1806000.gpmi-nand: offset 0x060 : 0x01c6800c
[    2.708470] gpmi-nand 1806000.gpmi-nand: offset 0x070 : 0x00010101
[    2.714826] gpmi-nand 1806000.gpmi-nand: offset 0x080 : 0xe0000000
[    2.721093] gpmi-nand 1806000.gpmi-nand: offset 0x090 : 0x23023336
[    2.727450] gpmi-nand 1806000.gpmi-nand: offset 0x0a0 : 0x000001ee
[    2.733812] gpmi-nand 1806000.gpmi-nand: offset 0x0b0 : 0xff000001
[    2.740078] gpmi-nand 1806000.gpmi-nand: offset 0x0c0 : 0x00000000
[    2.746437] gpmi-nand 1806000.gpmi-nand: offset 0x0d0 : 0x05020000
[    2.752794] gpmi-nand 1806000.gpmi-nand: Show BCH registers :
[    2.758626] gpmi-nand 1806000.gpmi-nand: offset 0x000 : 0x00000100
[    2.764982] gpmi-nand 1806000.gpmi-nand: offset 0x010 : 0x00000010
[    2.771247] gpmi-nand 1806000.gpmi-nand: offset 0x020 : 0x00000000
[    2.777604] gpmi-nand 1806000.gpmi-nand: offset 0x030 : 0x00000000
[    2.783961] gpmi-nand 1806000.gpmi-nand: offset 0x040 : 0x00000000
[    2.790226] gpmi-nand 1806000.gpmi-nand: offset 0x050 : 0x00000000
[    2.796582] gpmi-nand 1806000.gpmi-nand: offset 0x060 : 0x00000000
[    2.802942] gpmi-nand 1806000.gpmi-nand: offset 0x070 : 0x00000000
[    2.809208] gpmi-nand 1806000.gpmi-nand: offset 0x080 : 0x030a2080
[    2.815564] gpmi-nand 1806000.gpmi-nand: offset 0x090 : 0x083e2080
[    2.821924] gpmi-nand 1806000.gpmi-nand: offset 0x0a0 : 0x070a4080
[    2.828191] gpmi-nand 1806000.gpmi-nand: offset 0x0b0 : 0x10da4080
[    2.834546] gpmi-nand 1806000.gpmi-nand: offset 0x0c0 : 0x070a4080
[    2.840813] gpmi-nand 1806000.gpmi-nand: offset 0x0d0 : 0x10da4080
[    2.847170] gpmi-nand 1806000.gpmi-nand: offset 0x0e0 : 0x070a4080
[    2.853527] gpmi-nand 1806000.gpmi-nand: offset 0x0f0 : 0x10da4080
[    2.859794] gpmi-nand 1806000.gpmi-nand: offset 0x100 : 0x00000000
[    2.866153] gpmi-nand 1806000.gpmi-nand: offset 0x110 : 0x00000000
[    2.872513] gpmi-nand 1806000.gpmi-nand: offset 0x120 : 0x00000000
[    2.878779] gpmi-nand 1806000.gpmi-nand: offset 0x130 : 0x00000000
[    2.885135] gpmi-nand 1806000.gpmi-nand: offset 0x140 : 0x00000000
[    2.891401] gpmi-nand 1806000.gpmi-nand: offset 0x150 : 0x20484342
[    2.897759] gpmi-nand 1806000.gpmi-nand: offset 0x160 : 0x01000000
[    2.904117] gpmi-nand 1806000.gpmi-nand: offset 0x170 : 0x00000000
[    2.910400] gpmi-nand 1806000.gpmi-nand: BCH Geometry :
[    2.910400] GF length              : 13
[    2.910400] ECC Strength           : 8
[    2.910400] Page Size in Bytes     : 2110
[    2.910400] Metadata Size in Bytes : 10
[    2.910400] ECC Chunk Size in Bytes: 512
[    2.910400] ECC Chunk Count        : 4
[    2.910400] Payload Size in Bytes  : 2048
[    2.910400] Auxiliary Size in Bytes: 16
[    2.910400] Auxiliary Status Offset: 12
[    2.910400] Block Mark Byte Offset : 1999
[    2.910400] Block Mark Bit Offset  : 0
[    2.958231] gpmi-nand 1806000.gpmi-nand: Chip: 0, Error -110

What bootloader do is just attach the ubi and then boot the image

ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=5", size 231 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
ubi0: good PEBs: 1844, bad PEBs: 4, corrupted PEBs: 0
ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 2, total reserved PEBs: 1842, PEBs reserved for
bad PEB handling: 36
Read 0 bytes from volume kernel to 82800000
No size specified -> Using max size (16887808)
## Loading kernel from FIT Image at 82800000 ...
   Using 'conf@2' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@1' kernel subimage
     Description:  kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x828000ac
     Data Size:    6685920 Bytes = 6.4 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x80008000
     Entry Point:  0x80008000
     Hash algo:    sha1
     Hash value:   4646b0eea535d8ea9e2f7167bdeedc7668b2a948
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 82800000 ...
   Using 'conf@2' configuration
   Trying 'fdt@2' fdt subimage
     Description:  imx6ull-bammi.dtb
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x82e67730
     Data Size:    28667 Bytes = 28 KiB
     Architecture: ARM
     Hash algo:    sha1
     Hash value:   1cf147576a30eb901a6306172f9385d6a6b65753
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x82e67730
   Loading Kernel Image ... OK
   Using Device Tree in place at 82e67730, end 82e7172a
   Using Device Tree in place at 82e67730, end 82e7472a

Any idea?

Michael

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

end of thread, other threads:[~2021-11-01  4:02 UTC | newest]

Thread overview: 85+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29  6:41 GPMI iMX6ull timeout on DMA Greg Ungerer
2019-07-29  8:36 ` Miquel Raynal
2019-07-29  8:42   ` Michael Nazzareno Trimarchi
2019-07-29 12:18     ` Greg Ungerer
2019-07-29 12:20       ` Michael Nazzareno Trimarchi
2019-07-29 12:33   ` Greg Ungerer
2019-07-29 12:47     ` Miquel Raynal
2019-07-29 12:49       ` Michael Nazzareno Trimarchi
2019-07-29 12:55         ` Miquel Raynal
2019-07-29 13:00           ` Michael Nazzareno Trimarchi
2019-07-29 13:22             ` Miquel Raynal
2019-07-29 20:00               ` Michael Nazzareno Trimarchi
2019-07-29 21:02                 ` Miquel Raynal
2019-07-30  0:28       ` Greg Ungerer
2019-07-30  0:41         ` Greg Ungerer
2019-07-30  6:06           ` Greg Ungerer
2019-07-30  8:38             ` Miquel Raynal
2019-07-30  8:58               ` Boris Brezillon
2019-07-31  2:05               ` Greg Ungerer
2019-07-31  6:28                 ` Boris Brezillon
2019-08-02  7:19                   ` Greg Ungerer
2019-08-02 12:34                   ` Greg Ungerer
2019-08-02 12:51                     ` Boris Brezillon
2019-08-05  5:51                       ` Greg Ungerer
2019-08-07 16:05                         ` Miquel Raynal
2019-08-08  0:43                           ` Greg Ungerer
2019-08-08 16:36                         ` Boris Brezillon
2019-08-09  5:20                           ` Greg Ungerer
2019-08-09  6:23                             ` Boris Brezillon
2019-08-09  6:55                               ` Greg Ungerer
2019-08-09  7:32                                 ` Boris Brezillon
2019-08-09 13:57                                   ` Greg Ungerer
2019-08-09 13:59                                     ` Boris Brezillon
2019-08-12  2:50                                       ` Greg Ungerer
2019-08-12  4:04                                         ` Greg Ungerer
2019-08-12  7:31                                         ` Boris Brezillon
2019-08-13  0:50                                           ` Greg Ungerer
2021-01-28  9:45                                             ` Michael Nazzareno Trimarchi
2021-01-28 10:26                                               ` Miquel Raynal
2021-01-28 10:35                                                 ` Michael Nazzareno Trimarchi
2021-01-28 11:55                                                   ` Michael Nazzareno Trimarchi
2021-01-29 12:43                                               ` Greg Ungerer
2021-01-30  9:41                                                 ` Michael Nazzareno Trimarchi
2021-02-01 14:13                                                   ` Miquel Raynal
2021-02-01 14:32                                                     ` Michael Nazzareno Trimarchi
2021-02-01 15:08                                                       ` Michael Nazzareno Trimarchi
2021-02-01 15:14                                                         ` Miquel Raynal
2021-02-01 15:17                                                           ` Michael Nazzareno Trimarchi
2021-10-15 20:05                                                           ` Michael Trimarchi
2021-10-15 20:12                                                             ` Michael Nazzareno Trimarchi
2021-10-18  7:19                                                             ` Miquel Raynal
2021-10-18  7:33                                                               ` Michael Nazzareno Trimarchi
2021-10-18  7:43                                                                 ` Miquel Raynal
2021-10-04  5:54 ` Christian Eggers
2021-10-04  6:27   ` Michael Nazzareno Trimarchi
2021-10-04 15:33     ` Miquel Raynal
2021-10-04 16:06       ` Han Xu
2021-10-05  6:02         ` Christian Eggers
2021-10-08  9:55         ` Christian Eggers
2021-10-08 12:08           ` Stefan Riedmüller
2021-10-08 12:27             ` Miquel Raynal
2021-10-08 13:11               ` Christian Eggers
2021-10-08 13:29                 ` Miquel Raynal
2021-10-08 13:36                   ` Miquel Raynal
2021-10-08 13:49                     ` Christian Eggers
2021-10-08 16:07                       ` Miquel Raynal
2021-10-09  5:53                         ` Michael Nazzareno Trimarchi
2021-10-11  6:46                           ` Miquel Raynal
2021-10-12  9:02                             ` [RFC PATCH 1/2] mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6 Stefan Riedmueller
2021-10-12  9:02                               ` [RFC PATCH 2/2] gpmi-nand: Add ERR007117 protection for nfc_apply_timings Stefan Riedmueller
2021-10-13  5:01                                 ` Han Xu
2021-10-22  8:45                                   ` Stefan Riedmüller
2021-10-22 14:35                                     ` han.xu
2021-10-25  9:39                                       ` Stefan Riedmüller
2021-10-28  9:28                                       ` Stefan Riedmüller
2021-11-01  4:01                                         ` han.xu
2021-10-13  6:10                                 ` Christian Eggers
2021-10-13  6:00                               ` [RFC PATCH 1/2] mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6 Christian Eggers
2021-10-09  6:26                         ` GPMI iMX6ull timeout on DMA Christian Eggers
2021-10-13  6:15                           ` Christian Eggers
2021-10-08 13:13               ` Christian Eggers
2021-10-08 13:30                 ` Miquel Raynal
2021-10-09  6:33             ` Christian Eggers
  -- strict thread matches above, loose matches on Subject: below --
2018-10-02 13:22 GPMI IMX6ull timeout on dma Michael Nazzareno Trimarchi
2018-10-04 14:36 ` Michael Nazzareno Trimarchi

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).