* GPMI iMX6ull timeout on DMA
@ 2019-07-29 6:41 Greg Ungerer
2019-07-29 8:36 ` Miquel Raynal
0 siblings, 1 reply; 50+ 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] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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:33 ` Greg Ungerer
0 siblings, 2 replies; 50+ messages in thread
From: Miquel Raynal @ 2019-07-29 8:36 UTC (permalink / raw)
To: Greg Ungerer; +Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd
Hi Greg,
One question below.
+Michael
+Sascha
Hello Michael, here is a similar issue to yours, I know you did not
have enough time to share your solution but here we have someone else
reproducing the issue, would you mind sharing a branch or a patch, even
a WIP one, just to help debugging?
Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> 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
What is the final timing mode used? Most of us tested in mode 5 I
guess, maybe mode 4 is broken (don't know if this is the one used here,
neither why mode 5 is refused). Can you please try by limiting the mode
to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> 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).
That's strange... I don't get what would produce such unstable issue.
>
> 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
>
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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:33 ` Greg Ungerer
1 sibling, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2019-07-29 8:42 UTC (permalink / raw)
To: Miquel Raynal; +Cc: s.hauer, Greg Ungerer, linux-mtd
Hi all
On Mon, Jul 29, 2019 at 10:36 AM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> Hi Greg,
>
> One question below.
>
> +Michael
> +Sascha
>
> Hello Michael, here is a similar issue to yours, I know you did not
> have enough time to share your solution but here we have someone else
> reproducing the issue, would you mind sharing a branch or a patch, even
> a WIP one, just to help debugging?
>
I have patches reverted as I mention in the email. The step to
reproduce is simple.
Just reboot every successful boot.
Michael
> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>
> > 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
>
> What is the final timing mode used? Most of us tested in mode 5 I
> guess, maybe mode 4 is broken (don't know if this is the one used here,
> neither why mode 5 is refused). Can you please try by limiting the mode
> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
>
> > 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).
>
> That's strange... I don't get what would produce such unstable issue.
>
> >
> > 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
> >
>
> Thanks,
> Miquèl
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 8:42 ` Michael Nazzareno Trimarchi
@ 2019-07-29 12:18 ` Greg Ungerer
2019-07-29 12:20 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-07-29 12:18 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi, Miquel Raynal; +Cc: s.hauer, linux-mtd
Hi Michael,
On 29/7/19 6:42 pm, Michael Nazzareno Trimarchi wrote:
> Hi all
>
> On Mon, Jul 29, 2019 at 10:36 AM Miquel Raynal
> <miquel.raynal@bootlin.com> wrote:
>>
>> Hi Greg,
>>
>> One question below.
>>
>> +Michael
>> +Sascha
>>
>> Hello Michael, here is a similar issue to yours, I know you did not
>> have enough time to share your solution but here we have someone else
>> reproducing the issue, would you mind sharing a branch or a patch, even
>> a WIP one, just to help debugging?
>>
>
> I have patches reverted as I mention in the email. The step to
> reproduce is simple.
>
> Just reboot every successful boot.
Testing like this how often does it occur?
Regards
Greg
> Michael
>
>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>
>>> 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
>>
>> What is the final timing mode used? Most of us tested in mode 5 I
>> guess, maybe mode 4 is broken (don't know if this is the one used here,
>> neither why mode 5 is refused). Can you please try by limiting the mode
>> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
>>
>>> 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).
>>
>> That's strange... I don't get what would produce such unstable issue.
>>
>>>
>>> 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
>>>
>>
>> Thanks,
>> Miquèl
>
>
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 12:18 ` Greg Ungerer
@ 2019-07-29 12:20 ` Michael Nazzareno Trimarchi
0 siblings, 0 replies; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2019-07-29 12:20 UTC (permalink / raw)
To: Greg Ungerer; +Cc: s.hauer, linux-mtd, Miquel Raynal
Hi
On Mon, Jul 29, 2019 at 2:19 PM Greg Ungerer <gerg@kernel.org> wrote:
>
> Hi Michael,
>
> On 29/7/19 6:42 pm, Michael Nazzareno Trimarchi wrote:
> > Hi all
> >
> > On Mon, Jul 29, 2019 at 10:36 AM Miquel Raynal
> > <miquel.raynal@bootlin.com> wrote:
> >>
> >> Hi Greg,
> >>
> >> One question below.
> >>
> >> +Michael
> >> +Sascha
> >>
> >> Hello Michael, here is a similar issue to yours, I know you did not
> >> have enough time to share your solution but here we have someone else
> >> reproducing the issue, would you mind sharing a branch or a patch, even
> >> a WIP one, just to help debugging?
> >>
> >
> > I have patches reverted as I mention in the email. The step to
> > reproduce is simple.
> >
> > Just reboot every successful boot.
>
> Testing like this how often does it occur?
>
Not more then 60 reboot ;). The problem is how is done the code the
system can not rebooting without an hardware watchdog
MIchael
> Regards
> Greg
>
>
> > Michael
> >
> >> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>
> >>> 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
> >>
> >> What is the final timing mode used? Most of us tested in mode 5 I
> >> guess, maybe mode 4 is broken (don't know if this is the one used here,
> >> neither why mode 5 is refused). Can you please try by limiting the mode
> >> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> >>
> >>> 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).
> >>
> >> That's strange... I don't get what would produce such unstable issue.
> >>
> >>>
> >>> 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
> >>>
> >>
> >> Thanks,
> >> Miquèl
> >
> >
> >
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 8:36 ` Miquel Raynal
2019-07-29 8:42 ` Michael Nazzareno Trimarchi
@ 2019-07-29 12:33 ` Greg Ungerer
2019-07-29 12:47 ` Miquel Raynal
1 sibling, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-07-29 12:33 UTC (permalink / raw)
To: Miquel Raynal; +Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd
Hi Miquel,
On 29/7/19 6:36 pm, Miquel Raynal wrote:
> Hi Greg,
>
> One question below.
>
> +Michael
> +Sascha
>
> Hello Michael, here is a similar issue to yours, I know you did not
> have enough time to share your solution but here we have someone else
> reproducing the issue, would you mind sharing a branch or a patch, even
> a WIP one, just to help debugging?
>
> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>
>> 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
>
> What is the final timing mode used? Most of us tested in mode 5 I
> guess, maybe mode 4 is broken (don't know if this is the one used here,
> neither why mode 5 is refused). Can you please try by limiting the mode
> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
Sure, how to do that?
>> 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).
>
> That's strange... I don't get what would produce such unstable issue.
My initial guess is that the calculated timing is very marginal.
The problem seems more likely to happen if flash write activity
had been occurring just before a soft reboot. Its not a guarantee,
just more likely.
Interesting observation is that Michael was using Micron flash,
and boards that I have with the problem also have Micron flash.
Both a form of Micron MT29F2G08.
I have similar boards, iMX6ull based, with different brands of
NAND flash and I have not seen any problem on them.
Regards
Greg
>> 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
>>
>
> Thanks,
> Miquèl
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 12:33 ` Greg Ungerer
@ 2019-07-29 12:47 ` Miquel Raynal
2019-07-29 12:49 ` Michael Nazzareno Trimarchi
2019-07-30 0:28 ` Greg Ungerer
0 siblings, 2 replies; 50+ messages in thread
From: Miquel Raynal @ 2019-07-29 12:47 UTC (permalink / raw)
To: Greg Ungerer
Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd, Boris Brezillon
Hi Greg,
+ Boris
Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> Hi Miquel,
>
> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> > Hi Greg,
> >
> > One question below.
> >
> > +Michael
> > +Sascha
> >
> > Hello Michael, here is a similar issue to yours, I know you did not
> > have enough time to share your solution but here we have someone else
> > reproducing the issue, would you mind sharing a branch or a patch, even
> > a WIP one, just to help debugging?
> >
> > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >
> >> 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
> >
> > What is the final timing mode used? Most of us tested in mode 5 I
> > guess, maybe mode 4 is broken (don't know if this is the one used here,
> > neither why mode 5 is refused). Can you please try by limiting the mode
> > to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
>
> Sure, how to do that?
This loop [1] tries to configure each mode (5, 4, ...) until one
succeeds (default is 0: must always work). Please try to limit mode to
0, 1, etc.
Mode 0 should work.
[1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
>
>
> >> 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).
> >
> > That's strange... I don't get what would produce such unstable issue.
>
> My initial guess is that the calculated timing is very marginal.
What do you mean by "marginal"?
> The problem seems more likely to happen if flash write activity
> had been occurring just before a soft reboot. Its not a guarantee,
> just more likely.
That's really disturbing. I doubt this is the real cause though.
>
> Interesting observation is that Michael was using Micron flash,
> and boards that I have with the problem also have Micron flash.
> Both a form of Micron MT29F2G08.
>
> I have similar boards, iMX6ull based, with different brands of
> NAND flash and I have not seen any problem on them.
That's great to narrow down the root cause. Maybe these chips have
tighter timing constraints.
>
> Regards
> Greg
>
>
>
> >> 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
> >>
> >
> > Thanks,
> > Miquèl
> >
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 12:47 ` Miquel Raynal
@ 2019-07-29 12:49 ` Michael Nazzareno Trimarchi
2019-07-29 12:55 ` Miquel Raynal
2019-07-30 0:28 ` Greg Ungerer
1 sibling, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2019-07-29 12:49 UTC (permalink / raw)
To: Miquel Raynal; +Cc: s.hauer, Greg Ungerer, linux-mtd, Boris Brezillon
Hi Miguel
On Mon, Jul 29, 2019 at 2:47 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Greg,
>
> + Boris
>
> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>
> > Hi Miquel,
> >
> > On 29/7/19 6:36 pm, Miquel Raynal wrote:
> > > Hi Greg,
> > >
> > > One question below.
> > >
> > > +Michael
> > > +Sascha
> > >
> > > Hello Michael, here is a similar issue to yours, I know you did not
> > > have enough time to share your solution but here we have someone else
> > > reproducing the issue, would you mind sharing a branch or a patch, even
> > > a WIP one, just to help debugging?
> > >
> > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> > >
> > >> 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
> > >
> > > What is the final timing mode used? Most of us tested in mode 5 I
> > > guess, maybe mode 4 is broken (don't know if this is the one used here,
> > > neither why mode 5 is refused). Can you please try by limiting the mode
> > > to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> >
> > Sure, how to do that?
>
> This loop [1] tries to configure each mode (5, 4, ...) until one
> succeeds (default is 0: must always work). Please try to limit mode to
> 0, 1, etc.
>
> Mode 0 should work.
>
This is not correct. When all the mode fail it fallback to 0 that does
not work. Already check
So the fallback is created for this situation
> [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
>
> >
> >
> > >> 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).
> > >
> > > That's strange... I don't get what would produce such unstable issue.
> >
> > My initial guess is that the calculated timing is very marginal.
>
> What do you mean by "marginal"?
>
I don't think that is timing calculation. I have tried to use the same timing
as before but when those are applide. Is it possible?
Michael
> > The problem seems more likely to happen if flash write activity
> > had been occurring just before a soft reboot. Its not a guarantee,
> > just more likely.
>
> That's really disturbing. I doubt this is the real cause though.
>
> >
> > Interesting observation is that Michael was using Micron flash,
> > and boards that I have with the problem also have Micron flash.
> > Both a form of Micron MT29F2G08.
> >
> > I have similar boards, iMX6ull based, with different brands of
> > NAND flash and I have not seen any problem on them.
>
> That's great to narrow down the root cause. Maybe these chips have
> tighter timing constraints.
>
> >
> > Regards
> > Greg
> >
> >
> >
> > >> 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
> > >>
> > >
> > > Thanks,
> > > Miquèl
> > >
>
> Thanks,
> Miquèl
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 12:49 ` Michael Nazzareno Trimarchi
@ 2019-07-29 12:55 ` Miquel Raynal
2019-07-29 13:00 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Miquel Raynal @ 2019-07-29 12:55 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi
Cc: s.hauer, Greg Ungerer, linux-mtd, Boris Brezillon
Hi Michael,
Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
Mon, 29 Jul 2019 14:49:19 +0200:
> Hi Miguel
>
> On Mon, Jul 29, 2019 at 2:47 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Greg,
> >
> > + Boris
> >
> > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >
> > > Hi Miquel,
> > >
> > > On 29/7/19 6:36 pm, Miquel Raynal wrote:
> > > > Hi Greg,
> > > >
> > > > One question below.
> > > >
> > > > +Michael
> > > > +Sascha
> > > >
> > > > Hello Michael, here is a similar issue to yours, I know you did not
> > > > have enough time to share your solution but here we have someone else
> > > > reproducing the issue, would you mind sharing a branch or a patch, even
> > > > a WIP one, just to help debugging?
> > > >
> > > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> > > >
> > > >> 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
> > > >
> > > > What is the final timing mode used? Most of us tested in mode 5 I
> > > > guess, maybe mode 4 is broken (don't know if this is the one used here,
> > > > neither why mode 5 is refused). Can you please try by limiting the mode
> > > > to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> > >
> > > Sure, how to do that?
> >
> > This loop [1] tries to configure each mode (5, 4, ...) until one
> > succeeds (default is 0: must always work). Please try to limit mode to
> > 0, 1, etc.
> >
> > Mode 0 should work.
> >
>
> This is not correct. When all the mode fail it fallback to 0 that does
> not work. Already check
> So the fallback is created for this situation
Sorry but I don't understand what you are saying.
Are you telling me that you already tried mode 0 and that it did not
work better than other timings?
>
> > [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
> >
> > >
> > >
> > > >> 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).
> > > >
> > > > That's strange... I don't get what would produce such unstable issue.
> > >
> > > My initial guess is that the calculated timing is very marginal.
> >
> > What do you mean by "marginal"?
> >
>
> I don't think that is timing calculation. I have tried to use the same timing
> as before but when those are applide. Is it possible?
^
I suppose the end of the sentence is missing?
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 12:55 ` Miquel Raynal
@ 2019-07-29 13:00 ` Michael Nazzareno Trimarchi
2019-07-29 13:22 ` Miquel Raynal
0 siblings, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2019-07-29 13:00 UTC (permalink / raw)
To: Miquel Raynal; +Cc: s.hauer, Greg Ungerer, linux-mtd, Boris Brezillon
Hi Miquel
On Mon, Jul 29, 2019 at 2:55 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Michael,
>
> Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> Mon, 29 Jul 2019 14:49:19 +0200:
>
> > Hi Miguel
> >
> > On Mon, Jul 29, 2019 at 2:47 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > >
> > > Hi Greg,
> > >
> > > + Boris
> > >
> > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> > >
> > > > Hi Miquel,
> > > >
> > > > On 29/7/19 6:36 pm, Miquel Raynal wrote:
> > > > > Hi Greg,
> > > > >
> > > > > One question below.
> > > > >
> > > > > +Michael
> > > > > +Sascha
> > > > >
> > > > > Hello Michael, here is a similar issue to yours, I know you did not
> > > > > have enough time to share your solution but here we have someone else
> > > > > reproducing the issue, would you mind sharing a branch or a patch, even
> > > > > a WIP one, just to help debugging?
> > > > >
> > > > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> > > > >
> > > > >> 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
> > > > >
> > > > > What is the final timing mode used? Most of us tested in mode 5 I
> > > > > guess, maybe mode 4 is broken (don't know if this is the one used here,
> > > > > neither why mode 5 is refused). Can you please try by limiting the mode
> > > > > to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> > > >
> > > > Sure, how to do that?
> > >
> > > This loop [1] tries to configure each mode (5, 4, ...) until one
> > > succeeds (default is 0: must always work). Please try to limit mode to
> > > 0, 1, etc.
> > >
> > > Mode 0 should work.
> > >
> >
> > This is not correct. When all the mode fail it fallback to 0 that does
> > not work. Already check
> > So the fallback is created for this situation
>
> Sorry but I don't understand what you are saying.
>
I said that where a timing mode is not ackolege then the mtd stack should
send a reset command and fallback to timeing mode 0. The nand does not
respond anymore.
> Are you telling me that you already tried mode 0 and that it did not
> work better than other timings?
>
I force only to use different mode but never try mode 0 ;) just
because should be
the normal fallback
Michael
> >
> > > [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
> > >
> > > >
> > > >
> > > > >> 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).
> > > > >
> > > > > That's strange... I don't get what would produce such unstable issue.
> > > >
> > > > My initial guess is that the calculated timing is very marginal.
> > >
> > > What do you mean by "marginal"?
> > >
> >
> > I don't think that is timing calculation. I have tried to use the same timing
> > as before but when those are applide. Is it possible?
>
> ^
> I suppose the end of the sentence is missing?
>
>
> Thanks,
> Miquèl
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 13:00 ` Michael Nazzareno Trimarchi
@ 2019-07-29 13:22 ` Miquel Raynal
2019-07-29 20:00 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Miquel Raynal @ 2019-07-29 13:22 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi
Cc: s.hauer, Greg Ungerer, linux-mtd, Boris Brezillon
Hi Michael,
Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
Mon, 29 Jul 2019 15:00:04 +0200:
> Hi Miquel
>
> On Mon, Jul 29, 2019 at 2:55 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Michael,
> >
> > Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> > Mon, 29 Jul 2019 14:49:19 +0200:
> >
> > > Hi Miguel
> > >
> > > On Mon, Jul 29, 2019 at 2:47 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > > >
> > > > Hi Greg,
> > > >
> > > > + Boris
> > > >
> > > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> > > >
> > > > > Hi Miquel,
> > > > >
> > > > > On 29/7/19 6:36 pm, Miquel Raynal wrote:
> > > > > > Hi Greg,
> > > > > >
> > > > > > One question below.
> > > > > >
> > > > > > +Michael
> > > > > > +Sascha
> > > > > >
> > > > > > Hello Michael, here is a similar issue to yours, I know you did not
> > > > > > have enough time to share your solution but here we have someone else
> > > > > > reproducing the issue, would you mind sharing a branch or a patch, even
> > > > > > a WIP one, just to help debugging?
> > > > > >
> > > > > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> > > > > >
> > > > > >> 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
> > > > > >
> > > > > > What is the final timing mode used? Most of us tested in mode 5 I
> > > > > > guess, maybe mode 4 is broken (don't know if this is the one used here,
> > > > > > neither why mode 5 is refused). Can you please try by limiting the mode
> > > > > > to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> > > > >
> > > > > Sure, how to do that?
> > > >
> > > > This loop [1] tries to configure each mode (5, 4, ...) until one
> > > > succeeds (default is 0: must always work). Please try to limit mode to
> > > > 0, 1, etc.
> > > >
> > > > Mode 0 should work.
> > > >
> > >
> > > This is not correct. When all the mode fail it fallback to 0 that does
> > > not work. Already check
> > > So the fallback is created for this situation
> >
> > Sorry but I don't understand what you are saying.
> >
>
> I said that where a timing mode is not ackolege then the mtd stack should
> send a reset command and fallback to timeing mode 0. The nand does not
> respond anymore.
It depends on what you define by "not acknowledged". What you describe
is the current situation: if either the NAND controller or the NAND
chip do not support the mode requested by the core, the core will try
another (slower) mode until either we found one or we are at timing
mode 0.
Unfortunately, we cannot check that "all operation with these timings
will work" at boot time, it would be very time consuming; especially
for something that is very likely to be a controller driver issue, and
that is what happens here: both the controller and the chip acknowledge
the new timings.
>
> > Are you telling me that you already tried mode 0 and that it did not
> > work better than other timings?
> >
>
> I force only to use different mode but never try mode 0 ;) just
> because should be
> the normal fallback
Unless there is a timing calculation issue in the controller driver.
Greg, can you please find the quickest working mode (starting from 0,
of course, to ensure mode 0 is stable).
[...]
> > > > > >
> > > > > > That's strange... I don't get what would produce such unstable issue.
> > > > >
> > > > > My initial guess is that the calculated timing is very marginal.
> > > >
> > > > What do you mean by "marginal"?
> > > >
> > >
> > > I don't think that is timing calculation. I have tried to use the same timing
> > > as before but when those are applide. Is it possible?
> >
> > ^
> > I suppose the end of the sentence is missing?
Michael, what did you mean here?
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 13:22 ` Miquel Raynal
@ 2019-07-29 20:00 ` Michael Nazzareno Trimarchi
2019-07-29 21:02 ` Miquel Raynal
0 siblings, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2019-07-29 20:00 UTC (permalink / raw)
To: Miquel Raynal; +Cc: s.hauer, Greg Ungerer, linux-mtd, Boris Brezillon
Hi Miquel
sorry was difficult day ;). My answer below
On Mon, Jul 29, 2019 at 3:22 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Michael,
>
> Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> Mon, 29 Jul 2019 15:00:04 +0200:
>
> > Hi Miquel
> >
> > On Mon, Jul 29, 2019 at 2:55 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > >
> > > Hi Michael,
> > >
> > > Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> > > Mon, 29 Jul 2019 14:49:19 +0200:
> > >
> > > > Hi Miguel
> > > >
> > > > On Mon, Jul 29, 2019 at 2:47 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > > > >
> > > > > Hi Greg,
> > > > >
> > > > > + Boris
> > > > >
> > > > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> > > > >
> > > > > > Hi Miquel,
> > > > > >
> > > > > > On 29/7/19 6:36 pm, Miquel Raynal wrote:
> > > > > > > Hi Greg,
> > > > > > >
> > > > > > > One question below.
> > > > > > >
> > > > > > > +Michael
> > > > > > > +Sascha
> > > > > > >
> > > > > > > Hello Michael, here is a similar issue to yours, I know you did not
> > > > > > > have enough time to share your solution but here we have someone else
> > > > > > > reproducing the issue, would you mind sharing a branch or a patch, even
> > > > > > > a WIP one, just to help debugging?
> > > > > > >
> > > > > > > Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> > > > > > >
> > > > > > >> 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
> > > > > > >
> > > > > > > What is the final timing mode used? Most of us tested in mode 5 I
> > > > > > > guess, maybe mode 4 is broken (don't know if this is the one used here,
> > > > > > > neither why mode 5 is refused). Can you please try by limiting the mode
> > > > > > > to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> > > > > >
> > > > > > Sure, how to do that?
> > > > >
> > > > > This loop [1] tries to configure each mode (5, 4, ...) until one
> > > > > succeeds (default is 0: must always work). Please try to limit mode to
> > > > > 0, 1, etc.
> > > > >
> > > > > Mode 0 should work.
> > > > >
> > > >
> > > > This is not correct. When all the mode fail it fallback to 0 that does
> > > > not work. Already check
> > > > So the fallback is created for this situation
> > >
> > > Sorry but I don't understand what you are saying.
> > >
> >
> > I said that where a timing mode is not ackolege then the mtd stack should
> > send a reset command and fallback to timeing mode 0. The nand does not
> > respond anymore.
>
> It depends on what you define by "not acknowledged". What you describe
> is the current situation: if either the NAND controller or the NAND
> chip do not support the mode requested by the core, the core will try
> another (slower) mode until either we found one or we are at timing
> mode 0.
>
> Unfortunately, we cannot check that "all operation with these timings
> will work" at boot time, it would be very time consuming; especially
> for something that is very likely to be a controller driver issue, and
> that is what happens here: both the controller and the chip acknowledge
> the new timings.
>
> >
> > > Are you telling me that you already tried mode 0 and that it did not
> > > work better than other timings?
> > >
> >
> > I force only to use different mode but never try mode 0 ;) just
> > because should be
> > the normal fallback
>
> Unless there is a timing calculation issue in the controller driver.
> Greg, can you please find the quickest working mode (starting from 0,
> of course, to ensure mode 0 is stable).
>
> [...]
>
> > > > > > >
> > > > > > > That's strange... I don't get what would produce such unstable issue.
> > > > > >
> > > > > > My initial guess is that the calculated timing is very marginal.
> > > > >
> > > > > What do you mean by "marginal"?
> > > > >
> > > >
> > > > I don't think that is timing calculation. I have tried to use the same timing
> > > > as before but when those are applide. Is it possible?
> > >
> > > ^
> > > I suppose the end of the sentence is missing?
>
> Michael, what did you mean here?
>
commit 02c786627b93b3c3286570f793294816286ff397
Author: Michael Trimarchi <michael@amarulasolutions.com>
Date: Fri Oct 5 09:46:29 2018 +0200
Revert "mtd: rawnand: gpmi: use core timings instead of an
empirical derivation"
This reverts commit b1206122069aadabe1a8c50789277a978aaa4df7.
Change-Id: Icd0ddcd5e3ac7d82932bbf412299cca424cbc571
Jira-Id: WAN-50
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Revert this one does not fix the problem. Right now I have two revert
this one and
commit 6ab543c1924f77957004994bd6806a9daa45f903 (tag: MMI_004_011_R02)
Author: Michael Trimarchi <michael@amarulasolutions.com>
Date: Fri Oct 5 09:46:44 2018 +0200
Revert "mtd: rawnand: gpmi: support ->setup_data_interface()"
This reverts commit 76e1a0086a0c3276b384f77905345e0fcc886fdd.
Change-Id: I60fb6f874364d1deeda3424d4508553a38ac9b1a
Jira-Id: WAN-50
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
I did not have time to finish to undestand why this was fixing my problem
Michael
>
> Thanks,
> Miquèl
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 20:00 ` Michael Nazzareno Trimarchi
@ 2019-07-29 21:02 ` Miquel Raynal
0 siblings, 0 replies; 50+ messages in thread
From: Miquel Raynal @ 2019-07-29 21:02 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi
Cc: s.hauer, Greg Ungerer, linux-mtd, Boris Brezillon
Hi Michael,
Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
Mon, 29 Jul 2019 22:00:25 +0200:
> Hi Miquel
>
> sorry was difficult day ;). My answer below
>
No pb ;)
[...]
> > > > > > > > That's strange... I don't get what would produce
such unstable issue.
> > > > > > >
> > > > > > > My initial guess is that the calculated timing is very marginal.
> > > > > >
> > > > > > What do you mean by "marginal"?
> > > > > >
> > > > >
> > > > > I don't think that is timing calculation. I have tried to use the same timing
> > > > > as before but when those are applide. Is it possible?
> > > >
> > > > ^
> > > > I suppose the end of the sentence is missing?
> >
> > Michael, what did you mean here?
> >
> commit 02c786627b93b3c3286570f793294816286ff397
> Author: Michael Trimarchi <michael@amarulasolutions.com>
> Date: Fri Oct 5 09:46:29 2018 +0200
>
> Revert "mtd: rawnand: gpmi: use core timings instead of an
> empirical derivation"
>
> This reverts commit b1206122069aadabe1a8c50789277a978aaa4df7.
>
> Change-Id: Icd0ddcd5e3ac7d82932bbf412299cca424cbc571
> Jira-Id: WAN-50
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
>
> Revert this one does not fix the problem. Right now I have two revert
> this one and
>
> commit 6ab543c1924f77957004994bd6806a9daa45f903 (tag: MMI_004_011_R02)
> Author: Michael Trimarchi <michael@amarulasolutions.com>
> Date: Fri Oct 5 09:46:44 2018 +0200
>
> Revert "mtd: rawnand: gpmi: support ->setup_data_interface()"
>
> This reverts commit 76e1a0086a0c3276b384f77905345e0fcc886fdd.
>
> Change-Id: I60fb6f874364d1deeda3424d4508553a38ac9b1a
> Jira-Id: WAN-50
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
>
> I did not have time to finish to undestand why this was fixing my problem
Ok so I am pretty convinced that this is still a timings issue then;
but not entirely due to the different timings calculation. Interesting.
I'm waiting for Greg's results now.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-29 12:47 ` Miquel Raynal
2019-07-29 12:49 ` Michael Nazzareno Trimarchi
@ 2019-07-30 0:28 ` Greg Ungerer
2019-07-30 0:41 ` Greg Ungerer
1 sibling, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-07-30 0:28 UTC (permalink / raw)
To: Miquel Raynal
Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd, Boris Brezillon
Hi Miquel,
On 29/7/19 10:47 pm, Miquel Raynal wrote:
> Hi Greg,
>
> + Boris
>
> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>
>> Hi Miquel,
>>
>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>> Hi Greg,
>>>
>>> One question below.
>>>
>>> +Michael
>>> +Sascha
>>>
>>> Hello Michael, here is a similar issue to yours, I know you did not
>>> have enough time to share your solution but here we have someone else
>>> reproducing the issue, would you mind sharing a branch or a patch, even
>>> a WIP one, just to help debugging?
>>>
>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>
>>>> 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
>>>
>>> What is the final timing mode used? Most of us tested in mode 5 I
>>> guess, maybe mode 4 is broken (don't know if this is the one used here,
>>> neither why mode 5 is refused). Can you please try by limiting the mode
>>> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
>>
>> Sure, how to do that?
>
> This loop [1] tries to configure each mode (5, 4, ...) until one
> succeeds (default is 0: must always work). Please try to limit mode to
> 0, 1, etc.
>
> Mode 0 should work.
>
> [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
The normal behavior - which usually works - has
chip->onfi_timing_mode_default=5 here. So in other words on the first pass
through this loop it is checking mode 5, and setting it as the default.
I am running a test/reboot loop now waiting for failure to see
if it is still using mode 5 in that case.
Regards
Greg
>>>> 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).
>>>
>>> That's strange... I don't get what would produce such unstable issue.
>>
>> My initial guess is that the calculated timing is very marginal.
>
> What do you mean by "marginal"?
>
>> The problem seems more likely to happen if flash write activity
>> had been occurring just before a soft reboot. Its not a guarantee,
>> just more likely.
>
> That's really disturbing. I doubt this is the real cause though.
>
>>
>> Interesting observation is that Michael was using Micron flash,
>> and boards that I have with the problem also have Micron flash.
>> Both a form of Micron MT29F2G08.
>>
>> I have similar boards, iMX6ull based, with different brands of
>> NAND flash and I have not seen any problem on them.
>
> That's great to narrow down the root cause. Maybe these chips have
> tighter timing constraints.
>
>>
>> Regards
>> Greg
>>
>>
>>
>>>> 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
>>>>
>>>
>>> Thanks,
>>> Miquèl
>>>
>
> Thanks,
> Miquèl
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-30 0:28 ` Greg Ungerer
@ 2019-07-30 0:41 ` Greg Ungerer
2019-07-30 6:06 ` Greg Ungerer
0 siblings, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-07-30 0:41 UTC (permalink / raw)
To: Miquel Raynal
Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd, Boris Brezillon
Hi Miquel,
On 30/7/19 10:28 am, Greg Ungerer wrote:
> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
[snip]
>>>>> nand: timing mode 5 not acknowledged by the NAND chip
>>>>
>>>> What is the final timing mode used? Most of us tested in mode 5 I
>>>> guess, maybe mode 4 is broken (don't know if this is the one used here,
>>>> neither why mode 5 is refused). Can you please try by limiting the mode
>>>> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
>>>
>>> Sure, how to do that?
>>
>> This loop [1] tries to configure each mode (5, 4, ...) until one
>> succeeds (default is 0: must always work). Please try to limit mode to
>> 0, 1, etc.
>>
>> Mode 0 should work.
>>
>> [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
>
> The normal behavior - which usually works - has
> chip->onfi_timing_mode_default=5 here. So in other words on the first pass
> through this loop it is checking mode 5, and setting it as the default.
>
> I am running a test/reboot loop now waiting for failure to see
> if it is still using mode 5 in that case.
With this trace in place:
--- a/linux/drivers/mtd/nand/raw/nand_base.c
+++ b/linux/drivers/mtd/nand/raw/nand_base.c
@@ -910,6 +910,7 @@ static int nand_init_data_interface(struct nand_chip *chip)
}
for (mode = fls(modes) - 1; mode >= 0; mode--) {
+ printk("%s(%d): checking mode=%d\n", __FILE__, __LINE__, mode);
ret = onfi_fill_data_interface(chip, NAND_SDR_IFACE, mode);
if (ret)
continue;
@@ -923,10 +924,12 @@ static int nand_init_data_interface(struct nand_chip *chip)
&chip->data_interface);
if (!ret) {
chip->onfi_timing_mode_default = mode;
+ printk("%s(%d): BREAKING AT mode=%d\n", __FILE__, __LINE__, mode);
break;
}
}
+ printk("%s(%d): chip->onfi_timing_mode_default=%d\n", __FILE__, __LINE__, chip->onfi_timing_mode_default);
return 0;
}
First NAND failure gives 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: use legacy bch geometry
drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
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 : 0x00000100
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
Regards
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-30 0:41 ` Greg Ungerer
@ 2019-07-30 6:06 ` Greg Ungerer
2019-07-30 8:38 ` Miquel Raynal
0 siblings, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-07-30 6:06 UTC (permalink / raw)
To: Miquel Raynal
Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd, Boris Brezillon
Hi Miquel,
On 30/7/19 10:41 am, Greg Ungerer wrote:
> On 30/7/19 10:28 am, Greg Ungerer wrote:
>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> [snip]
>>>>>> nand: timing mode 5 not acknowledged by the NAND chip
>>>>>
>>>>> What is the final timing mode used? Most of us tested in mode 5 I
>>>>> guess, maybe mode 4 is broken (don't know if this is the one used here,
>>>>> neither why mode 5 is refused). Can you please try by limiting the mode
>>>>> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
>>>>
>>>> Sure, how to do that?
>>>
>>> This loop [1] tries to configure each mode (5, 4, ...) until one
>>> succeeds (default is 0: must always work). Please try to limit mode to
>>> 0, 1, etc.
>>>
>>> Mode 0 should work.
>>>
>>> [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
>>
>> The normal behavior - which usually works - has
>> chip->onfi_timing_mode_default=5 here. So in other words on the first pass
>> through this loop it is checking mode 5, and setting it as the default.
>>
>> I am running a test/reboot loop now waiting for failure to see
>> if it is still using mode 5 in that case.
>
> With this trace in place:
>
> --- a/linux/drivers/mtd/nand/raw/nand_base.c
> +++ b/linux/drivers/mtd/nand/raw/nand_base.c
> @@ -910,6 +910,7 @@ static int nand_init_data_interface(struct nand_chip *chip)
> }
>
> for (mode = fls(modes) - 1; mode >= 0; mode--) {
> + printk("%s(%d): checking mode=%d\n", __FILE__, __LINE__, mode);
> ret = onfi_fill_data_interface(chip, NAND_SDR_IFACE, mode);
> if (ret)
> continue;
> @@ -923,10 +924,12 @@ static int nand_init_data_interface(struct nand_chip *chip)
> &chip->data_interface);
> if (!ret) {
> chip->onfi_timing_mode_default = mode;
> + printk("%s(%d): BREAKING AT mode=%d\n", __FILE__, __LINE__, mode);
> break;
> }
> }
>
> + printk("%s(%d): chip->onfi_timing_mode_default=%d\n", __FILE__, __LINE__, chip->onfi_timing_mode_default);
> return 0;
> }
>
>
> First NAND failure gives 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: use legacy bch geometry
> drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
> drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
> drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
> 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 : 0x00000100
> 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
Not sure if this is a useful data point... But I modified that
nand_init_data_interface() loop to start checking from data mode 4.
So now on every boot it defaults to mode 4. That has been running
most of the day, up to 900 boot cycles now, no failures.
Regards
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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
0 siblings, 2 replies; 50+ messages in thread
From: Miquel Raynal @ 2019-07-30 8:38 UTC (permalink / raw)
To: Greg Ungerer
Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd, Boris Brezillon
Hi Greg,
Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> Hi Miquel,
>
> On 30/7/19 10:41 am, Greg Ungerer wrote:
> > On 30/7/19 10:28 am, Greg Ungerer wrote:
> >> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> > [snip]
> >>>>>> nand: timing mode 5 not acknowledged by the NAND chip
> >>>>>
> >>>>> What is the final timing mode used? Most of us tested in mode 5 I
> >>>>> guess, maybe mode 4 is broken (don't know if this is the one used here,
> >>>>> neither why mode 5 is refused). Can you please try by limiting the mode
> >>>>> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> >>>>
> >>>> Sure, how to do that?
> >>>
> >>> This loop [1] tries to configure each mode (5, 4, ...) until one
> >>> succeeds (default is 0: must always work). Please try to limit mode to
> >>> 0, 1, etc.
> >>>
> >>> Mode 0 should work.
> >>>
> >>> [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
> >>
> >> The normal behavior - which usually works - has
> >> chip->onfi_timing_mode_default=5 here. So in other words on the first pass
> >> through this loop it is checking mode 5, and setting it as the default.
> >>
> >> I am running a test/reboot loop now waiting for failure to see
> >> if it is still using mode 5 in that case.
> >
> > With this trace in place:
> >
> > --- a/linux/drivers/mtd/nand/raw/nand_base.c
> > +++ b/linux/drivers/mtd/nand/raw/nand_base.c
> > @@ -910,6 +910,7 @@ static int nand_init_data_interface(struct nand_chip *chip)
> > }
> >
> > for (mode = fls(modes) - 1; mode >= 0; mode--) {
> > + printk("%s(%d): checking mode=%d\n", __FILE__, __LINE__, mode);
> > ret = onfi_fill_data_interface(chip, NAND_SDR_IFACE, mode);
> > if (ret)
> > continue;
> > @@ -923,10 +924,12 @@ static int nand_init_data_interface(struct nand_chip *chip)
> > &chip->data_interface);
> > if (!ret) {
> > chip->onfi_timing_mode_default = mode;
> > + printk("%s(%d): BREAKING AT mode=%d\n", __FILE__, __LINE__, mode);
> > break;
> > }
> > }
> >
> > + printk("%s(%d): chip->onfi_timing_mode_default=%d\n", __FILE__, __LINE__, chip->onfi_timing_mode_default);
> > return 0;
> > }
> >
> >
> > First NAND failure gives 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: use legacy bch geometry
> > drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
> > drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
> > drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
> > 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 : 0x00000100
> > 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
>
> Not sure if this is a useful data point... But I modified that
> nand_init_data_interface() loop to start checking from data mode 4.
> So now on every boot it defaults to mode 4. That has been running
> most of the day, up to 900 boot cycles now, no failures.
Ok so after having chatted quite a bit with Boris, it is very likely
that, for these chips, the timings in mode 5 are too tight. It could
fail the GET_FEATURES once in mode 5. Can you please dump every single
intermediate value in gpmi_nfc_compute_timings() (period, *_cycles,
use of half pêriods, tRP, sample delay, etc) as well as the content
of /sys/kernel/debug/clk/clk_summary (you'll need debugfs support
enabled and mounted).
Also, can you be sure that the NAND chip is powered with 3.3V?
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-30 8:38 ` Miquel Raynal
@ 2019-07-30 8:58 ` Boris Brezillon
2019-07-31 2:05 ` Greg Ungerer
1 sibling, 0 replies; 50+ messages in thread
From: Boris Brezillon @ 2019-07-30 8:58 UTC (permalink / raw)
To: Miquel Raynal
Cc: s.hauer, Greg Ungerer, linux-mtd, Michael Nazzareno Trimarchi,
Boris Brezillon
On Tue, 30 Jul 2019 10:38:22 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> Hi Greg,
>
> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>
> > Hi Miquel,
> >
> > On 30/7/19 10:41 am, Greg Ungerer wrote:
> > > On 30/7/19 10:28 am, Greg Ungerer wrote:
> > >> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> > >>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> > >>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> > >>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> > > [snip]
> > >>>>>> nand: timing mode 5 not acknowledged by the NAND chip
> > >>>>>
> > >>>>> What is the final timing mode used? Most of us tested in mode 5 I
> > >>>>> guess, maybe mode 4 is broken (don't know if this is the one used here,
> > >>>>> neither why mode 5 is refused). Can you please try by limiting the mode
> > >>>>> to 0, 1, 2... until, hopefully, we narrow down to the failing mode.
> > >>>>
> > >>>> Sure, how to do that?
> > >>>
> > >>> This loop [1] tries to configure each mode (5, 4, ...) until one
> > >>> succeeds (default is 0: must always work). Please try to limit mode to
> > >>> 0, 1, etc.
> > >>>
> > >>> Mode 0 should work.
> > >>>
> > >>> [1] https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/nand_base.c#L933
> > >>
> > >> The normal behavior - which usually works - has
> > >> chip->onfi_timing_mode_default=5 here. So in other words on the first pass
> > >> through this loop it is checking mode 5, and setting it as the default.
> > >>
> > >> I am running a test/reboot loop now waiting for failure to see
> > >> if it is still using mode 5 in that case.
> > >
> > > With this trace in place:
> > >
> > > --- a/linux/drivers/mtd/nand/raw/nand_base.c
> > > +++ b/linux/drivers/mtd/nand/raw/nand_base.c
> > > @@ -910,6 +910,7 @@ static int nand_init_data_interface(struct nand_chip *chip)
> > > }
> > >
> > > for (mode = fls(modes) - 1; mode >= 0; mode--) {
> > > + printk("%s(%d): checking mode=%d\n", __FILE__, __LINE__, mode);
> > > ret = onfi_fill_data_interface(chip, NAND_SDR_IFACE, mode);
> > > if (ret)
> > > continue;
> > > @@ -923,10 +924,12 @@ static int nand_init_data_interface(struct nand_chip *chip)
> > > &chip->data_interface);
> > > if (!ret) {
> > > chip->onfi_timing_mode_default = mode;
> > > + printk("%s(%d): BREAKING AT mode=%d\n", __FILE__, __LINE__, mode);
> > > break;
> > > }
> > > }
> > >
> > > + printk("%s(%d): chip->onfi_timing_mode_default=%d\n", __FILE__, __LINE__, chip->onfi_timing_mode_default);
> > > return 0;
> > > }
> > >
> > >
> > > First NAND failure gives 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: use legacy bch geometry
> > > drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
> > > drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
> > > drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
> > > 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 : 0x00000100
> > > 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
> >
> > Not sure if this is a useful data point... But I modified that
> > nand_init_data_interface() loop to start checking from data mode 4.
> > So now on every boot it defaults to mode 4. That has been running
> > most of the day, up to 900 boot cycles now, no failures.
>
> Ok so after having chatted quite a bit with Boris, it is very likely
> that, for these chips, the timings in mode 5 are too tight. It could
> fail the GET_FEATURES once in mode 5. Can you please dump every single
> intermediate value in gpmi_nfc_compute_timings() (period, *_cycles,
> use of half pêriods, tRP, sample delay, etc) as well as the content
> of /sys/kernel/debug/clk/clk_summary (you'll need debugfs support
> enabled and mounted).
Not sure the clk will stay at the rate it was set during the timing
selection. Can you also add a trace printing the result of
clk_get_rate(r->clock[0], hw->clk_rate) here [1]?
[1]https://elixir.bootlin.com/linux/v5.3-rc1/source/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c#L711
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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
1 sibling, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-07-31 2:05 UTC (permalink / raw)
To: Miquel Raynal, Boris Brezillon
Cc: s.hauer, Michael Nazzareno Trimarchi, linux-mtd
[-- Attachment #1: Type: text/plain, Size: 29834 bytes --]
Hi Miquel, Boris,
On 30/7/19 6:38 pm, Miquel Raynal wrote:
> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>> [snip]
>> Not sure if this is a useful data point... But I modified that
>> nand_init_data_interface() loop to start checking from data mode 4.
>> So now on every boot it defaults to mode 4. That has been running
>> most of the day, up to 900 boot cycles now, no failures.
>
> Ok so after having chatted quite a bit with Boris, it is very likely
> that, for these chips, the timings in mode 5 are too tight. It could
> fail the GET_FEATURES once in mode 5. Can you please dump every single
> intermediate value in gpmi_nfc_compute_timings() (period, *_cycles,
> use of half pêriods, tRP, sample delay, etc) as well as the content
> of /sys/kernel/debug/clk/clk_summary (you'll need debugfs support
> enabled and mounted).
>
> Also, can you be sure that the NAND chip is powered with 3.3V?
Yes, 3.3V NAND chip.
Using the attached patch I get the following trace:
...
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
sdr->tBERS_max=65535000000
sdr->tCCS_min=500000000
sdr->tPROG_max=65535000000
sdr->tR_max=200000000000000
sdr->tALH_min=20000
sdr->tADL_min=400000
sdr->tALS_min=50000
sdr->tAR_min=25000
sdr->tCEA_max=100000
sdr->tCEH_min=20000
sdr->tCH_min=20000
sdr->tCHZ_max=100000
sdr->tCLH_min=20000
sdr->tCLR_min=20000
sdr->tCLS_min=50000
sdr->tCOH_min=0
sdr->tCS_min=70000
sdr->tDH_min=20000
sdr->tDS_min=40000
sdr->tFEAT_max=1000000
sdr->tIR_min=10000
sdr->tITC_max=1000000
sdr->tRC_min=100000
sdr->tREA_max=40000
sdr->tREH_min=30000
sdr->tRHOH_min=0
sdr->tRHW_min=200000
sdr->tRHZ_max=200000
sdr->tRLOH_min=0
sdr->tRP_min=50000
sdr->tRR_min=40000
sdr->tRST_max=250000000000
sdr->tWB_max=200000
sdr->tWC_min=100000
sdr->tWH_min=30000
sdr->tWHR_min=120000
sdr->tWP_min=50000
sdr->tWW_min=100000
hw->clk_rate=22000000
wrn_dly_sel=0
period_ps=45454
addr_setup_cycles=2
data_setup_cycles=1
data_hold_cycles=1
busy_timeout_cycles=31302
hw->timing0=0x00020101
hw->timing1=0x60000000
dll_threshold_ps=12000
use_half_period=1
reference_period_ps=22727
tRP_ps=45454
sample_delay_ps=4294955664
sample_delay_factor=0
hw->ctrl1n=0x00000000
hw->ctrl1n=0x00000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
hw>clk_rate=22000000
clk_set_rate(r->clock[0], hw->clk_rate)=0
clk_get_rate(r->clock[0])=22000000
random: fast init done
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
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
sdr->tBERS_max=3000000000
sdr->tCCS_min=100000
sdr->tPROG_max=600000000
sdr->tR_max=25000000
sdr->tALH_min=20000
sdr->tADL_min=400000
sdr->tALS_min=50000
sdr->tAR_min=25000
sdr->tCEA_max=100000
sdr->tCEH_min=20000
sdr->tCH_min=20000
sdr->tCHZ_max=100000
sdr->tCLH_min=20000
sdr->tCLR_min=20000
sdr->tCLS_min=50000
sdr->tCOH_min=0
sdr->tCS_min=70000
sdr->tDH_min=20000
sdr->tDS_min=40000
sdr->tFEAT_max=1000000
sdr->tIR_min=10000
sdr->tITC_max=1000000
sdr->tRC_min=100000
sdr->tREA_max=40000
sdr->tREH_min=30000
sdr->tRHOH_min=0
sdr->tRHW_min=200000
sdr->tRHZ_max=200000
sdr->tRLOH_min=0
sdr->tRP_min=50000
sdr->tRR_min=40000
sdr->tRST_max=250000000000
sdr->tWB_max=200000
sdr->tWC_min=100000
sdr->tWH_min=30000
sdr->tWHR_min=120000
sdr->tWP_min=50000
sdr->tWW_min=100000
hw->clk_rate=22000000
wrn_dly_sel=0
period_ps=45454
addr_setup_cycles=2
data_setup_cycles=1
data_hold_cycles=1
busy_timeout_cycles=555
hw->timing0=0x00020101
hw->timing1=0xb0000000
dll_threshold_ps=12000
use_half_period=1
reference_period_ps=22727
tRP_ps=45454
sample_delay_ps=4294955664
sample_delay_factor=0
hw->ctrl1n=0x00000000
hw->ctrl1n=0x00000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
hw>clk_rate=22000000
clk_set_rate(r->clock[0], hw->clk_rate)=0
clk_get_rate(r->clock[0])=22000000
gpmi-nand 1806000.gpmi-nand: use legacy bch geometry
drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
sdr->tBERS_max=3000000000
sdr->tCCS_min=100000
sdr->tPROG_max=600000000
sdr->tR_max=25000000
sdr->tALH_min=5000
sdr->tADL_min=400000
sdr->tALS_min=10000
sdr->tAR_min=10000
sdr->tCEA_max=25000
sdr->tCEH_min=20000
sdr->tCH_min=5000
sdr->tCHZ_max=30000
sdr->tCLH_min=5000
sdr->tCLR_min=10000
sdr->tCLS_min=10000
sdr->tCOH_min=15000
sdr->tCS_min=15000
sdr->tDH_min=5000
sdr->tDS_min=7000
sdr->tFEAT_max=1000000
sdr->tIR_min=0
sdr->tITC_max=1000000
sdr->tRC_min=20000
sdr->tREA_max=16000
sdr->tREH_min=7000
sdr->tRHOH_min=15000
sdr->tRHW_min=100000
sdr->tRHZ_max=100000
sdr->tRLOH_min=5000
sdr->tRP_min=10000
sdr->tRR_min=20000
sdr->tRST_max=500000000
sdr->tWB_max=100000
sdr->tWC_min=20000
sdr->tWH_min=7000
sdr->tWHR_min=80000
sdr->tWP_min=10000
sdr->tWW_min=100000
hw->clk_rate=100000000
wrn_dly_sel=3
period_ps=10000
addr_setup_cycles=1
data_setup_cycles=1
data_hold_cycles=1
busy_timeout_cycles=2510
hw->timing0=0x00010101
hw->timing1=0xe0000000
dll_threshold_ps=12000
use_half_period=0
reference_period_ps=10000
tRP_ps=10000
sample_delay_ps=80000
sample_delay_factor=8
hw->ctrl1n=0x00c00000
hw->ctrl1n=0x00c28000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
hw>clk_rate=100000000
clk_set_rate(r->clock[0], hw->clk_rate)=0
clk_get_rate(r->clock[0])=99000000
Scanning device for bad blocks
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.
...
And "cat /sys/kernel/debug/clk/clk_summary" gives:
enable prepare protect duty
clock count count count rate accuracy phase cycle
---------------------------------------------------------------------------------------------
dummy 2 2 0 0 0 0 50000
cko2_sel 0 0 0 0 0 0 50000
cko2_podf 0 0 0 0 0 0 50000
cko2 0 0 0 0 0 0 50000
cko1_sel 0 0 0 0 0 0 50000
cko1_podf 0 0 0 0 0 0 50000
cko1 0 0 0 0 0 0 50000
cko 0 0 0 0 0 0 50000
usbphy2_gate 1 1 0 0 0 0 50000
usbphy1_gate 1 1 0 0 0 0 50000
ipp_di1 0 0 0 0 0 0 50000
ipp_di0 0 0 0 0 0 0 50000
osc 6 6 0 24000000 0 0 50000
perclk_sel 1 1 0 24000000 0 0 50000
perclk 3 3 0 24000000 0 0 50000
pwm7 0 0 0 24000000 0 0 50000
pwm6 0 0 0 24000000 0 0 50000
pwm5 0 0 0 24000000 0 0 50000
i2c4 0 0 0 24000000 0 0 50000
pwm8 0 0 0 24000000 0 0 50000
pwm4 0 0 0 24000000 0 0 50000
pwm3 0 0 0 24000000 0 0 50000
pwm2 0 0 0 24000000 0 0 50000
pwm1 0 0 0 24000000 0 0 50000
i2c3 0 0 0 24000000 0 0 50000
i2c2 1 1 0 24000000 0 0 50000
i2c1 0 0 0 24000000 0 0 50000
gpt1_serial 1 1 0 24000000 0 0 50000
gpt1_bus 1 1 0 24000000 0 0 50000
epit2 0 0 0 24000000 0 0 50000
epit1 0 0 0 24000000 0 0 50000
gpt2_serial 0 0 0 24000000 0 0 50000
gpt2_bus 0 0 0 24000000 0 0 50000
periph_clk2_sel 0 0 0 24000000 0 0 50000
periph_clk2 0 0 0 24000000 0 0 50000
gpt_3m 0 0 0 3000000 0 0 50000
csi_sel 0 0 0 24000000 0 0 50000
csi_podf 0 0 0 24000000 0 0 50000
csi 0 0 0 24000000 0 0 50000
pll7 1 1 0 480000000 0 0 50000
pll7_bypass 1 1 0 480000000 0 0 50000
pll7_usb_host 1 1 0 480000000 0 0 50000
usbphy2 1 1 0 480000000 0 0 50000
pll6 1 1 0 500000000 0 0 50000
pll6_bypass 1 1 0 500000000 0 0 50000
pll6_enet 2 2 0 500000000 0 0 50000
enet_ptp_ref 1 1 0 25000000 0 0 50000
enet_ptp 1 1 0 25000000 0 0 50000
enet2_ref 0 0 0 50000000 0 0 50000
enet_ref_125m 0 0 0 50000000 0 0 50000
enet_ref 2 2 0 50000000 0 0 50000
pll5 0 0 0 296600000 0 0 50000
pll5_bypass 0 0 0 296600000 0 0 50000
pll5_video 0 0 0 296600000 0 0 50000
pll5_post_div 0 0 0 74150000 0 0 50000
pll5_video_div 0 0 0 74150000 0 0 50000
pll4 0 0 0 147456000 0 0 50000
pll4_bypass 0 0 0 147456000 0 0 50000
pll4_audio 0 0 0 147456000 0 0 50000
pll4_post_div 0 0 0 36864000 0 0 50000
pll4_audio_div 0 0 0 36864000 0 0 50000
pll3 1 1 0 480000000 0 0 50000
pll3_bypass 1 1 0 480000000 0 0 50000
pll3_usb_otg 2 2 0 480000000 0 0 50000
spdif_sel 0 0 0 480000000 0 0 50000
spdif_pred 0 0 0 240000000 0 0 50000
spdif_podf 0 0 0 30000000 0 0 50000
spdif 0 0 0 30000000 0 0 50000
esai_sel 0 0 0 480000000 0 0 50000
esai_pred 0 0 0 240000000 0 0 50000
esai_podf 0 0 0 30000000 0 0 50000
esai_extal 0 0 0 30000000 0 0 50000
qspi1_sel 0 0 0 480000000 0 0 50000
qspi1_podf 0 0 0 240000000 0 0 50000
qspi1 0 0 0 240000000 0 0 50000
ldb_di1_div_7 0 0 0 68571428 0 0 50000
ldb_di1 0 0 0 68571428 0 0 50000
ldb_di1_div_3_5 0 0 0 137142857 0 0 50000
periph2_clk2_sel 0 0 0 480000000 0 0 50000
periph2_clk2 0 0 0 480000000 0 0 50000
pll3_60m 0 0 0 60000000 0 0 50000
can_sel 0 0 0 60000000 0 0 50000
can_podf 0 0 0 30000000 0 0 50000
can2_serial 0 0 0 30000000 0 0 50000
can1_serial 0 0 0 30000000 0 0 50000
ecspi_sel 0 0 0 60000000 0 0 50000
ecspi_podf 0 0 0 60000000 0 0 50000
ecspi4 0 0 0 60000000 0 0 50000
ecspi3 0 0 0 60000000 0 0 50000
ecspi2 0 0 0 60000000 0 0 50000
ecspi1 0 0 0 60000000 0 0 50000
pll3_80m 1 1 0 80000000 0 0 50000
uart_sel 1 1 0 80000000 0 0 50000
uart_podf 1 1 0 80000000 0 0 50000
uart8_serial 0 0 0 80000000 0 0 50000
uart7_serial 0 0 0 80000000 0 0 50000
uart1_serial 1 2 0 80000000 0 0 50000
uart6_serial 0 0 0 80000000 0 0 50000
uart5_serial 0 0 0 80000000 0 0 50000
uart4_serial 0 0 0 80000000 0 0 50000
uart3_serial 0 0 0 80000000 0 0 50000
uart2_serial 0 0 0 80000000 0 0 50000
pll3_pfd3_454m 0 0 0 454736842 0 0 50000
pll3_pfd2_508m 0 0 0 508235294 0 0 50000
epdc_pre_sel 0 0 0 508235294 0 0 50000
epdc_podf 0 0 0 254117647 0 0 50000
epdc_pix 0 0 0 254117647 0 0 50000
epdc_sel 0 0 0 254117647 0 0 50000
sai1_sel 0 0 0 508235294 0 0 50000
sai1_pred 0 0 0 127058824 0 0 50000
sai1_podf 0 0 0 63529412 0 0 50000
sai1 0 0 0 63529412 0 0 50000
sai2_sel 0 0 0 508235294 0 0 50000
sai2_pred 0 0 0 127058824 0 0 50000
sai2_podf 0 0 0 63529412 0 0 50000
sai2 0 0 0 63529412 0 0 50000
sai3_sel 0 0 0 508235294 0 0 50000
sai3_pred 0 0 0 127058824 0 0 50000
sai3_podf 0 0 0 63529412 0 0 50000
sai3 0 0 0 63529412 0 0 50000
pll3_pfd1_540m 0 0 0 540000000 0 0 50000
lcdif_pre_sel 0 0 0 540000000 0 0 50000
lcdif_pred 0 0 0 270000000 0 0 50000
lcdif_podf 0 0 0 135000000 0 0 50000
lcdif_pix 0 0 0 135000000 0 0 50000
iomuxc 0 0 0 135000000 0 0 50000
lcdif_sel 0 0 0 135000000 0 0 50000
pll3_pfd0_720m 0 0 0 720000000 0 0 50000
usbphy1 1 1 0 480000000 0 0 50000
pll2 1 1 0 528000000 0 0 50000
pll2_bypass 1 1 0 528000000 0 0 50000
pll2_bus 2 2 0 528000000 0 0 50000
ca7_secondary_sel 0 0 0 528000000 0 0 50000
step 0 0 0 528000000 0 0 50000
periph_pre 1 1 0 528000000 0 0 50000
periph 3 3 0 528000000 0 0 50000
ahb 7 7 0 132000000 0 0 50000
sdma 0 0 0 132000000 0 0 50000
rom 1 1 0 132000000 0 0 50000
esai_mem 0 0 0 132000000 0 0 50000
esai_ipg 0 0 0 132000000 0 0 50000
aips_tz3 1 1 0 132000000 0 0 50000
enet_ahb 2 2 0 132000000 0 0 50000
dcp 0 0 0 132000000 0 0 50000
asrc_mem 0 0 0 132000000 0 0 50000
asrc_ipg 0 0 0 132000000 0 0 50000
aips_tz2 1 1 0 132000000 0 0 50000
aips_tz1 1 1 0 132000000 0 0 50000
ipg 10 10 0 66000000 0 0 50000
wdog3 0 0 0 66000000 0 0 50000
uart8_ipg 0 0 0 66000000 0 0 50000
usboh3 2 2 0 66000000 0 0 50000
sai2_ipg 0 0 0 66000000 0 0 50000
sai1_ipg 0 0 0 66000000 0 0 50000
uart7_ipg 0 0 0 66000000 0 0 50000
uart1_ipg 1 2 0 66000000 0 0 50000
sai3_ipg 0 0 0 66000000 0 0 50000
spdif_gclk 0 0 0 66000000 0 0 50000
spba 0 0 0 66000000 0 0 50000
wdog2 0 0 0 66000000 0 0 50000
kpp 0 0 0 66000000 0 0 50000
mmdc_p1_ipg 0 0 0 66000000 0 0 50000
mmdc_p0_ipg 2 2 0 66000000 0 0 50000
wdog1 1 1 0 66000000 0 0 50000
gpio4 1 1 0 66000000 0 0 50000
uart6_ipg 0 0 0 66000000 0 0 50000
uart5_ipg 0 0 0 66000000 0 0 50000
gpio3 1 1 0 66000000 0 0 50000
ocotp 0 0 0 66000000 0 0 50000
gpio5 1 1 0 66000000 0 0 50000
gpio1 1 1 0 66000000 0 0 50000
uart4_ipg 0 0 0 66000000 0 0 50000
adc1 0 0 0 66000000 0 0 50000
uart3_ipg 0 0 0 66000000 0 0 50000
adc2 0 0 0 66000000 0 0 50000
gpio2 1 1 0 66000000 0 0 50000
uart2_ipg 0 0 0 66000000 0 0 50000
can2_ipg 0 0 0 66000000 0 0 50000
can1_ipg 0 0 0 66000000 0 0 50000
enet 2 2 0 66000000 0 0 50000
axi_sel 1 1 0 528000000 0 0 50000
axi_podf 2 2 0 264000000 0 0 50000
axi 1 1 0 264000000 0 0 50000
eim_slow_sel 0 0 0 264000000 0 0 50000
eim_slow_podf 0 0 0 132000000 0 0 50000
eim 0 0 0 132000000 0 0 50000
lcdif_apb 0 0 0 264000000 0 0 50000
pxp 0 0 0 264000000 0 0 50000
epdc_aclk 0 0 0 264000000 0 0 50000
pll2_pfd3_594m 0 0 0 594000000 0 0 50000
ldb_di0_sel 0 0 0 594000000 0 0 50000
ldb_di0_div_7 0 0 0 84857142 0 0 50000
ldb_di0 0 0 0 84857142 0 0 50000
ldb_di0_div_3_5 0 0 0 169714285 0 0 50000
pll2_pfd2_396m 2 2 0 396000000 0 0 50000
enfc_sel 0 0 0 396000000 0 0 50000
enfc_pred 0 0 0 99000000 0 0 50000
enfc_podf 0 0 0 99000000 0 0 50000
gpmi_io 0 0 0 99000000 0 0 50000
usdhc1_sel 0 0 0 396000000 0 0 50000
usdhc1_podf 0 0 0 198000000 0 0 50000
usdhc1 0 0 0 198000000 0 0 50000
usdhc2_sel 0 0 0 396000000 0 0 50000
usdhc2_podf 0 0 0 198000000 0 0 50000
usdhc2 0 0 0 198000000 0 0 50000
bch_sel 1 1 0 396000000 0 0 50000
bch_podf 1 1 0 99000000 0 0 50000
gpmi_apb 0 0 0 99000000 0 0 50000
gpmi_bch_apb 0 0 0 99000000 0 0 50000
per_bch 0 0 0 99000000 0 0 50000
apbh_dma 1 1 0 99000000 0 0 50000
gpmi_sel 0 0 0 396000000 0 0 50000
gpmi_podf 0 0 0 99000000 0 0 50000
gpmi_bch 0 0 0 99000000 0 0 50000
periph2_pre 1 1 0 396000000 0 0 50000
periph2 2 2 0 396000000 0 0 50000
mmdc_podf 2 2 0 396000000 0 0 50000
mmdc_p0_fast 1 1 0 396000000 0 0 50000
axi_alt_sel 0 0 0 396000000 0 0 50000
pll2_198m 0 0 0 198000000 0 0 50000
pll2_pfd1_594m 0 0 0 594000000 0 0 50000
pll2_pfd0_352m 0 0 0 352000000 0 0 50000
pll1 1 1 0 900000000 0 0 50000
pll1_bypass 1 1 0 900000000 0 0 50000
pll1_sys 1 1 0 900000000 0 0 50000
pll1_sw 1 1 0 900000000 0 0 50000
arm 1 1 0 900000000 0 0 50000
pll7_bypass_src 0 0 0 24000000 0 0 50000
pll6_bypass_src 0 0 0 24000000 0 0 50000
pll5_bypass_src 0 0 0 24000000 0 0 50000
pll4_bypass_src 0 0 0 24000000 0 0 50000
pll3_bypass_src 0 0 0 24000000 0 0 50000
pll2_bypass_src 0 0 0 24000000 0 0 50000
pll1_bypass_src 0 0 0 24000000 0 0 50000
ckil 0 0 0 32768 0 0 50000
Note that this was generated on a normal boot up (not failure).
Running boot testing now waiting for a failure.
Regards
Greg
[-- Attachment #2: imx6-nand-trace.patch --]
[-- Type: text/x-patch, Size: 6320 bytes --]
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
index 95ab933a10..7d6492452b 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
@@ -423,6 +423,46 @@
u16 busy_timeout_cycles;
u8 wrn_dly_sel;
+ printk("%s(%d): gpmi_nfc_compute_timings()\n", __FILE__, __LINE__);
+ printk(" sdr->tBERS_max=%llu\n", sdr->tBERS_max);
+ printk(" sdr->tCCS_min=%u\n", sdr->tCCS_min);
+ printk(" sdr->tPROG_max=%llu\n", sdr->tPROG_max);
+ printk(" sdr->tR_max=%llu\n", sdr->tR_max);
+ printk(" sdr->tALH_min=%u\n", sdr->tALH_min);
+ printk(" sdr->tADL_min=%u\n", sdr->tADL_min);
+ printk(" sdr->tALS_min=%u\n", sdr->tALS_min);
+ printk(" sdr->tAR_min=%u\n", sdr->tAR_min);
+ printk(" sdr->tCEA_max=%u\n", sdr->tCEA_max);
+ printk(" sdr->tCEH_min=%u\n", sdr->tCEH_min);
+ printk(" sdr->tCH_min=%u\n", sdr->tCH_min);
+ printk(" sdr->tCHZ_max=%u\n", sdr->tCHZ_max);
+ printk(" sdr->tCLH_min=%u\n", sdr->tCLH_min);
+ printk(" sdr->tCLR_min=%u\n", sdr->tCLR_min);
+ printk(" sdr->tCLS_min=%u\n", sdr->tCLS_min);
+ printk(" sdr->tCOH_min=%u\n", sdr->tCOH_min);
+ printk(" sdr->tCS_min=%u\n", sdr->tCS_min);
+ printk(" sdr->tDH_min=%u\n", sdr->tDH_min);
+ printk(" sdr->tDS_min=%u\n", sdr->tDS_min);
+ printk(" sdr->tFEAT_max=%u\n", sdr->tFEAT_max);
+ printk(" sdr->tIR_min=%u\n", sdr->tIR_min);
+ printk(" sdr->tITC_max=%u\n", sdr->tITC_max);
+ printk(" sdr->tRC_min=%u\n", sdr->tRC_min);
+ printk(" sdr->tREA_max=%u\n", sdr->tREA_max);
+ printk(" sdr->tREH_min=%u\n", sdr->tREH_min);
+ printk(" sdr->tRHOH_min=%u\n", sdr->tRHOH_min);
+ printk(" sdr->tRHW_min=%u\n", sdr->tRHW_min);
+ printk(" sdr->tRHZ_max=%u\n", sdr->tRHZ_max);
+ printk(" sdr->tRLOH_min=%u\n", sdr->tRLOH_min);
+ printk(" sdr->tRP_min=%u\n", sdr->tRP_min);
+ printk(" sdr->tRR_min=%u\n", sdr->tRR_min);
+ printk(" sdr->tRST_max=%llu\n", sdr->tRST_max);
+ printk(" sdr->tWB_max=%u\n", sdr->tWB_max);
+ printk(" sdr->tWC_min=%u\n", sdr->tWC_min);
+ printk(" sdr->tWH_min=%u\n", sdr->tWH_min);
+ printk(" sdr->tWHR_min=%u\n", sdr->tWHR_min);
+ printk(" sdr->tWP_min=%u\n", sdr->tWP_min);
+ printk(" sdr->tWW_min=%u\n", sdr->tWW_min);
+
if (sdr->tRC_min >= 30000) {
/* ONFI non-EDO modes [0-3] */
hw->clk_rate = 22000000;
@@ -436,19 +476,28 @@
hw->clk_rate = 100000000;
wrn_dly_sel = BV_GPMI_CTRL1_WRN_DLY_SEL_NO_DELAY;
}
+ printk(" hw->clk_rate=%lu\n", hw->clk_rate);
+ printk(" wrn_dly_sel=%u\n", wrn_dly_sel);
/* SDR core timings are given in picoseconds */
period_ps = div_u64((u64)NSEC_PER_SEC * 1000, hw->clk_rate);
+ printk(" period_ps=%u\n", period_ps);
addr_setup_cycles = TO_CYCLES(sdr->tALS_min, period_ps);
+ printk(" addr_setup_cycles=%u\n", addr_setup_cycles);
data_setup_cycles = TO_CYCLES(sdr->tDS_min, period_ps);
+ printk(" data_setup_cycles=%u\n", data_setup_cycles);
data_hold_cycles = TO_CYCLES(sdr->tDH_min, period_ps);
+ printk(" data_hold_cycles=%u\n", data_hold_cycles);
busy_timeout_cycles = TO_CYCLES(sdr->tWB_max + sdr->tR_max, period_ps);
+ printk(" busy_timeout_cycles=%u\n", busy_timeout_cycles);
hw->timing0 = BF_GPMI_TIMING0_ADDRESS_SETUP(addr_setup_cycles) |
BF_GPMI_TIMING0_DATA_HOLD(data_hold_cycles) |
BF_GPMI_TIMING0_DATA_SETUP(data_setup_cycles);
+ printk(" hw->timing0=0x%08x\n", hw->timing0);
hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(busy_timeout_cycles * 4096);
+ printk(" hw->timing1=0x%08x\n", hw->timing1);
/*
* Derive NFC ideal delay from {3}:
@@ -457,6 +506,7 @@
* RDN_DELAY = -----------------------
* RP
*/
+ printk(" dll_threshold_ps=%u\n", dll_threshold_ps);
if (period_ps > dll_threshold_ps) {
use_half_period = true;
reference_period_ps = period_ps / 2;
@@ -464,19 +514,26 @@
use_half_period = false;
reference_period_ps = period_ps;
}
+ printk(" use_half_period=%u\n", use_half_period);
+ printk(" reference_period_ps=%u\n", reference_period_ps);
tRP_ps = data_setup_cycles * period_ps;
+ printk(" tRP_ps=%u\n", tRP_ps);
sample_delay_ps = (sdr->tREA_max + 4000 - tRP_ps) * 8;
+ printk(" sample_delay_ps=%u\n", sample_delay_ps);
if (sample_delay_ps > 0)
sample_delay_factor = sample_delay_ps / reference_period_ps;
else
sample_delay_factor = 0;
+ printk(" sample_delay_factor=%u\n", sample_delay_factor);
hw->ctrl1n = BF_GPMI_CTRL1_WRN_DLY_SEL(wrn_dly_sel);
+ printk(" hw->ctrl1n=0x%08x\n", hw->ctrl1n);
if (sample_delay_factor)
hw->ctrl1n |= BF_GPMI_CTRL1_RDN_DELAY(sample_delay_factor) |
BM_GPMI_CTRL1_DLL_ENABLE |
(use_half_period ? BM_GPMI_CTRL1_HALF_PERIOD : 0);
+ printk(" hw->ctrl1n=0x%08x\n", hw->ctrl1n);
}
void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
@@ -485,8 +542,13 @@
struct resources *r = &this->resources;
void __iomem *gpmi_regs = r->gpmi_regs;
unsigned int dll_wait_time_us;
+ int ret;
- clk_set_rate(r->clock[0], hw->clk_rate);
+ printk("%s(%d): gpmi_nfc_apply_timings()\n", __FILE__, __LINE__);
+ printk(" hw>clk_rate=%lu\n", hw->clk_rate);
+ ret = clk_set_rate(r->clock[0], hw->clk_rate);
+ printk(" clk_set_rate(r->clock[0], hw->clk_rate)=%d\n", ret);
+ printk(" clk_get_rate(r->clock[0])=%lu\n", clk_get_rate(r->clock[0]));
writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
writel(hw->timing1, gpmi_regs + HW_GPMI_TIMING1);
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
index ddd396e93e..73f94842e8 100644
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -910,6 +910,7 @@ static int nand_init_data_interface(struct nand_chip *chip)
}
for (mode = fls(modes) - 1; mode >= 0; mode--) {
+ printk("%s(%d): checking mode=%d\n", __FILE__, __LINE__, mode);
ret = onfi_fill_data_interface(chip, NAND_SDR_IFACE, mode);
if (ret)
continue;
@@ -923,10 +924,12 @@ static int nand_init_data_interface(struct nand_chip *chip)
&chip->data_interface);
if (!ret) {
chip->onfi_timing_mode_default = mode;
+ printk("%s(%d): BREAKING AT mode=%d\n", __FILE__, __LINE__, mode);
break;
}
}
+ printk("%s(%d): chip->onfi_timing_mode_default=%d\n", __FILE__, __LINE__, chip->onfi_timing_mode_default);
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 144 bytes --]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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
0 siblings, 2 replies; 50+ messages in thread
From: Boris Brezillon @ 2019-07-31 6:28 UTC (permalink / raw)
To: Greg Ungerer
Cc: s.hauer, Boris Brezillon, linux-mtd, Michael Nazzareno Trimarchi,
Miquel Raynal
On Wed, 31 Jul 2019 12:05:44 +1000
Greg Ungerer <gerg@kernel.org> wrote:
> Hi Miquel, Boris,
>
> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> > Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>> [snip]
> >> Not sure if this is a useful data point... But I modified that
> >> nand_init_data_interface() loop to start checking from data mode 4.
> >> So now on every boot it defaults to mode 4. That has been running
> >> most of the day, up to 900 boot cycles now, no failures.
> >
> > Ok so after having chatted quite a bit with Boris, it is very likely
> > that, for these chips, the timings in mode 5 are too tight. It could
> > fail the GET_FEATURES once in mode 5. Can you please dump every single
> > intermediate value in gpmi_nfc_compute_timings() (period, *_cycles,
> > use of half pêriods, tRP, sample delay, etc) as well as the content
> > of /sys/kernel/debug/clk/clk_summary (you'll need debugfs support
> > enabled and mounted).
> >
> > Also, can you be sure that the NAND chip is powered with 3.3V?
>
> Yes, 3.3V NAND chip.
>
> Using the attached patch I get the following trace:
>
> ...
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
> sdr->tBERS_max=65535000000
> sdr->tCCS_min=500000000
> sdr->tPROG_max=65535000000
> sdr->tR_max=200000000000000
> sdr->tALH_min=20000
> sdr->tADL_min=400000
> sdr->tALS_min=50000
> sdr->tAR_min=25000
> sdr->tCEA_max=100000
> sdr->tCEH_min=20000
> sdr->tCH_min=20000
> sdr->tCHZ_max=100000
> sdr->tCLH_min=20000
> sdr->tCLR_min=20000
> sdr->tCLS_min=50000
> sdr->tCOH_min=0
> sdr->tCS_min=70000
> sdr->tDH_min=20000
> sdr->tDS_min=40000
> sdr->tFEAT_max=1000000
> sdr->tIR_min=10000
> sdr->tITC_max=1000000
> sdr->tRC_min=100000
> sdr->tREA_max=40000
> sdr->tREH_min=30000
> sdr->tRHOH_min=0
> sdr->tRHW_min=200000
> sdr->tRHZ_max=200000
> sdr->tRLOH_min=0
> sdr->tRP_min=50000
> sdr->tRR_min=40000
> sdr->tRST_max=250000000000
> sdr->tWB_max=200000
> sdr->tWC_min=100000
> sdr->tWH_min=30000
> sdr->tWHR_min=120000
> sdr->tWP_min=50000
> sdr->tWW_min=100000
> hw->clk_rate=22000000
> wrn_dly_sel=0
> period_ps=45454
> addr_setup_cycles=2
> data_setup_cycles=1
> data_hold_cycles=1
> busy_timeout_cycles=31302
> hw->timing0=0x00020101
> hw->timing1=0x60000000
> dll_threshold_ps=12000
> use_half_period=1
> reference_period_ps=22727
> tRP_ps=45454
> sample_delay_ps=4294955664
> sample_delay_factor=0
> hw->ctrl1n=0x00000000
> hw->ctrl1n=0x00000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
> hw>clk_rate=22000000
> clk_set_rate(r->clock[0], hw->clk_rate)=0
> clk_get_rate(r->clock[0])=22000000
> random: fast init done
> 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
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
> sdr->tBERS_max=3000000000
> sdr->tCCS_min=100000
> sdr->tPROG_max=600000000
> sdr->tR_max=25000000
> sdr->tALH_min=20000
> sdr->tADL_min=400000
> sdr->tALS_min=50000
> sdr->tAR_min=25000
> sdr->tCEA_max=100000
> sdr->tCEH_min=20000
> sdr->tCH_min=20000
> sdr->tCHZ_max=100000
> sdr->tCLH_min=20000
> sdr->tCLR_min=20000
> sdr->tCLS_min=50000
> sdr->tCOH_min=0
> sdr->tCS_min=70000
> sdr->tDH_min=20000
> sdr->tDS_min=40000
> sdr->tFEAT_max=1000000
> sdr->tIR_min=10000
> sdr->tITC_max=1000000
> sdr->tRC_min=100000
> sdr->tREA_max=40000
> sdr->tREH_min=30000
> sdr->tRHOH_min=0
> sdr->tRHW_min=200000
> sdr->tRHZ_max=200000
> sdr->tRLOH_min=0
> sdr->tRP_min=50000
> sdr->tRR_min=40000
> sdr->tRST_max=250000000000
> sdr->tWB_max=200000
> sdr->tWC_min=100000
> sdr->tWH_min=30000
> sdr->tWHR_min=120000
> sdr->tWP_min=50000
> sdr->tWW_min=100000
> hw->clk_rate=22000000
> wrn_dly_sel=0
> period_ps=45454
> addr_setup_cycles=2
> data_setup_cycles=1
> data_hold_cycles=1
> busy_timeout_cycles=555
> hw->timing0=0x00020101
> hw->timing1=0xb0000000
> dll_threshold_ps=12000
> use_half_period=1
> reference_period_ps=22727
> tRP_ps=45454
> sample_delay_ps=4294955664
> sample_delay_factor=0
> hw->ctrl1n=0x00000000
> hw->ctrl1n=0x00000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
> hw>clk_rate=22000000
> clk_set_rate(r->clock[0], hw->clk_rate)=0
> clk_get_rate(r->clock[0])=22000000
> gpmi-nand 1806000.gpmi-nand: use legacy bch geometry
> drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
> drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
> drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
> sdr->tBERS_max=3000000000
> sdr->tCCS_min=100000
> sdr->tPROG_max=600000000
> sdr->tR_max=25000000
> sdr->tALH_min=5000
> sdr->tADL_min=400000
> sdr->tALS_min=10000
> sdr->tAR_min=10000
> sdr->tCEA_max=25000
> sdr->tCEH_min=20000
> sdr->tCH_min=5000
> sdr->tCHZ_max=30000
> sdr->tCLH_min=5000
> sdr->tCLR_min=10000
> sdr->tCLS_min=10000
> sdr->tCOH_min=15000
> sdr->tCS_min=15000
> sdr->tDH_min=5000
> sdr->tDS_min=7000
> sdr->tFEAT_max=1000000
> sdr->tIR_min=0
> sdr->tITC_max=1000000
> sdr->tRC_min=20000
> sdr->tREA_max=16000
> sdr->tREH_min=7000
> sdr->tRHOH_min=15000
> sdr->tRHW_min=100000
> sdr->tRHZ_max=100000
> sdr->tRLOH_min=5000
> sdr->tRP_min=10000
> sdr->tRR_min=20000
> sdr->tRST_max=500000000
> sdr->tWB_max=100000
> sdr->tWC_min=20000
> sdr->tWH_min=7000
> sdr->tWHR_min=80000
> sdr->tWP_min=10000
> sdr->tWW_min=100000
> hw->clk_rate=100000000
> wrn_dly_sel=3
> period_ps=10000
> addr_setup_cycles=1
> data_setup_cycles=1
> data_hold_cycles=1
> busy_timeout_cycles=2510
> hw->timing0=0x00010101
> hw->timing1=0xe0000000
> dll_threshold_ps=12000
> use_half_period=0
> reference_period_ps=10000
> tRP_ps=10000
> sample_delay_ps=80000
> sample_delay_factor=8
> hw->ctrl1n=0x00c00000
> hw->ctrl1n=0x00c28000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
> hw>clk_rate=100000000
> clk_set_rate(r->clock[0], hw->clk_rate)=0
> clk_get_rate(r->clock[0])=99000000
> Scanning device for bad blocks
> 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.
> ...
>
>
> And "cat /sys/kernel/debug/clk/clk_summary" gives:
>
> enable prepare protect duty
> clock count count count rate accuracy phase cycle
> ---------------------------------------------------------------------------------------------
> dummy 2 2 0 0 0 0 50000
> cko2_sel 0 0 0 0 0 0 50000
> cko2_podf 0 0 0 0 0 0 50000
> cko2 0 0 0 0 0 0 50000
> cko1_sel 0 0 0 0 0 0 50000
> cko1_podf 0 0 0 0 0 0 50000
> cko1 0 0 0 0 0 0 50000
> cko 0 0 0 0 0 0 50000
> usbphy2_gate 1 1 0 0 0 0 50000
> usbphy1_gate 1 1 0 0 0 0 50000
> ipp_di1 0 0 0 0 0 0 50000
> ipp_di0 0 0 0 0 0 0 50000
> osc 6 6 0 24000000 0 0 50000
> perclk_sel 1 1 0 24000000 0 0 50000
> perclk 3 3 0 24000000 0 0 50000
> pwm7 0 0 0 24000000 0 0 50000
> pwm6 0 0 0 24000000 0 0 50000
> pwm5 0 0 0 24000000 0 0 50000
> i2c4 0 0 0 24000000 0 0 50000
> pwm8 0 0 0 24000000 0 0 50000
> pwm4 0 0 0 24000000 0 0 50000
> pwm3 0 0 0 24000000 0 0 50000
> pwm2 0 0 0 24000000 0 0 50000
> pwm1 0 0 0 24000000 0 0 50000
> i2c3 0 0 0 24000000 0 0 50000
> i2c2 1 1 0 24000000 0 0 50000
> i2c1 0 0 0 24000000 0 0 50000
> gpt1_serial 1 1 0 24000000 0 0 50000
> gpt1_bus 1 1 0 24000000 0 0 50000
> epit2 0 0 0 24000000 0 0 50000
> epit1 0 0 0 24000000 0 0 50000
> gpt2_serial 0 0 0 24000000 0 0 50000
> gpt2_bus 0 0 0 24000000 0 0 50000
> periph_clk2_sel 0 0 0 24000000 0 0 50000
> periph_clk2 0 0 0 24000000 0 0 50000
> gpt_3m 0 0 0 3000000 0 0 50000
> csi_sel 0 0 0 24000000 0 0 50000
> csi_podf 0 0 0 24000000 0 0 50000
> csi 0 0 0 24000000 0 0 50000
> pll7 1 1 0 480000000 0 0 50000
> pll7_bypass 1 1 0 480000000 0 0 50000
> pll7_usb_host 1 1 0 480000000 0 0 50000
> usbphy2 1 1 0 480000000 0 0 50000
> pll6 1 1 0 500000000 0 0 50000
> pll6_bypass 1 1 0 500000000 0 0 50000
> pll6_enet 2 2 0 500000000 0 0 50000
> enet_ptp_ref 1 1 0 25000000 0 0 50000
> enet_ptp 1 1 0 25000000 0 0 50000
> enet2_ref 0 0 0 50000000 0 0 50000
> enet_ref_125m 0 0 0 50000000 0 0 50000
> enet_ref 2 2 0 50000000 0 0 50000
> pll5 0 0 0 296600000 0 0 50000
> pll5_bypass 0 0 0 296600000 0 0 50000
> pll5_video 0 0 0 296600000 0 0 50000
> pll5_post_div 0 0 0 74150000 0 0 50000
> pll5_video_div 0 0 0 74150000 0 0 50000
> pll4 0 0 0 147456000 0 0 50000
> pll4_bypass 0 0 0 147456000 0 0 50000
> pll4_audio 0 0 0 147456000 0 0 50000
> pll4_post_div 0 0 0 36864000 0 0 50000
> pll4_audio_div 0 0 0 36864000 0 0 50000
> pll3 1 1 0 480000000 0 0 50000
> pll3_bypass 1 1 0 480000000 0 0 50000
> pll3_usb_otg 2 2 0 480000000 0 0 50000
> spdif_sel 0 0 0 480000000 0 0 50000
> spdif_pred 0 0 0 240000000 0 0 50000
> spdif_podf 0 0 0 30000000 0 0 50000
> spdif 0 0 0 30000000 0 0 50000
> esai_sel 0 0 0 480000000 0 0 50000
> esai_pred 0 0 0 240000000 0 0 50000
> esai_podf 0 0 0 30000000 0 0 50000
> esai_extal 0 0 0 30000000 0 0 50000
> qspi1_sel 0 0 0 480000000 0 0 50000
> qspi1_podf 0 0 0 240000000 0 0 50000
> qspi1 0 0 0 240000000 0 0 50000
> ldb_di1_div_7 0 0 0 68571428 0 0 50000
> ldb_di1 0 0 0 68571428 0 0 50000
> ldb_di1_div_3_5 0 0 0 137142857 0 0 50000
> periph2_clk2_sel 0 0 0 480000000 0 0 50000
> periph2_clk2 0 0 0 480000000 0 0 50000
> pll3_60m 0 0 0 60000000 0 0 50000
> can_sel 0 0 0 60000000 0 0 50000
> can_podf 0 0 0 30000000 0 0 50000
> can2_serial 0 0 0 30000000 0 0 50000
> can1_serial 0 0 0 30000000 0 0 50000
> ecspi_sel 0 0 0 60000000 0 0 50000
> ecspi_podf 0 0 0 60000000 0 0 50000
> ecspi4 0 0 0 60000000 0 0 50000
> ecspi3 0 0 0 60000000 0 0 50000
> ecspi2 0 0 0 60000000 0 0 50000
> ecspi1 0 0 0 60000000 0 0 50000
> pll3_80m 1 1 0 80000000 0 0 50000
> uart_sel 1 1 0 80000000 0 0 50000
> uart_podf 1 1 0 80000000 0 0 50000
> uart8_serial 0 0 0 80000000 0 0 50000
> uart7_serial 0 0 0 80000000 0 0 50000
> uart1_serial 1 2 0 80000000 0 0 50000
> uart6_serial 0 0 0 80000000 0 0 50000
> uart5_serial 0 0 0 80000000 0 0 50000
> uart4_serial 0 0 0 80000000 0 0 50000
> uart3_serial 0 0 0 80000000 0 0 50000
> uart2_serial 0 0 0 80000000 0 0 50000
> pll3_pfd3_454m 0 0 0 454736842 0 0 50000
> pll3_pfd2_508m 0 0 0 508235294 0 0 50000
> epdc_pre_sel 0 0 0 508235294 0 0 50000
> epdc_podf 0 0 0 254117647 0 0 50000
> epdc_pix 0 0 0 254117647 0 0 50000
> epdc_sel 0 0 0 254117647 0 0 50000
> sai1_sel 0 0 0 508235294 0 0 50000
> sai1_pred 0 0 0 127058824 0 0 50000
> sai1_podf 0 0 0 63529412 0 0 50000
> sai1 0 0 0 63529412 0 0 50000
> sai2_sel 0 0 0 508235294 0 0 50000
> sai2_pred 0 0 0 127058824 0 0 50000
> sai2_podf 0 0 0 63529412 0 0 50000
> sai2 0 0 0 63529412 0 0 50000
> sai3_sel 0 0 0 508235294 0 0 50000
> sai3_pred 0 0 0 127058824 0 0 50000
> sai3_podf 0 0 0 63529412 0 0 50000
> sai3 0 0 0 63529412 0 0 50000
> pll3_pfd1_540m 0 0 0 540000000 0 0 50000
> lcdif_pre_sel 0 0 0 540000000 0 0 50000
> lcdif_pred 0 0 0 270000000 0 0 50000
> lcdif_podf 0 0 0 135000000 0 0 50000
> lcdif_pix 0 0 0 135000000 0 0 50000
> iomuxc 0 0 0 135000000 0 0 50000
> lcdif_sel 0 0 0 135000000 0 0 50000
> pll3_pfd0_720m 0 0 0 720000000 0 0 50000
> usbphy1 1 1 0 480000000 0 0 50000
> pll2 1 1 0 528000000 0 0 50000
> pll2_bypass 1 1 0 528000000 0 0 50000
> pll2_bus 2 2 0 528000000 0 0 50000
> ca7_secondary_sel 0 0 0 528000000 0 0 50000
> step 0 0 0 528000000 0 0 50000
> periph_pre 1 1 0 528000000 0 0 50000
> periph 3 3 0 528000000 0 0 50000
> ahb 7 7 0 132000000 0 0 50000
> sdma 0 0 0 132000000 0 0 50000
> rom 1 1 0 132000000 0 0 50000
> esai_mem 0 0 0 132000000 0 0 50000
> esai_ipg 0 0 0 132000000 0 0 50000
> aips_tz3 1 1 0 132000000 0 0 50000
> enet_ahb 2 2 0 132000000 0 0 50000
> dcp 0 0 0 132000000 0 0 50000
> asrc_mem 0 0 0 132000000 0 0 50000
> asrc_ipg 0 0 0 132000000 0 0 50000
> aips_tz2 1 1 0 132000000 0 0 50000
> aips_tz1 1 1 0 132000000 0 0 50000
> ipg 10 10 0 66000000 0 0 50000
> wdog3 0 0 0 66000000 0 0 50000
> uart8_ipg 0 0 0 66000000 0 0 50000
> usboh3 2 2 0 66000000 0 0 50000
> sai2_ipg 0 0 0 66000000 0 0 50000
> sai1_ipg 0 0 0 66000000 0 0 50000
> uart7_ipg 0 0 0 66000000 0 0 50000
> uart1_ipg 1 2 0 66000000 0 0 50000
> sai3_ipg 0 0 0 66000000 0 0 50000
> spdif_gclk 0 0 0 66000000 0 0 50000
> spba 0 0 0 66000000 0 0 50000
> wdog2 0 0 0 66000000 0 0 50000
> kpp 0 0 0 66000000 0 0 50000
> mmdc_p1_ipg 0 0 0 66000000 0 0 50000
> mmdc_p0_ipg 2 2 0 66000000 0 0 50000
> wdog1 1 1 0 66000000 0 0 50000
> gpio4 1 1 0 66000000 0 0 50000
> uart6_ipg 0 0 0 66000000 0 0 50000
> uart5_ipg 0 0 0 66000000 0 0 50000
> gpio3 1 1 0 66000000 0 0 50000
> ocotp 0 0 0 66000000 0 0 50000
> gpio5 1 1 0 66000000 0 0 50000
> gpio1 1 1 0 66000000 0 0 50000
> uart4_ipg 0 0 0 66000000 0 0 50000
> adc1 0 0 0 66000000 0 0 50000
> uart3_ipg 0 0 0 66000000 0 0 50000
> adc2 0 0 0 66000000 0 0 50000
> gpio2 1 1 0 66000000 0 0 50000
> uart2_ipg 0 0 0 66000000 0 0 50000
> can2_ipg 0 0 0 66000000 0 0 50000
> can1_ipg 0 0 0 66000000 0 0 50000
> enet 2 2 0 66000000 0 0 50000
> axi_sel 1 1 0 528000000 0 0 50000
> axi_podf 2 2 0 264000000 0 0 50000
> axi 1 1 0 264000000 0 0 50000
> eim_slow_sel 0 0 0 264000000 0 0 50000
> eim_slow_podf 0 0 0 132000000 0 0 50000
> eim 0 0 0 132000000 0 0 50000
> lcdif_apb 0 0 0 264000000 0 0 50000
> pxp 0 0 0 264000000 0 0 50000
> epdc_aclk 0 0 0 264000000 0 0 50000
> pll2_pfd3_594m 0 0 0 594000000 0 0 50000
> ldb_di0_sel 0 0 0 594000000 0 0 50000
> ldb_di0_div_7 0 0 0 84857142 0 0 50000
> ldb_di0 0 0 0 84857142 0 0 50000
> ldb_di0_div_3_5 0 0 0 169714285 0 0 50000
> pll2_pfd2_396m 2 2 0 396000000 0 0 50000
> enfc_sel 0 0 0 396000000 0 0 50000
> enfc_pred 0 0 0 99000000 0 0 50000
> enfc_podf 0 0 0 99000000 0 0 50000
> gpmi_io 0 0 0 99000000 0 0 50000
> usdhc1_sel 0 0 0 396000000 0 0 50000
> usdhc1_podf 0 0 0 198000000 0 0 50000
> usdhc1 0 0 0 198000000 0 0 50000
> usdhc2_sel 0 0 0 396000000 0 0 50000
> usdhc2_podf 0 0 0 198000000 0 0 50000
> usdhc2 0 0 0 198000000 0 0 50000
> bch_sel 1 1 0 396000000 0 0 50000
> bch_podf 1 1 0 99000000 0 0 50000
> gpmi_apb 0 0 0 99000000 0 0 50000
> gpmi_bch_apb 0 0 0 99000000 0 0 50000
> per_bch 0 0 0 99000000 0 0 50000
> apbh_dma 1 1 0 99000000 0 0 50000
> gpmi_sel 0 0 0 396000000 0 0 50000
> gpmi_podf 0 0 0 99000000 0 0 50000
> gpmi_bch 0 0 0 99000000 0 0 50000
> periph2_pre 1 1 0 396000000 0 0 50000
> periph2 2 2 0 396000000 0 0 50000
> mmdc_podf 2 2 0 396000000 0 0 50000
> mmdc_p0_fast 1 1 0 396000000 0 0 50000
> axi_alt_sel 0 0 0 396000000 0 0 50000
> pll2_198m 0 0 0 198000000 0 0 50000
> pll2_pfd1_594m 0 0 0 594000000 0 0 50000
> pll2_pfd0_352m 0 0 0 352000000 0 0 50000
> pll1 1 1 0 900000000 0 0 50000
> pll1_bypass 1 1 0 900000000 0 0 50000
> pll1_sys 1 1 0 900000000 0 0 50000
> pll1_sw 1 1 0 900000000 0 0 50000
> arm 1 1 0 900000000 0 0 50000
> pll7_bypass_src 0 0 0 24000000 0 0 50000
> pll6_bypass_src 0 0 0 24000000 0 0 50000
> pll5_bypass_src 0 0 0 24000000 0 0 50000
> pll4_bypass_src 0 0 0 24000000 0 0 50000
> pll3_bypass_src 0 0 0 24000000 0 0 50000
> pll2_bypass_src 0 0 0 24000000 0 0 50000
> pll1_bypass_src 0 0 0 24000000 0 0 50000
> ckil 0 0 0 32768 0 0 50000
>
>
> Note that this was generated on a normal boot up (not failure).
The values looks good. Can you try with the below diff applied?
--->8---
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 334fe3130285..9771f6a82abe 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
/* Wait 64 clock cycles before using the GPMI after enabling the DLL */
- dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
- if (!dll_wait_time_us)
- dll_wait_time_us = 1;
+ dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
/* Wait for the DLL to settle. */
- udelay(dll_wait_time_us);
+ usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
}
static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-07-31 6:28 ` Boris Brezillon
@ 2019-08-02 7:19 ` Greg Ungerer
2019-08-02 12:34 ` Greg Ungerer
1 sibling, 0 replies; 50+ messages in thread
From: Greg Ungerer @ 2019-08-02 7:19 UTC (permalink / raw)
To: Boris Brezillon
Cc: s.hauer, Boris Brezillon, linux-mtd, Michael Nazzareno Trimarchi,
Miquel Raynal
Hi Boris,
On 31/7/19 4:28 pm, Boris Brezillon wrote:
> On Wed, 31 Jul 2019 12:05:44 +1000
> Greg Ungerer <gerg@kernel.org> wrote:
>
>> Hi Miquel, Boris,
>>
>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>> [snip]
>>>> Not sure if this is a useful data point... But I modified that
>>>> nand_init_data_interface() loop to start checking from data mode 4.
>>>> So now on every boot it defaults to mode 4. That has been running
>>>> most of the day, up to 900 boot cycles now, no failures.
>>>
>>> Ok so after having chatted quite a bit with Boris, it is very likely
>>> that, for these chips, the timings in mode 5 are too tight. It could
>>> fail the GET_FEATURES once in mode 5. Can you please dump every single
>>> intermediate value in gpmi_nfc_compute_timings() (period, *_cycles,
>>> use of half pêriods, tRP, sample delay, etc) as well as the content
>>> of /sys/kernel/debug/clk/clk_summary (you'll need debugfs support
>>> enabled and mounted).
>>>
>>> Also, can you be sure that the NAND chip is powered with 3.3V?
>>
>> Yes, 3.3V NAND chip.
>>
>> Using the attached patch I get the following trace:
>>
>> ...
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
>> sdr->tBERS_max=65535000000
>> sdr->tCCS_min=500000000
>> sdr->tPROG_max=65535000000
>> sdr->tR_max=200000000000000
>> sdr->tALH_min=20000
>> sdr->tADL_min=400000
>> sdr->tALS_min=50000
>> sdr->tAR_min=25000
>> sdr->tCEA_max=100000
>> sdr->tCEH_min=20000
>> sdr->tCH_min=20000
>> sdr->tCHZ_max=100000
>> sdr->tCLH_min=20000
>> sdr->tCLR_min=20000
>> sdr->tCLS_min=50000
>> sdr->tCOH_min=0
>> sdr->tCS_min=70000
>> sdr->tDH_min=20000
>> sdr->tDS_min=40000
>> sdr->tFEAT_max=1000000
>> sdr->tIR_min=10000
>> sdr->tITC_max=1000000
>> sdr->tRC_min=100000
>> sdr->tREA_max=40000
>> sdr->tREH_min=30000
>> sdr->tRHOH_min=0
>> sdr->tRHW_min=200000
>> sdr->tRHZ_max=200000
>> sdr->tRLOH_min=0
>> sdr->tRP_min=50000
>> sdr->tRR_min=40000
>> sdr->tRST_max=250000000000
>> sdr->tWB_max=200000
>> sdr->tWC_min=100000
>> sdr->tWH_min=30000
>> sdr->tWHR_min=120000
>> sdr->tWP_min=50000
>> sdr->tWW_min=100000
>> hw->clk_rate=22000000
>> wrn_dly_sel=0
>> period_ps=45454
>> addr_setup_cycles=2
>> data_setup_cycles=1
>> data_hold_cycles=1
>> busy_timeout_cycles=31302
>> hw->timing0=0x00020101
>> hw->timing1=0x60000000
>> dll_threshold_ps=12000
>> use_half_period=1
>> reference_period_ps=22727
>> tRP_ps=45454
>> sample_delay_ps=4294955664
>> sample_delay_factor=0
>> hw->ctrl1n=0x00000000
>> hw->ctrl1n=0x00000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
>> hw>clk_rate=22000000
>> clk_set_rate(r->clock[0], hw->clk_rate)=0
>> clk_get_rate(r->clock[0])=22000000
>> random: fast init done
>> 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
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
>> sdr->tBERS_max=3000000000
>> sdr->tCCS_min=100000
>> sdr->tPROG_max=600000000
>> sdr->tR_max=25000000
>> sdr->tALH_min=20000
>> sdr->tADL_min=400000
>> sdr->tALS_min=50000
>> sdr->tAR_min=25000
>> sdr->tCEA_max=100000
>> sdr->tCEH_min=20000
>> sdr->tCH_min=20000
>> sdr->tCHZ_max=100000
>> sdr->tCLH_min=20000
>> sdr->tCLR_min=20000
>> sdr->tCLS_min=50000
>> sdr->tCOH_min=0
>> sdr->tCS_min=70000
>> sdr->tDH_min=20000
>> sdr->tDS_min=40000
>> sdr->tFEAT_max=1000000
>> sdr->tIR_min=10000
>> sdr->tITC_max=1000000
>> sdr->tRC_min=100000
>> sdr->tREA_max=40000
>> sdr->tREH_min=30000
>> sdr->tRHOH_min=0
>> sdr->tRHW_min=200000
>> sdr->tRHZ_max=200000
>> sdr->tRLOH_min=0
>> sdr->tRP_min=50000
>> sdr->tRR_min=40000
>> sdr->tRST_max=250000000000
>> sdr->tWB_max=200000
>> sdr->tWC_min=100000
>> sdr->tWH_min=30000
>> sdr->tWHR_min=120000
>> sdr->tWP_min=50000
>> sdr->tWW_min=100000
>> hw->clk_rate=22000000
>> wrn_dly_sel=0
>> period_ps=45454
>> addr_setup_cycles=2
>> data_setup_cycles=1
>> data_hold_cycles=1
>> busy_timeout_cycles=555
>> hw->timing0=0x00020101
>> hw->timing1=0xb0000000
>> dll_threshold_ps=12000
>> use_half_period=1
>> reference_period_ps=22727
>> tRP_ps=45454
>> sample_delay_ps=4294955664
>> sample_delay_factor=0
>> hw->ctrl1n=0x00000000
>> hw->ctrl1n=0x00000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
>> hw>clk_rate=22000000
>> clk_set_rate(r->clock[0], hw->clk_rate)=0
>> clk_get_rate(r->clock[0])=22000000
>> gpmi-nand 1806000.gpmi-nand: use legacy bch geometry
>> drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
>> drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
>> drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
>> sdr->tBERS_max=3000000000
>> sdr->tCCS_min=100000
>> sdr->tPROG_max=600000000
>> sdr->tR_max=25000000
>> sdr->tALH_min=5000
>> sdr->tADL_min=400000
>> sdr->tALS_min=10000
>> sdr->tAR_min=10000
>> sdr->tCEA_max=25000
>> sdr->tCEH_min=20000
>> sdr->tCH_min=5000
>> sdr->tCHZ_max=30000
>> sdr->tCLH_min=5000
>> sdr->tCLR_min=10000
>> sdr->tCLS_min=10000
>> sdr->tCOH_min=15000
>> sdr->tCS_min=15000
>> sdr->tDH_min=5000
>> sdr->tDS_min=7000
>> sdr->tFEAT_max=1000000
>> sdr->tIR_min=0
>> sdr->tITC_max=1000000
>> sdr->tRC_min=20000
>> sdr->tREA_max=16000
>> sdr->tREH_min=7000
>> sdr->tRHOH_min=15000
>> sdr->tRHW_min=100000
>> sdr->tRHZ_max=100000
>> sdr->tRLOH_min=5000
>> sdr->tRP_min=10000
>> sdr->tRR_min=20000
>> sdr->tRST_max=500000000
>> sdr->tWB_max=100000
>> sdr->tWC_min=20000
>> sdr->tWH_min=7000
>> sdr->tWHR_min=80000
>> sdr->tWP_min=10000
>> sdr->tWW_min=100000
>> hw->clk_rate=100000000
>> wrn_dly_sel=3
>> period_ps=10000
>> addr_setup_cycles=1
>> data_setup_cycles=1
>> data_hold_cycles=1
>> busy_timeout_cycles=2510
>> hw->timing0=0x00010101
>> hw->timing1=0xe0000000
>> dll_threshold_ps=12000
>> use_half_period=0
>> reference_period_ps=10000
>> tRP_ps=10000
>> sample_delay_ps=80000
>> sample_delay_factor=8
>> hw->ctrl1n=0x00c00000
>> hw->ctrl1n=0x00c28000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
>> hw>clk_rate=100000000
>> clk_set_rate(r->clock[0], hw->clk_rate)=0
>> clk_get_rate(r->clock[0])=99000000
>> Scanning device for bad blocks
>> 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.
>> ...
>>
>>
>> And "cat /sys/kernel/debug/clk/clk_summary" gives:
>>
>> enable prepare protect duty
>> clock count count count rate accuracy phase cycle
>> ---------------------------------------------------------------------------------------------
>> dummy 2 2 0 0 0 0 50000
>> cko2_sel 0 0 0 0 0 0 50000
>> cko2_podf 0 0 0 0 0 0 50000
>> cko2 0 0 0 0 0 0 50000
>> cko1_sel 0 0 0 0 0 0 50000
>> cko1_podf 0 0 0 0 0 0 50000
>> cko1 0 0 0 0 0 0 50000
>> cko 0 0 0 0 0 0 50000
>> usbphy2_gate 1 1 0 0 0 0 50000
>> usbphy1_gate 1 1 0 0 0 0 50000
>> ipp_di1 0 0 0 0 0 0 50000
>> ipp_di0 0 0 0 0 0 0 50000
>> osc 6 6 0 24000000 0 0 50000
>> perclk_sel 1 1 0 24000000 0 0 50000
>> perclk 3 3 0 24000000 0 0 50000
>> pwm7 0 0 0 24000000 0 0 50000
>> pwm6 0 0 0 24000000 0 0 50000
>> pwm5 0 0 0 24000000 0 0 50000
>> i2c4 0 0 0 24000000 0 0 50000
>> pwm8 0 0 0 24000000 0 0 50000
>> pwm4 0 0 0 24000000 0 0 50000
>> pwm3 0 0 0 24000000 0 0 50000
>> pwm2 0 0 0 24000000 0 0 50000
>> pwm1 0 0 0 24000000 0 0 50000
>> i2c3 0 0 0 24000000 0 0 50000
>> i2c2 1 1 0 24000000 0 0 50000
>> i2c1 0 0 0 24000000 0 0 50000
>> gpt1_serial 1 1 0 24000000 0 0 50000
>> gpt1_bus 1 1 0 24000000 0 0 50000
>> epit2 0 0 0 24000000 0 0 50000
>> epit1 0 0 0 24000000 0 0 50000
>> gpt2_serial 0 0 0 24000000 0 0 50000
>> gpt2_bus 0 0 0 24000000 0 0 50000
>> periph_clk2_sel 0 0 0 24000000 0 0 50000
>> periph_clk2 0 0 0 24000000 0 0 50000
>> gpt_3m 0 0 0 3000000 0 0 50000
>> csi_sel 0 0 0 24000000 0 0 50000
>> csi_podf 0 0 0 24000000 0 0 50000
>> csi 0 0 0 24000000 0 0 50000
>> pll7 1 1 0 480000000 0 0 50000
>> pll7_bypass 1 1 0 480000000 0 0 50000
>> pll7_usb_host 1 1 0 480000000 0 0 50000
>> usbphy2 1 1 0 480000000 0 0 50000
>> pll6 1 1 0 500000000 0 0 50000
>> pll6_bypass 1 1 0 500000000 0 0 50000
>> pll6_enet 2 2 0 500000000 0 0 50000
>> enet_ptp_ref 1 1 0 25000000 0 0 50000
>> enet_ptp 1 1 0 25000000 0 0 50000
>> enet2_ref 0 0 0 50000000 0 0 50000
>> enet_ref_125m 0 0 0 50000000 0 0 50000
>> enet_ref 2 2 0 50000000 0 0 50000
>> pll5 0 0 0 296600000 0 0 50000
>> pll5_bypass 0 0 0 296600000 0 0 50000
>> pll5_video 0 0 0 296600000 0 0 50000
>> pll5_post_div 0 0 0 74150000 0 0 50000
>> pll5_video_div 0 0 0 74150000 0 0 50000
>> pll4 0 0 0 147456000 0 0 50000
>> pll4_bypass 0 0 0 147456000 0 0 50000
>> pll4_audio 0 0 0 147456000 0 0 50000
>> pll4_post_div 0 0 0 36864000 0 0 50000
>> pll4_audio_div 0 0 0 36864000 0 0 50000
>> pll3 1 1 0 480000000 0 0 50000
>> pll3_bypass 1 1 0 480000000 0 0 50000
>> pll3_usb_otg 2 2 0 480000000 0 0 50000
>> spdif_sel 0 0 0 480000000 0 0 50000
>> spdif_pred 0 0 0 240000000 0 0 50000
>> spdif_podf 0 0 0 30000000 0 0 50000
>> spdif 0 0 0 30000000 0 0 50000
>> esai_sel 0 0 0 480000000 0 0 50000
>> esai_pred 0 0 0 240000000 0 0 50000
>> esai_podf 0 0 0 30000000 0 0 50000
>> esai_extal 0 0 0 30000000 0 0 50000
>> qspi1_sel 0 0 0 480000000 0 0 50000
>> qspi1_podf 0 0 0 240000000 0 0 50000
>> qspi1 0 0 0 240000000 0 0 50000
>> ldb_di1_div_7 0 0 0 68571428 0 0 50000
>> ldb_di1 0 0 0 68571428 0 0 50000
>> ldb_di1_div_3_5 0 0 0 137142857 0 0 50000
>> periph2_clk2_sel 0 0 0 480000000 0 0 50000
>> periph2_clk2 0 0 0 480000000 0 0 50000
>> pll3_60m 0 0 0 60000000 0 0 50000
>> can_sel 0 0 0 60000000 0 0 50000
>> can_podf 0 0 0 30000000 0 0 50000
>> can2_serial 0 0 0 30000000 0 0 50000
>> can1_serial 0 0 0 30000000 0 0 50000
>> ecspi_sel 0 0 0 60000000 0 0 50000
>> ecspi_podf 0 0 0 60000000 0 0 50000
>> ecspi4 0 0 0 60000000 0 0 50000
>> ecspi3 0 0 0 60000000 0 0 50000
>> ecspi2 0 0 0 60000000 0 0 50000
>> ecspi1 0 0 0 60000000 0 0 50000
>> pll3_80m 1 1 0 80000000 0 0 50000
>> uart_sel 1 1 0 80000000 0 0 50000
>> uart_podf 1 1 0 80000000 0 0 50000
>> uart8_serial 0 0 0 80000000 0 0 50000
>> uart7_serial 0 0 0 80000000 0 0 50000
>> uart1_serial 1 2 0 80000000 0 0 50000
>> uart6_serial 0 0 0 80000000 0 0 50000
>> uart5_serial 0 0 0 80000000 0 0 50000
>> uart4_serial 0 0 0 80000000 0 0 50000
>> uart3_serial 0 0 0 80000000 0 0 50000
>> uart2_serial 0 0 0 80000000 0 0 50000
>> pll3_pfd3_454m 0 0 0 454736842 0 0 50000
>> pll3_pfd2_508m 0 0 0 508235294 0 0 50000
>> epdc_pre_sel 0 0 0 508235294 0 0 50000
>> epdc_podf 0 0 0 254117647 0 0 50000
>> epdc_pix 0 0 0 254117647 0 0 50000
>> epdc_sel 0 0 0 254117647 0 0 50000
>> sai1_sel 0 0 0 508235294 0 0 50000
>> sai1_pred 0 0 0 127058824 0 0 50000
>> sai1_podf 0 0 0 63529412 0 0 50000
>> sai1 0 0 0 63529412 0 0 50000
>> sai2_sel 0 0 0 508235294 0 0 50000
>> sai2_pred 0 0 0 127058824 0 0 50000
>> sai2_podf 0 0 0 63529412 0 0 50000
>> sai2 0 0 0 63529412 0 0 50000
>> sai3_sel 0 0 0 508235294 0 0 50000
>> sai3_pred 0 0 0 127058824 0 0 50000
>> sai3_podf 0 0 0 63529412 0 0 50000
>> sai3 0 0 0 63529412 0 0 50000
>> pll3_pfd1_540m 0 0 0 540000000 0 0 50000
>> lcdif_pre_sel 0 0 0 540000000 0 0 50000
>> lcdif_pred 0 0 0 270000000 0 0 50000
>> lcdif_podf 0 0 0 135000000 0 0 50000
>> lcdif_pix 0 0 0 135000000 0 0 50000
>> iomuxc 0 0 0 135000000 0 0 50000
>> lcdif_sel 0 0 0 135000000 0 0 50000
>> pll3_pfd0_720m 0 0 0 720000000 0 0 50000
>> usbphy1 1 1 0 480000000 0 0 50000
>> pll2 1 1 0 528000000 0 0 50000
>> pll2_bypass 1 1 0 528000000 0 0 50000
>> pll2_bus 2 2 0 528000000 0 0 50000
>> ca7_secondary_sel 0 0 0 528000000 0 0 50000
>> step 0 0 0 528000000 0 0 50000
>> periph_pre 1 1 0 528000000 0 0 50000
>> periph 3 3 0 528000000 0 0 50000
>> ahb 7 7 0 132000000 0 0 50000
>> sdma 0 0 0 132000000 0 0 50000
>> rom 1 1 0 132000000 0 0 50000
>> esai_mem 0 0 0 132000000 0 0 50000
>> esai_ipg 0 0 0 132000000 0 0 50000
>> aips_tz3 1 1 0 132000000 0 0 50000
>> enet_ahb 2 2 0 132000000 0 0 50000
>> dcp 0 0 0 132000000 0 0 50000
>> asrc_mem 0 0 0 132000000 0 0 50000
>> asrc_ipg 0 0 0 132000000 0 0 50000
>> aips_tz2 1 1 0 132000000 0 0 50000
>> aips_tz1 1 1 0 132000000 0 0 50000
>> ipg 10 10 0 66000000 0 0 50000
>> wdog3 0 0 0 66000000 0 0 50000
>> uart8_ipg 0 0 0 66000000 0 0 50000
>> usboh3 2 2 0 66000000 0 0 50000
>> sai2_ipg 0 0 0 66000000 0 0 50000
>> sai1_ipg 0 0 0 66000000 0 0 50000
>> uart7_ipg 0 0 0 66000000 0 0 50000
>> uart1_ipg 1 2 0 66000000 0 0 50000
>> sai3_ipg 0 0 0 66000000 0 0 50000
>> spdif_gclk 0 0 0 66000000 0 0 50000
>> spba 0 0 0 66000000 0 0 50000
>> wdog2 0 0 0 66000000 0 0 50000
>> kpp 0 0 0 66000000 0 0 50000
>> mmdc_p1_ipg 0 0 0 66000000 0 0 50000
>> mmdc_p0_ipg 2 2 0 66000000 0 0 50000
>> wdog1 1 1 0 66000000 0 0 50000
>> gpio4 1 1 0 66000000 0 0 50000
>> uart6_ipg 0 0 0 66000000 0 0 50000
>> uart5_ipg 0 0 0 66000000 0 0 50000
>> gpio3 1 1 0 66000000 0 0 50000
>> ocotp 0 0 0 66000000 0 0 50000
>> gpio5 1 1 0 66000000 0 0 50000
>> gpio1 1 1 0 66000000 0 0 50000
>> uart4_ipg 0 0 0 66000000 0 0 50000
>> adc1 0 0 0 66000000 0 0 50000
>> uart3_ipg 0 0 0 66000000 0 0 50000
>> adc2 0 0 0 66000000 0 0 50000
>> gpio2 1 1 0 66000000 0 0 50000
>> uart2_ipg 0 0 0 66000000 0 0 50000
>> can2_ipg 0 0 0 66000000 0 0 50000
>> can1_ipg 0 0 0 66000000 0 0 50000
>> enet 2 2 0 66000000 0 0 50000
>> axi_sel 1 1 0 528000000 0 0 50000
>> axi_podf 2 2 0 264000000 0 0 50000
>> axi 1 1 0 264000000 0 0 50000
>> eim_slow_sel 0 0 0 264000000 0 0 50000
>> eim_slow_podf 0 0 0 132000000 0 0 50000
>> eim 0 0 0 132000000 0 0 50000
>> lcdif_apb 0 0 0 264000000 0 0 50000
>> pxp 0 0 0 264000000 0 0 50000
>> epdc_aclk 0 0 0 264000000 0 0 50000
>> pll2_pfd3_594m 0 0 0 594000000 0 0 50000
>> ldb_di0_sel 0 0 0 594000000 0 0 50000
>> ldb_di0_div_7 0 0 0 84857142 0 0 50000
>> ldb_di0 0 0 0 84857142 0 0 50000
>> ldb_di0_div_3_5 0 0 0 169714285 0 0 50000
>> pll2_pfd2_396m 2 2 0 396000000 0 0 50000
>> enfc_sel 0 0 0 396000000 0 0 50000
>> enfc_pred 0 0 0 99000000 0 0 50000
>> enfc_podf 0 0 0 99000000 0 0 50000
>> gpmi_io 0 0 0 99000000 0 0 50000
>> usdhc1_sel 0 0 0 396000000 0 0 50000
>> usdhc1_podf 0 0 0 198000000 0 0 50000
>> usdhc1 0 0 0 198000000 0 0 50000
>> usdhc2_sel 0 0 0 396000000 0 0 50000
>> usdhc2_podf 0 0 0 198000000 0 0 50000
>> usdhc2 0 0 0 198000000 0 0 50000
>> bch_sel 1 1 0 396000000 0 0 50000
>> bch_podf 1 1 0 99000000 0 0 50000
>> gpmi_apb 0 0 0 99000000 0 0 50000
>> gpmi_bch_apb 0 0 0 99000000 0 0 50000
>> per_bch 0 0 0 99000000 0 0 50000
>> apbh_dma 1 1 0 99000000 0 0 50000
>> gpmi_sel 0 0 0 396000000 0 0 50000
>> gpmi_podf 0 0 0 99000000 0 0 50000
>> gpmi_bch 0 0 0 99000000 0 0 50000
>> periph2_pre 1 1 0 396000000 0 0 50000
>> periph2 2 2 0 396000000 0 0 50000
>> mmdc_podf 2 2 0 396000000 0 0 50000
>> mmdc_p0_fast 1 1 0 396000000 0 0 50000
>> axi_alt_sel 0 0 0 396000000 0 0 50000
>> pll2_198m 0 0 0 198000000 0 0 50000
>> pll2_pfd1_594m 0 0 0 594000000 0 0 50000
>> pll2_pfd0_352m 0 0 0 352000000 0 0 50000
>> pll1 1 1 0 900000000 0 0 50000
>> pll1_bypass 1 1 0 900000000 0 0 50000
>> pll1_sys 1 1 0 900000000 0 0 50000
>> pll1_sw 1 1 0 900000000 0 0 50000
>> arm 1 1 0 900000000 0 0 50000
>> pll7_bypass_src 0 0 0 24000000 0 0 50000
>> pll6_bypass_src 0 0 0 24000000 0 0 50000
>> pll5_bypass_src 0 0 0 24000000 0 0 50000
>> pll4_bypass_src 0 0 0 24000000 0 0 50000
>> pll3_bypass_src 0 0 0 24000000 0 0 50000
>> pll2_bypass_src 0 0 0 24000000 0 0 50000
>> pll1_bypass_src 0 0 0 24000000 0 0 50000
>> ckil 0 0 0 32768 0 0 50000
>>
>>
>> Note that this was generated on a normal boot up (not failure).
>
> The values looks good. Can you try with the below diff applied?
> --->8---
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> index 334fe3130285..9771f6a82abe 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>
> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> - if (!dll_wait_time_us)
> - dll_wait_time_us = 1;
> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>
> /* Wait for the DLL to settle. */
> - udelay(dll_wait_time_us);
> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> }
>
> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
Running a boot test with this now. Has run for a couple of hours, but I
want to give it a really good run over the weekend. Will report results
on Monday.
Thanks
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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
1 sibling, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-08-02 12:34 UTC (permalink / raw)
To: Boris Brezillon
Cc: s.hauer, Boris Brezillon, linux-mtd, Michael Nazzareno Trimarchi,
Miquel Raynal
Hi Boris,
On 31/7/19 4:28 pm, Boris Brezillon wrote:
> On Wed, 31 Jul 2019 12:05:44 +1000
> Greg Ungerer <gerg@kernel.org> wrote:
>
>> Hi Miquel, Boris,
>>
>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>> [snip]
>>>> Not sure if this is a useful data point... But I modified that
>>>> nand_init_data_interface() loop to start checking from data mode 4.
>>>> So now on every boot it defaults to mode 4. That has been running
>>>> most of the day, up to 900 boot cycles now, no failures.
>>>
>>> Ok so after having chatted quite a bit with Boris, it is very likely
>>> that, for these chips, the timings in mode 5 are too tight. It could
>>> fail the GET_FEATURES once in mode 5. Can you please dump every single
>>> intermediate value in gpmi_nfc_compute_timings() (period, *_cycles,
>>> use of half pêriods, tRP, sample delay, etc) as well as the content
>>> of /sys/kernel/debug/clk/clk_summary (you'll need debugfs support
>>> enabled and mounted).
>>>
>>> Also, can you be sure that the NAND chip is powered with 3.3V?
>>
>> Yes, 3.3V NAND chip.
>>
>> Using the attached patch I get the following trace:
>>
>> ...
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
>> sdr->tBERS_max=65535000000
>> sdr->tCCS_min=500000000
>> sdr->tPROG_max=65535000000
>> sdr->tR_max=200000000000000
>> sdr->tALH_min=20000
>> sdr->tADL_min=400000
>> sdr->tALS_min=50000
>> sdr->tAR_min=25000
>> sdr->tCEA_max=100000
>> sdr->tCEH_min=20000
>> sdr->tCH_min=20000
>> sdr->tCHZ_max=100000
>> sdr->tCLH_min=20000
>> sdr->tCLR_min=20000
>> sdr->tCLS_min=50000
>> sdr->tCOH_min=0
>> sdr->tCS_min=70000
>> sdr->tDH_min=20000
>> sdr->tDS_min=40000
>> sdr->tFEAT_max=1000000
>> sdr->tIR_min=10000
>> sdr->tITC_max=1000000
>> sdr->tRC_min=100000
>> sdr->tREA_max=40000
>> sdr->tREH_min=30000
>> sdr->tRHOH_min=0
>> sdr->tRHW_min=200000
>> sdr->tRHZ_max=200000
>> sdr->tRLOH_min=0
>> sdr->tRP_min=50000
>> sdr->tRR_min=40000
>> sdr->tRST_max=250000000000
>> sdr->tWB_max=200000
>> sdr->tWC_min=100000
>> sdr->tWH_min=30000
>> sdr->tWHR_min=120000
>> sdr->tWP_min=50000
>> sdr->tWW_min=100000
>> hw->clk_rate=22000000
>> wrn_dly_sel=0
>> period_ps=45454
>> addr_setup_cycles=2
>> data_setup_cycles=1
>> data_hold_cycles=1
>> busy_timeout_cycles=31302
>> hw->timing0=0x00020101
>> hw->timing1=0x60000000
>> dll_threshold_ps=12000
>> use_half_period=1
>> reference_period_ps=22727
>> tRP_ps=45454
>> sample_delay_ps=4294955664
>> sample_delay_factor=0
>> hw->ctrl1n=0x00000000
>> hw->ctrl1n=0x00000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
>> hw>clk_rate=22000000
>> clk_set_rate(r->clock[0], hw->clk_rate)=0
>> clk_get_rate(r->clock[0])=22000000
>> random: fast init done
>> 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
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
>> sdr->tBERS_max=3000000000
>> sdr->tCCS_min=100000
>> sdr->tPROG_max=600000000
>> sdr->tR_max=25000000
>> sdr->tALH_min=20000
>> sdr->tADL_min=400000
>> sdr->tALS_min=50000
>> sdr->tAR_min=25000
>> sdr->tCEA_max=100000
>> sdr->tCEH_min=20000
>> sdr->tCH_min=20000
>> sdr->tCHZ_max=100000
>> sdr->tCLH_min=20000
>> sdr->tCLR_min=20000
>> sdr->tCLS_min=50000
>> sdr->tCOH_min=0
>> sdr->tCS_min=70000
>> sdr->tDH_min=20000
>> sdr->tDS_min=40000
>> sdr->tFEAT_max=1000000
>> sdr->tIR_min=10000
>> sdr->tITC_max=1000000
>> sdr->tRC_min=100000
>> sdr->tREA_max=40000
>> sdr->tREH_min=30000
>> sdr->tRHOH_min=0
>> sdr->tRHW_min=200000
>> sdr->tRHZ_max=200000
>> sdr->tRLOH_min=0
>> sdr->tRP_min=50000
>> sdr->tRR_min=40000
>> sdr->tRST_max=250000000000
>> sdr->tWB_max=200000
>> sdr->tWC_min=100000
>> sdr->tWH_min=30000
>> sdr->tWHR_min=120000
>> sdr->tWP_min=50000
>> sdr->tWW_min=100000
>> hw->clk_rate=22000000
>> wrn_dly_sel=0
>> period_ps=45454
>> addr_setup_cycles=2
>> data_setup_cycles=1
>> data_hold_cycles=1
>> busy_timeout_cycles=555
>> hw->timing0=0x00020101
>> hw->timing1=0xb0000000
>> dll_threshold_ps=12000
>> use_half_period=1
>> reference_period_ps=22727
>> tRP_ps=45454
>> sample_delay_ps=4294955664
>> sample_delay_factor=0
>> hw->ctrl1n=0x00000000
>> hw->ctrl1n=0x00000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
>> hw>clk_rate=22000000
>> clk_set_rate(r->clock[0], hw->clk_rate)=0
>> clk_get_rate(r->clock[0])=22000000
>> gpmi-nand 1806000.gpmi-nand: use legacy bch geometry
>> drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
>> drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
>> drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
>> sdr->tBERS_max=3000000000
>> sdr->tCCS_min=100000
>> sdr->tPROG_max=600000000
>> sdr->tR_max=25000000
>> sdr->tALH_min=5000
>> sdr->tADL_min=400000
>> sdr->tALS_min=10000
>> sdr->tAR_min=10000
>> sdr->tCEA_max=25000
>> sdr->tCEH_min=20000
>> sdr->tCH_min=5000
>> sdr->tCHZ_max=30000
>> sdr->tCLH_min=5000
>> sdr->tCLR_min=10000
>> sdr->tCLS_min=10000
>> sdr->tCOH_min=15000
>> sdr->tCS_min=15000
>> sdr->tDH_min=5000
>> sdr->tDS_min=7000
>> sdr->tFEAT_max=1000000
>> sdr->tIR_min=0
>> sdr->tITC_max=1000000
>> sdr->tRC_min=20000
>> sdr->tREA_max=16000
>> sdr->tREH_min=7000
>> sdr->tRHOH_min=15000
>> sdr->tRHW_min=100000
>> sdr->tRHZ_max=100000
>> sdr->tRLOH_min=5000
>> sdr->tRP_min=10000
>> sdr->tRR_min=20000
>> sdr->tRST_max=500000000
>> sdr->tWB_max=100000
>> sdr->tWC_min=20000
>> sdr->tWH_min=7000
>> sdr->tWHR_min=80000
>> sdr->tWP_min=10000
>> sdr->tWW_min=100000
>> hw->clk_rate=100000000
>> wrn_dly_sel=3
>> period_ps=10000
>> addr_setup_cycles=1
>> data_setup_cycles=1
>> data_hold_cycles=1
>> busy_timeout_cycles=2510
>> hw->timing0=0x00010101
>> hw->timing1=0xe0000000
>> dll_threshold_ps=12000
>> use_half_period=0
>> reference_period_ps=10000
>> tRP_ps=10000
>> sample_delay_ps=80000
>> sample_delay_factor=8
>> hw->ctrl1n=0x00c00000
>> hw->ctrl1n=0x00c28000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
>> hw>clk_rate=100000000
>> clk_set_rate(r->clock[0], hw->clk_rate)=0
>> clk_get_rate(r->clock[0])=99000000
>> Scanning device for bad blocks
>> 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.
>> ...
>>
>>
>> And "cat /sys/kernel/debug/clk/clk_summary" gives:
>>
>> enable prepare protect duty
>> clock count count count rate accuracy phase cycle
>> ---------------------------------------------------------------------------------------------
>> dummy 2 2 0 0 0 0 50000
>> cko2_sel 0 0 0 0 0 0 50000
>> cko2_podf 0 0 0 0 0 0 50000
>> cko2 0 0 0 0 0 0 50000
>> cko1_sel 0 0 0 0 0 0 50000
>> cko1_podf 0 0 0 0 0 0 50000
>> cko1 0 0 0 0 0 0 50000
>> cko 0 0 0 0 0 0 50000
>> usbphy2_gate 1 1 0 0 0 0 50000
>> usbphy1_gate 1 1 0 0 0 0 50000
>> ipp_di1 0 0 0 0 0 0 50000
>> ipp_di0 0 0 0 0 0 0 50000
>> osc 6 6 0 24000000 0 0 50000
>> perclk_sel 1 1 0 24000000 0 0 50000
>> perclk 3 3 0 24000000 0 0 50000
>> pwm7 0 0 0 24000000 0 0 50000
>> pwm6 0 0 0 24000000 0 0 50000
>> pwm5 0 0 0 24000000 0 0 50000
>> i2c4 0 0 0 24000000 0 0 50000
>> pwm8 0 0 0 24000000 0 0 50000
>> pwm4 0 0 0 24000000 0 0 50000
>> pwm3 0 0 0 24000000 0 0 50000
>> pwm2 0 0 0 24000000 0 0 50000
>> pwm1 0 0 0 24000000 0 0 50000
>> i2c3 0 0 0 24000000 0 0 50000
>> i2c2 1 1 0 24000000 0 0 50000
>> i2c1 0 0 0 24000000 0 0 50000
>> gpt1_serial 1 1 0 24000000 0 0 50000
>> gpt1_bus 1 1 0 24000000 0 0 50000
>> epit2 0 0 0 24000000 0 0 50000
>> epit1 0 0 0 24000000 0 0 50000
>> gpt2_serial 0 0 0 24000000 0 0 50000
>> gpt2_bus 0 0 0 24000000 0 0 50000
>> periph_clk2_sel 0 0 0 24000000 0 0 50000
>> periph_clk2 0 0 0 24000000 0 0 50000
>> gpt_3m 0 0 0 3000000 0 0 50000
>> csi_sel 0 0 0 24000000 0 0 50000
>> csi_podf 0 0 0 24000000 0 0 50000
>> csi 0 0 0 24000000 0 0 50000
>> pll7 1 1 0 480000000 0 0 50000
>> pll7_bypass 1 1 0 480000000 0 0 50000
>> pll7_usb_host 1 1 0 480000000 0 0 50000
>> usbphy2 1 1 0 480000000 0 0 50000
>> pll6 1 1 0 500000000 0 0 50000
>> pll6_bypass 1 1 0 500000000 0 0 50000
>> pll6_enet 2 2 0 500000000 0 0 50000
>> enet_ptp_ref 1 1 0 25000000 0 0 50000
>> enet_ptp 1 1 0 25000000 0 0 50000
>> enet2_ref 0 0 0 50000000 0 0 50000
>> enet_ref_125m 0 0 0 50000000 0 0 50000
>> enet_ref 2 2 0 50000000 0 0 50000
>> pll5 0 0 0 296600000 0 0 50000
>> pll5_bypass 0 0 0 296600000 0 0 50000
>> pll5_video 0 0 0 296600000 0 0 50000
>> pll5_post_div 0 0 0 74150000 0 0 50000
>> pll5_video_div 0 0 0 74150000 0 0 50000
>> pll4 0 0 0 147456000 0 0 50000
>> pll4_bypass 0 0 0 147456000 0 0 50000
>> pll4_audio 0 0 0 147456000 0 0 50000
>> pll4_post_div 0 0 0 36864000 0 0 50000
>> pll4_audio_div 0 0 0 36864000 0 0 50000
>> pll3 1 1 0 480000000 0 0 50000
>> pll3_bypass 1 1 0 480000000 0 0 50000
>> pll3_usb_otg 2 2 0 480000000 0 0 50000
>> spdif_sel 0 0 0 480000000 0 0 50000
>> spdif_pred 0 0 0 240000000 0 0 50000
>> spdif_podf 0 0 0 30000000 0 0 50000
>> spdif 0 0 0 30000000 0 0 50000
>> esai_sel 0 0 0 480000000 0 0 50000
>> esai_pred 0 0 0 240000000 0 0 50000
>> esai_podf 0 0 0 30000000 0 0 50000
>> esai_extal 0 0 0 30000000 0 0 50000
>> qspi1_sel 0 0 0 480000000 0 0 50000
>> qspi1_podf 0 0 0 240000000 0 0 50000
>> qspi1 0 0 0 240000000 0 0 50000
>> ldb_di1_div_7 0 0 0 68571428 0 0 50000
>> ldb_di1 0 0 0 68571428 0 0 50000
>> ldb_di1_div_3_5 0 0 0 137142857 0 0 50000
>> periph2_clk2_sel 0 0 0 480000000 0 0 50000
>> periph2_clk2 0 0 0 480000000 0 0 50000
>> pll3_60m 0 0 0 60000000 0 0 50000
>> can_sel 0 0 0 60000000 0 0 50000
>> can_podf 0 0 0 30000000 0 0 50000
>> can2_serial 0 0 0 30000000 0 0 50000
>> can1_serial 0 0 0 30000000 0 0 50000
>> ecspi_sel 0 0 0 60000000 0 0 50000
>> ecspi_podf 0 0 0 60000000 0 0 50000
>> ecspi4 0 0 0 60000000 0 0 50000
>> ecspi3 0 0 0 60000000 0 0 50000
>> ecspi2 0 0 0 60000000 0 0 50000
>> ecspi1 0 0 0 60000000 0 0 50000
>> pll3_80m 1 1 0 80000000 0 0 50000
>> uart_sel 1 1 0 80000000 0 0 50000
>> uart_podf 1 1 0 80000000 0 0 50000
>> uart8_serial 0 0 0 80000000 0 0 50000
>> uart7_serial 0 0 0 80000000 0 0 50000
>> uart1_serial 1 2 0 80000000 0 0 50000
>> uart6_serial 0 0 0 80000000 0 0 50000
>> uart5_serial 0 0 0 80000000 0 0 50000
>> uart4_serial 0 0 0 80000000 0 0 50000
>> uart3_serial 0 0 0 80000000 0 0 50000
>> uart2_serial 0 0 0 80000000 0 0 50000
>> pll3_pfd3_454m 0 0 0 454736842 0 0 50000
>> pll3_pfd2_508m 0 0 0 508235294 0 0 50000
>> epdc_pre_sel 0 0 0 508235294 0 0 50000
>> epdc_podf 0 0 0 254117647 0 0 50000
>> epdc_pix 0 0 0 254117647 0 0 50000
>> epdc_sel 0 0 0 254117647 0 0 50000
>> sai1_sel 0 0 0 508235294 0 0 50000
>> sai1_pred 0 0 0 127058824 0 0 50000
>> sai1_podf 0 0 0 63529412 0 0 50000
>> sai1 0 0 0 63529412 0 0 50000
>> sai2_sel 0 0 0 508235294 0 0 50000
>> sai2_pred 0 0 0 127058824 0 0 50000
>> sai2_podf 0 0 0 63529412 0 0 50000
>> sai2 0 0 0 63529412 0 0 50000
>> sai3_sel 0 0 0 508235294 0 0 50000
>> sai3_pred 0 0 0 127058824 0 0 50000
>> sai3_podf 0 0 0 63529412 0 0 50000
>> sai3 0 0 0 63529412 0 0 50000
>> pll3_pfd1_540m 0 0 0 540000000 0 0 50000
>> lcdif_pre_sel 0 0 0 540000000 0 0 50000
>> lcdif_pred 0 0 0 270000000 0 0 50000
>> lcdif_podf 0 0 0 135000000 0 0 50000
>> lcdif_pix 0 0 0 135000000 0 0 50000
>> iomuxc 0 0 0 135000000 0 0 50000
>> lcdif_sel 0 0 0 135000000 0 0 50000
>> pll3_pfd0_720m 0 0 0 720000000 0 0 50000
>> usbphy1 1 1 0 480000000 0 0 50000
>> pll2 1 1 0 528000000 0 0 50000
>> pll2_bypass 1 1 0 528000000 0 0 50000
>> pll2_bus 2 2 0 528000000 0 0 50000
>> ca7_secondary_sel 0 0 0 528000000 0 0 50000
>> step 0 0 0 528000000 0 0 50000
>> periph_pre 1 1 0 528000000 0 0 50000
>> periph 3 3 0 528000000 0 0 50000
>> ahb 7 7 0 132000000 0 0 50000
>> sdma 0 0 0 132000000 0 0 50000
>> rom 1 1 0 132000000 0 0 50000
>> esai_mem 0 0 0 132000000 0 0 50000
>> esai_ipg 0 0 0 132000000 0 0 50000
>> aips_tz3 1 1 0 132000000 0 0 50000
>> enet_ahb 2 2 0 132000000 0 0 50000
>> dcp 0 0 0 132000000 0 0 50000
>> asrc_mem 0 0 0 132000000 0 0 50000
>> asrc_ipg 0 0 0 132000000 0 0 50000
>> aips_tz2 1 1 0 132000000 0 0 50000
>> aips_tz1 1 1 0 132000000 0 0 50000
>> ipg 10 10 0 66000000 0 0 50000
>> wdog3 0 0 0 66000000 0 0 50000
>> uart8_ipg 0 0 0 66000000 0 0 50000
>> usboh3 2 2 0 66000000 0 0 50000
>> sai2_ipg 0 0 0 66000000 0 0 50000
>> sai1_ipg 0 0 0 66000000 0 0 50000
>> uart7_ipg 0 0 0 66000000 0 0 50000
>> uart1_ipg 1 2 0 66000000 0 0 50000
>> sai3_ipg 0 0 0 66000000 0 0 50000
>> spdif_gclk 0 0 0 66000000 0 0 50000
>> spba 0 0 0 66000000 0 0 50000
>> wdog2 0 0 0 66000000 0 0 50000
>> kpp 0 0 0 66000000 0 0 50000
>> mmdc_p1_ipg 0 0 0 66000000 0 0 50000
>> mmdc_p0_ipg 2 2 0 66000000 0 0 50000
>> wdog1 1 1 0 66000000 0 0 50000
>> gpio4 1 1 0 66000000 0 0 50000
>> uart6_ipg 0 0 0 66000000 0 0 50000
>> uart5_ipg 0 0 0 66000000 0 0 50000
>> gpio3 1 1 0 66000000 0 0 50000
>> ocotp 0 0 0 66000000 0 0 50000
>> gpio5 1 1 0 66000000 0 0 50000
>> gpio1 1 1 0 66000000 0 0 50000
>> uart4_ipg 0 0 0 66000000 0 0 50000
>> adc1 0 0 0 66000000 0 0 50000
>> uart3_ipg 0 0 0 66000000 0 0 50000
>> adc2 0 0 0 66000000 0 0 50000
>> gpio2 1 1 0 66000000 0 0 50000
>> uart2_ipg 0 0 0 66000000 0 0 50000
>> can2_ipg 0 0 0 66000000 0 0 50000
>> can1_ipg 0 0 0 66000000 0 0 50000
>> enet 2 2 0 66000000 0 0 50000
>> axi_sel 1 1 0 528000000 0 0 50000
>> axi_podf 2 2 0 264000000 0 0 50000
>> axi 1 1 0 264000000 0 0 50000
>> eim_slow_sel 0 0 0 264000000 0 0 50000
>> eim_slow_podf 0 0 0 132000000 0 0 50000
>> eim 0 0 0 132000000 0 0 50000
>> lcdif_apb 0 0 0 264000000 0 0 50000
>> pxp 0 0 0 264000000 0 0 50000
>> epdc_aclk 0 0 0 264000000 0 0 50000
>> pll2_pfd3_594m 0 0 0 594000000 0 0 50000
>> ldb_di0_sel 0 0 0 594000000 0 0 50000
>> ldb_di0_div_7 0 0 0 84857142 0 0 50000
>> ldb_di0 0 0 0 84857142 0 0 50000
>> ldb_di0_div_3_5 0 0 0 169714285 0 0 50000
>> pll2_pfd2_396m 2 2 0 396000000 0 0 50000
>> enfc_sel 0 0 0 396000000 0 0 50000
>> enfc_pred 0 0 0 99000000 0 0 50000
>> enfc_podf 0 0 0 99000000 0 0 50000
>> gpmi_io 0 0 0 99000000 0 0 50000
>> usdhc1_sel 0 0 0 396000000 0 0 50000
>> usdhc1_podf 0 0 0 198000000 0 0 50000
>> usdhc1 0 0 0 198000000 0 0 50000
>> usdhc2_sel 0 0 0 396000000 0 0 50000
>> usdhc2_podf 0 0 0 198000000 0 0 50000
>> usdhc2 0 0 0 198000000 0 0 50000
>> bch_sel 1 1 0 396000000 0 0 50000
>> bch_podf 1 1 0 99000000 0 0 50000
>> gpmi_apb 0 0 0 99000000 0 0 50000
>> gpmi_bch_apb 0 0 0 99000000 0 0 50000
>> per_bch 0 0 0 99000000 0 0 50000
>> apbh_dma 1 1 0 99000000 0 0 50000
>> gpmi_sel 0 0 0 396000000 0 0 50000
>> gpmi_podf 0 0 0 99000000 0 0 50000
>> gpmi_bch 0 0 0 99000000 0 0 50000
>> periph2_pre 1 1 0 396000000 0 0 50000
>> periph2 2 2 0 396000000 0 0 50000
>> mmdc_podf 2 2 0 396000000 0 0 50000
>> mmdc_p0_fast 1 1 0 396000000 0 0 50000
>> axi_alt_sel 0 0 0 396000000 0 0 50000
>> pll2_198m 0 0 0 198000000 0 0 50000
>> pll2_pfd1_594m 0 0 0 594000000 0 0 50000
>> pll2_pfd0_352m 0 0 0 352000000 0 0 50000
>> pll1 1 1 0 900000000 0 0 50000
>> pll1_bypass 1 1 0 900000000 0 0 50000
>> pll1_sys 1 1 0 900000000 0 0 50000
>> pll1_sw 1 1 0 900000000 0 0 50000
>> arm 1 1 0 900000000 0 0 50000
>> pll7_bypass_src 0 0 0 24000000 0 0 50000
>> pll6_bypass_src 0 0 0 24000000 0 0 50000
>> pll5_bypass_src 0 0 0 24000000 0 0 50000
>> pll4_bypass_src 0 0 0 24000000 0 0 50000
>> pll3_bypass_src 0 0 0 24000000 0 0 50000
>> pll2_bypass_src 0 0 0 24000000 0 0 50000
>> pll1_bypass_src 0 0 0 24000000 0 0 50000
>> ckil 0 0 0 32768 0 0 50000
>>
>>
>> Note that this was generated on a normal boot up (not failure).
>
> The values looks good. Can you try with the below diff applied?
> --->8---
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> index 334fe3130285..9771f6a82abe 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>
> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> - if (!dll_wait_time_us)
> - dll_wait_time_us = 1;
> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>
> /* Wait for the DLL to settle. */
> - udelay(dll_wait_time_us);
> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> }
>
> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
Eventually it failed, in the same way with with same errors.
Took quite a while, over 600 boot cycles.
Note also that I had to hand merge the changes, since in 5.1.14 that
gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
Regards
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-02 12:34 ` Greg Ungerer
@ 2019-08-02 12:51 ` Boris Brezillon
2019-08-05 5:51 ` Greg Ungerer
0 siblings, 1 reply; 50+ messages in thread
From: Boris Brezillon @ 2019-08-02 12:51 UTC (permalink / raw)
To: Greg Ungerer
Cc: s.hauer, Boris Brezillon, linux-mtd, Michael Nazzareno Trimarchi,
Miquel Raynal
On Fri, 2 Aug 2019 22:34:57 +1000
Greg Ungerer <gerg@kernel.org> wrote:
> Hi Boris,
>
> On 31/7/19 4:28 pm, Boris Brezillon wrote:
> > On Wed, 31 Jul 2019 12:05:44 +1000
> > Greg Ungerer <gerg@kernel.org> wrote:
> >
> >> Hi Miquel, Boris,
> >>
> >> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> >>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>>>> [snip]
> >>>> Not sure if this is a useful data point... But I modified that
> >>>> nand_init_data_interface() loop to start checking from data mode 4.
> >>>> So now on every boot it defaults to mode 4. That has been running
> >>>> most of the day, up to 900 boot cycles now, no failures.
> >>>
> >>> Ok so after having chatted quite a bit with Boris, it is very likely
> >>> that, for these chips, the timings in mode 5 are too tight. It could
> >>> fail the GET_FEATURES once in mode 5. Can you please dump every single
> >>> intermediate value in gpmi_nfc_compute_timings() (period, *_cycles,
> >>> use of half pêriods, tRP, sample delay, etc) as well as the content
> >>> of /sys/kernel/debug/clk/clk_summary (you'll need debugfs support
> >>> enabled and mounted).
> >>>
> >>> Also, can you be sure that the NAND chip is powered with 3.3V?
> >>
> >> Yes, 3.3V NAND chip.
> >>
> >> Using the attached patch I get the following trace:
> >>
> >> ...
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
> >> sdr->tBERS_max=65535000000
> >> sdr->tCCS_min=500000000
> >> sdr->tPROG_max=65535000000
> >> sdr->tR_max=200000000000000
> >> sdr->tALH_min=20000
> >> sdr->tADL_min=400000
> >> sdr->tALS_min=50000
> >> sdr->tAR_min=25000
> >> sdr->tCEA_max=100000
> >> sdr->tCEH_min=20000
> >> sdr->tCH_min=20000
> >> sdr->tCHZ_max=100000
> >> sdr->tCLH_min=20000
> >> sdr->tCLR_min=20000
> >> sdr->tCLS_min=50000
> >> sdr->tCOH_min=0
> >> sdr->tCS_min=70000
> >> sdr->tDH_min=20000
> >> sdr->tDS_min=40000
> >> sdr->tFEAT_max=1000000
> >> sdr->tIR_min=10000
> >> sdr->tITC_max=1000000
> >> sdr->tRC_min=100000
> >> sdr->tREA_max=40000
> >> sdr->tREH_min=30000
> >> sdr->tRHOH_min=0
> >> sdr->tRHW_min=200000
> >> sdr->tRHZ_max=200000
> >> sdr->tRLOH_min=0
> >> sdr->tRP_min=50000
> >> sdr->tRR_min=40000
> >> sdr->tRST_max=250000000000
> >> sdr->tWB_max=200000
> >> sdr->tWC_min=100000
> >> sdr->tWH_min=30000
> >> sdr->tWHR_min=120000
> >> sdr->tWP_min=50000
> >> sdr->tWW_min=100000
> >> hw->clk_rate=22000000
> >> wrn_dly_sel=0
> >> period_ps=45454
> >> addr_setup_cycles=2
> >> data_setup_cycles=1
> >> data_hold_cycles=1
> >> busy_timeout_cycles=31302
> >> hw->timing0=0x00020101
> >> hw->timing1=0x60000000
> >> dll_threshold_ps=12000
> >> use_half_period=1
> >> reference_period_ps=22727
> >> tRP_ps=45454
> >> sample_delay_ps=4294955664
> >> sample_delay_factor=0
> >> hw->ctrl1n=0x00000000
> >> hw->ctrl1n=0x00000000
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
> >> hw>clk_rate=22000000
> >> clk_set_rate(r->clock[0], hw->clk_rate)=0
> >> clk_get_rate(r->clock[0])=22000000
> >> random: fast init done
> >> 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
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
> >> sdr->tBERS_max=3000000000
> >> sdr->tCCS_min=100000
> >> sdr->tPROG_max=600000000
> >> sdr->tR_max=25000000
> >> sdr->tALH_min=20000
> >> sdr->tADL_min=400000
> >> sdr->tALS_min=50000
> >> sdr->tAR_min=25000
> >> sdr->tCEA_max=100000
> >> sdr->tCEH_min=20000
> >> sdr->tCH_min=20000
> >> sdr->tCHZ_max=100000
> >> sdr->tCLH_min=20000
> >> sdr->tCLR_min=20000
> >> sdr->tCLS_min=50000
> >> sdr->tCOH_min=0
> >> sdr->tCS_min=70000
> >> sdr->tDH_min=20000
> >> sdr->tDS_min=40000
> >> sdr->tFEAT_max=1000000
> >> sdr->tIR_min=10000
> >> sdr->tITC_max=1000000
> >> sdr->tRC_min=100000
> >> sdr->tREA_max=40000
> >> sdr->tREH_min=30000
> >> sdr->tRHOH_min=0
> >> sdr->tRHW_min=200000
> >> sdr->tRHZ_max=200000
> >> sdr->tRLOH_min=0
> >> sdr->tRP_min=50000
> >> sdr->tRR_min=40000
> >> sdr->tRST_max=250000000000
> >> sdr->tWB_max=200000
> >> sdr->tWC_min=100000
> >> sdr->tWH_min=30000
> >> sdr->tWHR_min=120000
> >> sdr->tWP_min=50000
> >> sdr->tWW_min=100000
> >> hw->clk_rate=22000000
> >> wrn_dly_sel=0
> >> period_ps=45454
> >> addr_setup_cycles=2
> >> data_setup_cycles=1
> >> data_hold_cycles=1
> >> busy_timeout_cycles=555
> >> hw->timing0=0x00020101
> >> hw->timing1=0xb0000000
> >> dll_threshold_ps=12000
> >> use_half_period=1
> >> reference_period_ps=22727
> >> tRP_ps=45454
> >> sample_delay_ps=4294955664
> >> sample_delay_factor=0
> >> hw->ctrl1n=0x00000000
> >> hw->ctrl1n=0x00000000
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
> >> hw>clk_rate=22000000
> >> clk_set_rate(r->clock[0], hw->clk_rate)=0
> >> clk_get_rate(r->clock[0])=22000000
> >> gpmi-nand 1806000.gpmi-nand: use legacy bch geometry
> >> drivers/mtd/nand/raw/nand_base.c(913): checking mode=5
> >> drivers/mtd/nand/raw/nand_base.c(927): BREAKING AT mode=5
> >> drivers/mtd/nand/raw/nand_base.c(932): chip->onfi_timing_mode_default=5
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(426): gpmi_nfc_compute_timings()
> >> sdr->tBERS_max=3000000000
> >> sdr->tCCS_min=100000
> >> sdr->tPROG_max=600000000
> >> sdr->tR_max=25000000
> >> sdr->tALH_min=5000
> >> sdr->tADL_min=400000
> >> sdr->tALS_min=10000
> >> sdr->tAR_min=10000
> >> sdr->tCEA_max=25000
> >> sdr->tCEH_min=20000
> >> sdr->tCH_min=5000
> >> sdr->tCHZ_max=30000
> >> sdr->tCLH_min=5000
> >> sdr->tCLR_min=10000
> >> sdr->tCLS_min=10000
> >> sdr->tCOH_min=15000
> >> sdr->tCS_min=15000
> >> sdr->tDH_min=5000
> >> sdr->tDS_min=7000
> >> sdr->tFEAT_max=1000000
> >> sdr->tIR_min=0
> >> sdr->tITC_max=1000000
> >> sdr->tRC_min=20000
> >> sdr->tREA_max=16000
> >> sdr->tREH_min=7000
> >> sdr->tRHOH_min=15000
> >> sdr->tRHW_min=100000
> >> sdr->tRHZ_max=100000
> >> sdr->tRLOH_min=5000
> >> sdr->tRP_min=10000
> >> sdr->tRR_min=20000
> >> sdr->tRST_max=500000000
> >> sdr->tWB_max=100000
> >> sdr->tWC_min=20000
> >> sdr->tWH_min=7000
> >> sdr->tWHR_min=80000
> >> sdr->tWP_min=10000
> >> sdr->tWW_min=100000
> >> hw->clk_rate=100000000
> >> wrn_dly_sel=3
> >> period_ps=10000
> >> addr_setup_cycles=1
> >> data_setup_cycles=1
> >> data_hold_cycles=1
> >> busy_timeout_cycles=2510
> >> hw->timing0=0x00010101
> >> hw->timing1=0xe0000000
> >> dll_threshold_ps=12000
> >> use_half_period=0
> >> reference_period_ps=10000
> >> tRP_ps=10000
> >> sample_delay_ps=80000
> >> sample_delay_factor=8
> >> hw->ctrl1n=0x00c00000
> >> hw->ctrl1n=0x00c28000
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(547): gpmi_nfc_apply_timings()
> >> hw>clk_rate=100000000
> >> clk_set_rate(r->clock[0], hw->clk_rate)=0
> >> clk_get_rate(r->clock[0])=99000000
> >> Scanning device for bad blocks
> >> 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.
> >> ...
> >>
> >>
> >> And "cat /sys/kernel/debug/clk/clk_summary" gives:
> >>
> >> enable prepare protect duty
> >> clock count count count rate accuracy phase cycle
> >> ---------------------------------------------------------------------------------------------
> >> dummy 2 2 0 0 0 0 50000
> >> cko2_sel 0 0 0 0 0 0 50000
> >> cko2_podf 0 0 0 0 0 0 50000
> >> cko2 0 0 0 0 0 0 50000
> >> cko1_sel 0 0 0 0 0 0 50000
> >> cko1_podf 0 0 0 0 0 0 50000
> >> cko1 0 0 0 0 0 0 50000
> >> cko 0 0 0 0 0 0 50000
> >> usbphy2_gate 1 1 0 0 0 0 50000
> >> usbphy1_gate 1 1 0 0 0 0 50000
> >> ipp_di1 0 0 0 0 0 0 50000
> >> ipp_di0 0 0 0 0 0 0 50000
> >> osc 6 6 0 24000000 0 0 50000
> >> perclk_sel 1 1 0 24000000 0 0 50000
> >> perclk 3 3 0 24000000 0 0 50000
> >> pwm7 0 0 0 24000000 0 0 50000
> >> pwm6 0 0 0 24000000 0 0 50000
> >> pwm5 0 0 0 24000000 0 0 50000
> >> i2c4 0 0 0 24000000 0 0 50000
> >> pwm8 0 0 0 24000000 0 0 50000
> >> pwm4 0 0 0 24000000 0 0 50000
> >> pwm3 0 0 0 24000000 0 0 50000
> >> pwm2 0 0 0 24000000 0 0 50000
> >> pwm1 0 0 0 24000000 0 0 50000
> >> i2c3 0 0 0 24000000 0 0 50000
> >> i2c2 1 1 0 24000000 0 0 50000
> >> i2c1 0 0 0 24000000 0 0 50000
> >> gpt1_serial 1 1 0 24000000 0 0 50000
> >> gpt1_bus 1 1 0 24000000 0 0 50000
> >> epit2 0 0 0 24000000 0 0 50000
> >> epit1 0 0 0 24000000 0 0 50000
> >> gpt2_serial 0 0 0 24000000 0 0 50000
> >> gpt2_bus 0 0 0 24000000 0 0 50000
> >> periph_clk2_sel 0 0 0 24000000 0 0 50000
> >> periph_clk2 0 0 0 24000000 0 0 50000
> >> gpt_3m 0 0 0 3000000 0 0 50000
> >> csi_sel 0 0 0 24000000 0 0 50000
> >> csi_podf 0 0 0 24000000 0 0 50000
> >> csi 0 0 0 24000000 0 0 50000
> >> pll7 1 1 0 480000000 0 0 50000
> >> pll7_bypass 1 1 0 480000000 0 0 50000
> >> pll7_usb_host 1 1 0 480000000 0 0 50000
> >> usbphy2 1 1 0 480000000 0 0 50000
> >> pll6 1 1 0 500000000 0 0 50000
> >> pll6_bypass 1 1 0 500000000 0 0 50000
> >> pll6_enet 2 2 0 500000000 0 0 50000
> >> enet_ptp_ref 1 1 0 25000000 0 0 50000
> >> enet_ptp 1 1 0 25000000 0 0 50000
> >> enet2_ref 0 0 0 50000000 0 0 50000
> >> enet_ref_125m 0 0 0 50000000 0 0 50000
> >> enet_ref 2 2 0 50000000 0 0 50000
> >> pll5 0 0 0 296600000 0 0 50000
> >> pll5_bypass 0 0 0 296600000 0 0 50000
> >> pll5_video 0 0 0 296600000 0 0 50000
> >> pll5_post_div 0 0 0 74150000 0 0 50000
> >> pll5_video_div 0 0 0 74150000 0 0 50000
> >> pll4 0 0 0 147456000 0 0 50000
> >> pll4_bypass 0 0 0 147456000 0 0 50000
> >> pll4_audio 0 0 0 147456000 0 0 50000
> >> pll4_post_div 0 0 0 36864000 0 0 50000
> >> pll4_audio_div 0 0 0 36864000 0 0 50000
> >> pll3 1 1 0 480000000 0 0 50000
> >> pll3_bypass 1 1 0 480000000 0 0 50000
> >> pll3_usb_otg 2 2 0 480000000 0 0 50000
> >> spdif_sel 0 0 0 480000000 0 0 50000
> >> spdif_pred 0 0 0 240000000 0 0 50000
> >> spdif_podf 0 0 0 30000000 0 0 50000
> >> spdif 0 0 0 30000000 0 0 50000
> >> esai_sel 0 0 0 480000000 0 0 50000
> >> esai_pred 0 0 0 240000000 0 0 50000
> >> esai_podf 0 0 0 30000000 0 0 50000
> >> esai_extal 0 0 0 30000000 0 0 50000
> >> qspi1_sel 0 0 0 480000000 0 0 50000
> >> qspi1_podf 0 0 0 240000000 0 0 50000
> >> qspi1 0 0 0 240000000 0 0 50000
> >> ldb_di1_div_7 0 0 0 68571428 0 0 50000
> >> ldb_di1 0 0 0 68571428 0 0 50000
> >> ldb_di1_div_3_5 0 0 0 137142857 0 0 50000
> >> periph2_clk2_sel 0 0 0 480000000 0 0 50000
> >> periph2_clk2 0 0 0 480000000 0 0 50000
> >> pll3_60m 0 0 0 60000000 0 0 50000
> >> can_sel 0 0 0 60000000 0 0 50000
> >> can_podf 0 0 0 30000000 0 0 50000
> >> can2_serial 0 0 0 30000000 0 0 50000
> >> can1_serial 0 0 0 30000000 0 0 50000
> >> ecspi_sel 0 0 0 60000000 0 0 50000
> >> ecspi_podf 0 0 0 60000000 0 0 50000
> >> ecspi4 0 0 0 60000000 0 0 50000
> >> ecspi3 0 0 0 60000000 0 0 50000
> >> ecspi2 0 0 0 60000000 0 0 50000
> >> ecspi1 0 0 0 60000000 0 0 50000
> >> pll3_80m 1 1 0 80000000 0 0 50000
> >> uart_sel 1 1 0 80000000 0 0 50000
> >> uart_podf 1 1 0 80000000 0 0 50000
> >> uart8_serial 0 0 0 80000000 0 0 50000
> >> uart7_serial 0 0 0 80000000 0 0 50000
> >> uart1_serial 1 2 0 80000000 0 0 50000
> >> uart6_serial 0 0 0 80000000 0 0 50000
> >> uart5_serial 0 0 0 80000000 0 0 50000
> >> uart4_serial 0 0 0 80000000 0 0 50000
> >> uart3_serial 0 0 0 80000000 0 0 50000
> >> uart2_serial 0 0 0 80000000 0 0 50000
> >> pll3_pfd3_454m 0 0 0 454736842 0 0 50000
> >> pll3_pfd2_508m 0 0 0 508235294 0 0 50000
> >> epdc_pre_sel 0 0 0 508235294 0 0 50000
> >> epdc_podf 0 0 0 254117647 0 0 50000
> >> epdc_pix 0 0 0 254117647 0 0 50000
> >> epdc_sel 0 0 0 254117647 0 0 50000
> >> sai1_sel 0 0 0 508235294 0 0 50000
> >> sai1_pred 0 0 0 127058824 0 0 50000
> >> sai1_podf 0 0 0 63529412 0 0 50000
> >> sai1 0 0 0 63529412 0 0 50000
> >> sai2_sel 0 0 0 508235294 0 0 50000
> >> sai2_pred 0 0 0 127058824 0 0 50000
> >> sai2_podf 0 0 0 63529412 0 0 50000
> >> sai2 0 0 0 63529412 0 0 50000
> >> sai3_sel 0 0 0 508235294 0 0 50000
> >> sai3_pred 0 0 0 127058824 0 0 50000
> >> sai3_podf 0 0 0 63529412 0 0 50000
> >> sai3 0 0 0 63529412 0 0 50000
> >> pll3_pfd1_540m 0 0 0 540000000 0 0 50000
> >> lcdif_pre_sel 0 0 0 540000000 0 0 50000
> >> lcdif_pred 0 0 0 270000000 0 0 50000
> >> lcdif_podf 0 0 0 135000000 0 0 50000
> >> lcdif_pix 0 0 0 135000000 0 0 50000
> >> iomuxc 0 0 0 135000000 0 0 50000
> >> lcdif_sel 0 0 0 135000000 0 0 50000
> >> pll3_pfd0_720m 0 0 0 720000000 0 0 50000
> >> usbphy1 1 1 0 480000000 0 0 50000
> >> pll2 1 1 0 528000000 0 0 50000
> >> pll2_bypass 1 1 0 528000000 0 0 50000
> >> pll2_bus 2 2 0 528000000 0 0 50000
> >> ca7_secondary_sel 0 0 0 528000000 0 0 50000
> >> step 0 0 0 528000000 0 0 50000
> >> periph_pre 1 1 0 528000000 0 0 50000
> >> periph 3 3 0 528000000 0 0 50000
> >> ahb 7 7 0 132000000 0 0 50000
> >> sdma 0 0 0 132000000 0 0 50000
> >> rom 1 1 0 132000000 0 0 50000
> >> esai_mem 0 0 0 132000000 0 0 50000
> >> esai_ipg 0 0 0 132000000 0 0 50000
> >> aips_tz3 1 1 0 132000000 0 0 50000
> >> enet_ahb 2 2 0 132000000 0 0 50000
> >> dcp 0 0 0 132000000 0 0 50000
> >> asrc_mem 0 0 0 132000000 0 0 50000
> >> asrc_ipg 0 0 0 132000000 0 0 50000
> >> aips_tz2 1 1 0 132000000 0 0 50000
> >> aips_tz1 1 1 0 132000000 0 0 50000
> >> ipg 10 10 0 66000000 0 0 50000
> >> wdog3 0 0 0 66000000 0 0 50000
> >> uart8_ipg 0 0 0 66000000 0 0 50000
> >> usboh3 2 2 0 66000000 0 0 50000
> >> sai2_ipg 0 0 0 66000000 0 0 50000
> >> sai1_ipg 0 0 0 66000000 0 0 50000
> >> uart7_ipg 0 0 0 66000000 0 0 50000
> >> uart1_ipg 1 2 0 66000000 0 0 50000
> >> sai3_ipg 0 0 0 66000000 0 0 50000
> >> spdif_gclk 0 0 0 66000000 0 0 50000
> >> spba 0 0 0 66000000 0 0 50000
> >> wdog2 0 0 0 66000000 0 0 50000
> >> kpp 0 0 0 66000000 0 0 50000
> >> mmdc_p1_ipg 0 0 0 66000000 0 0 50000
> >> mmdc_p0_ipg 2 2 0 66000000 0 0 50000
> >> wdog1 1 1 0 66000000 0 0 50000
> >> gpio4 1 1 0 66000000 0 0 50000
> >> uart6_ipg 0 0 0 66000000 0 0 50000
> >> uart5_ipg 0 0 0 66000000 0 0 50000
> >> gpio3 1 1 0 66000000 0 0 50000
> >> ocotp 0 0 0 66000000 0 0 50000
> >> gpio5 1 1 0 66000000 0 0 50000
> >> gpio1 1 1 0 66000000 0 0 50000
> >> uart4_ipg 0 0 0 66000000 0 0 50000
> >> adc1 0 0 0 66000000 0 0 50000
> >> uart3_ipg 0 0 0 66000000 0 0 50000
> >> adc2 0 0 0 66000000 0 0 50000
> >> gpio2 1 1 0 66000000 0 0 50000
> >> uart2_ipg 0 0 0 66000000 0 0 50000
> >> can2_ipg 0 0 0 66000000 0 0 50000
> >> can1_ipg 0 0 0 66000000 0 0 50000
> >> enet 2 2 0 66000000 0 0 50000
> >> axi_sel 1 1 0 528000000 0 0 50000
> >> axi_podf 2 2 0 264000000 0 0 50000
> >> axi 1 1 0 264000000 0 0 50000
> >> eim_slow_sel 0 0 0 264000000 0 0 50000
> >> eim_slow_podf 0 0 0 132000000 0 0 50000
> >> eim 0 0 0 132000000 0 0 50000
> >> lcdif_apb 0 0 0 264000000 0 0 50000
> >> pxp 0 0 0 264000000 0 0 50000
> >> epdc_aclk 0 0 0 264000000 0 0 50000
> >> pll2_pfd3_594m 0 0 0 594000000 0 0 50000
> >> ldb_di0_sel 0 0 0 594000000 0 0 50000
> >> ldb_di0_div_7 0 0 0 84857142 0 0 50000
> >> ldb_di0 0 0 0 84857142 0 0 50000
> >> ldb_di0_div_3_5 0 0 0 169714285 0 0 50000
> >> pll2_pfd2_396m 2 2 0 396000000 0 0 50000
> >> enfc_sel 0 0 0 396000000 0 0 50000
> >> enfc_pred 0 0 0 99000000 0 0 50000
> >> enfc_podf 0 0 0 99000000 0 0 50000
> >> gpmi_io 0 0 0 99000000 0 0 50000
> >> usdhc1_sel 0 0 0 396000000 0 0 50000
> >> usdhc1_podf 0 0 0 198000000 0 0 50000
> >> usdhc1 0 0 0 198000000 0 0 50000
> >> usdhc2_sel 0 0 0 396000000 0 0 50000
> >> usdhc2_podf 0 0 0 198000000 0 0 50000
> >> usdhc2 0 0 0 198000000 0 0 50000
> >> bch_sel 1 1 0 396000000 0 0 50000
> >> bch_podf 1 1 0 99000000 0 0 50000
> >> gpmi_apb 0 0 0 99000000 0 0 50000
> >> gpmi_bch_apb 0 0 0 99000000 0 0 50000
> >> per_bch 0 0 0 99000000 0 0 50000
> >> apbh_dma 1 1 0 99000000 0 0 50000
> >> gpmi_sel 0 0 0 396000000 0 0 50000
> >> gpmi_podf 0 0 0 99000000 0 0 50000
> >> gpmi_bch 0 0 0 99000000 0 0 50000
> >> periph2_pre 1 1 0 396000000 0 0 50000
> >> periph2 2 2 0 396000000 0 0 50000
> >> mmdc_podf 2 2 0 396000000 0 0 50000
> >> mmdc_p0_fast 1 1 0 396000000 0 0 50000
> >> axi_alt_sel 0 0 0 396000000 0 0 50000
> >> pll2_198m 0 0 0 198000000 0 0 50000
> >> pll2_pfd1_594m 0 0 0 594000000 0 0 50000
> >> pll2_pfd0_352m 0 0 0 352000000 0 0 50000
> >> pll1 1 1 0 900000000 0 0 50000
> >> pll1_bypass 1 1 0 900000000 0 0 50000
> >> pll1_sys 1 1 0 900000000 0 0 50000
> >> pll1_sw 1 1 0 900000000 0 0 50000
> >> arm 1 1 0 900000000 0 0 50000
> >> pll7_bypass_src 0 0 0 24000000 0 0 50000
> >> pll6_bypass_src 0 0 0 24000000 0 0 50000
> >> pll5_bypass_src 0 0 0 24000000 0 0 50000
> >> pll4_bypass_src 0 0 0 24000000 0 0 50000
> >> pll3_bypass_src 0 0 0 24000000 0 0 50000
> >> pll2_bypass_src 0 0 0 24000000 0 0 50000
> >> pll1_bypass_src 0 0 0 24000000 0 0 50000
> >> ckil 0 0 0 32768 0 0 50000
> >>
> >>
> >> Note that this was generated on a normal boot up (not failure).
> >
> > The values looks good. Can you try with the below diff applied?
> > --->8---
> > diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> > index 334fe3130285..9771f6a82abe 100644
> > --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> > +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> > @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
> >
> > /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> > - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> > - if (!dll_wait_time_us)
> > - dll_wait_time_us = 1;
> > + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
> >
> > /* Wait for the DLL to settle. */
> > - udelay(dll_wait_time_us);
> > + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> > }
> >
> > static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>
> Eventually it failed, in the same way with with same errors.
> Took quite a while, over 600 boot cycles.
>
> Note also that I had to hand merge the changes, since in 5.1.14 that
> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
Oh well. I guess the next thing to do would be to dump the timing regs
and clk rate that are set by the bootloader (before the driver override
them) or those applied by an older kernel (one that didn't have that
issue).
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-02 12:51 ` Boris Brezillon
@ 2019-08-05 5:51 ` Greg Ungerer
2019-08-07 16:05 ` Miquel Raynal
2019-08-08 16:36 ` Boris Brezillon
0 siblings, 2 replies; 50+ messages in thread
From: Greg Ungerer @ 2019-08-05 5:51 UTC (permalink / raw)
To: Boris Brezillon
Cc: s.hauer, Boris Brezillon, linux-mtd, Michael Nazzareno Trimarchi,
Miquel Raynal
[-- Attachment #1: Type: text/plain, Size: 3937 bytes --]
Hi Boris,
On 2/8/19 10:51 pm, Boris Brezillon wrote:
> On Fri, 2 Aug 2019 22:34:57 +1000
> Greg Ungerer <gerg@kernel.org> wrote:
>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
>>> On Wed, 31 Jul 2019 12:05:44 +1000
>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>>>> [snip]
>>>> Note that this was generated on a normal boot up (not failure).
>>>
>>> The values looks good. Can you try with the below diff applied?
>>> --->8---
>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>> index 334fe3130285..9771f6a82abe 100644
>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>>>
>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
>>> - if (!dll_wait_time_us)
>>> - dll_wait_time_us = 1;
>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>>>
>>> /* Wait for the DLL to settle. */
>>> - udelay(dll_wait_time_us);
>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
>>> }
>>>
>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>>
>> Eventually it failed, in the same way with with same errors.
>> Took quite a while, over 600 boot cycles.
>>
>> Note also that I had to hand merge the changes, since in 5.1.14 that
>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
>
> Oh well. I guess the next thing to do would be to dump the timing regs
> and clk rate that are set by the bootloader (before the driver override
> them) or those applied by an older kernel (one that didn't have that
> issue).
Is this useful?
With attached patch, I get the following dump of the timing
settings in use:
...
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
HW_GPMI_TIMING1=0x00000000 (calculated=0x60000000)
HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
r->clock[0]=22000000 (calculated=22000000)
random: fast init done
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
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
HW_GPMI_TIMING1=0x00000000 (calculated=0xb0000000)
HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
r->clock[0]=22000000 (calculated=22000000)
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
HW_GPMI_TIMING0=0x00010203 (calculated=0x00010101)
HW_GPMI_TIMING1=0x00000000 (calculated=0xe0000000)
HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00c28000)
r->clock[0]=22000000 (calculated=100000000)
Scanning device for bad blocks
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.
...
Regards
Greg
[-- Attachment #2: gpmi-nand-default-timing.patch --]
[-- Type: text/x-patch, Size: 1042 bytes --]
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c 2019-03-06 15:47:24.310993476 +1000
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c 2019-08-05 15:04:49.241345883 +1000
@@ -486,6 +486,14 @@
void __iomem *gpmi_regs = r->gpmi_regs;
unsigned int dll_wait_time_us;
+#if 1
+ printk("%s(%d): gpmi_nfc_apply_timings()\n", __FILE__, __LINE__);
+ printk(" HW_GPMI_TIMING0=0x%08x (calculated=0x%08x)\n", readl(gpmi_regs + HW_GPMI_TIMING0), hw->timing0);
+ printk(" HW_GPMI_TIMING1=0x%08x (calculated=0x%08x)\n", readl(gpmi_regs + HW_GPMI_TIMING1), hw->timing1);
+ printk(" HW_GPMI_CTRL1_SET=0x%08x (calculated=0x%08x)\n", readl(gpmi_regs + HW_GPMI_CTRL1_SET), hw->ctrl1n);
+ printk(" r->clock[0]=%d (calculated=%d)\n", clk_get_rate(r->clock[0]), hw->clk_rate);
+#endif
+#if 0
clk_set_rate(r->clock[0], hw->clk_rate);
writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
@@ -505,6 +513,7 @@
/* Wait for the DLL to settle. */
udelay(dll_wait_time_us);
+#endif
}
int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
[-- Attachment #3: Type: text/plain, Size: 144 bytes --]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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
1 sibling, 1 reply; 50+ messages in thread
From: Miquel Raynal @ 2019-08-07 16:05 UTC (permalink / raw)
To: Greg Ungerer
Cc: s.hauer, Boris Brezillon, linux-mtd, Michael Nazzareno Trimarchi,
Boris Brezillon
Hi Greg,
Greg Ungerer <gerg@kernel.org> wrote on Mon, 5 Aug 2019 15:51:05 +1000:
> Hi Boris,
>
> On 2/8/19 10:51 pm, Boris Brezillon wrote:
> > On Fri, 2 Aug 2019 22:34:57 +1000
> > Greg Ungerer <gerg@kernel.org> wrote:
> >> On 31/7/19 4:28 pm, Boris Brezillon wrote:
> >>> On Wed, 31 Jul 2019 12:05:44 +1000
> >>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> >>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>>>>>> [snip]
> >>>> Note that this was generated on a normal boot up (not failure).
> >>>
> >>> The values looks good. Can you try with the below diff applied?
> >>> --->8---
> >>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>> index 334fe3130285..9771f6a82abe 100644
> >>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> >>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
> >>> >>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> >>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> >>> - if (!dll_wait_time_us)
> >>> - dll_wait_time_us = 1;
> >>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
> >>> >>> /* Wait for the DLL to settle. */
> >>> - udelay(dll_wait_time_us);
> >>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> >>> }
> >>> >>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>
> >> Eventually it failed, in the same way with with same errors.
> >> Took quite a while, over 600 boot cycles.
> >>
> >> Note also that I had to hand merge the changes, since in 5.1.14 that
> >> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
> >
> > Oh well. I guess the next thing to do would be to dump the timing regs
> > and clk rate that are set by the bootloader (before the driver override
> > them) or those applied by an older kernel (one that didn't have that
> > issue).
>
> Is this useful?
>
> With attached patch, I get the following dump of the timing
> settings in use:
>
> ...
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
> HW_GPMI_TIMING1=0x00000000 (calculated=0x60000000)
> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
> r->clock[0]=22000000 (calculated=22000000)
> random: fast init done
> 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
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
> HW_GPMI_TIMING1=0x00000000 (calculated=0xb0000000)
> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
> r->clock[0]=22000000 (calculated=22000000)
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010203 (calculated=0x00010101)
> HW_GPMI_TIMING1=0x00000000 (calculated=0xe0000000)
> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00c28000)
> r->clock[0]=22000000 (calculated=100000000)
Why are the registers not updated? Is it the same situation when we
get all the failures?
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-07 16:05 ` Miquel Raynal
@ 2019-08-08 0:43 ` Greg Ungerer
0 siblings, 0 replies; 50+ messages in thread
From: Greg Ungerer @ 2019-08-08 0:43 UTC (permalink / raw)
To: Miquel Raynal
Cc: s.hauer, Boris Brezillon, linux-mtd, Michael Nazzareno Trimarchi,
Boris Brezillon
Hi Miquel,
On 8/8/19 2:05 am, Miquel Raynal wrote:
> Greg Ungerer <gerg@kernel.org> wrote on Mon, 5 Aug 2019 15:51:05 +1000:
>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
>>> On Fri, 2 Aug 2019 22:34:57 +1000
>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>>>>>> [snip]
>>>>>> Note that this was generated on a normal boot up (not failure).
>>>>>
>>>>> The values looks good. Can you try with the below diff applied?
>>>>> --->8---
>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>> index 334fe3130285..9771f6a82abe 100644
>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>>>>> >>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
>>>>> - if (!dll_wait_time_us)
>>>>> - dll_wait_time_us = 1;
>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>>>>> >>> /* Wait for the DLL to settle. */
>>>>> - udelay(dll_wait_time_us);
>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
>>>>> }
>>>>> >>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>>>>
>>>> Eventually it failed, in the same way with with same errors.
>>>> Took quite a while, over 600 boot cycles.
>>>>
>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
>>>
>>> Oh well. I guess the next thing to do would be to dump the timing regs
>>> and clk rate that are set by the bootloader (before the driver override
>>> them) or those applied by an older kernel (one that didn't have that
>>> issue).
>>
>> Is this useful?
>>
>> With attached patch, I get the following dump of the timing
>> settings in use:
>>
>> ...
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
>> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
>> HW_GPMI_TIMING1=0x00000000 (calculated=0x60000000)
>> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
>> r->clock[0]=22000000 (calculated=22000000)
>> random: fast init done
>> 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
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
>> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
>> HW_GPMI_TIMING1=0x00000000 (calculated=0xb0000000)
>> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
>> r->clock[0]=22000000 (calculated=22000000)
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
>> HW_GPMI_TIMING0=0x00010203 (calculated=0x00010101)
>> HW_GPMI_TIMING1=0x00000000 (calculated=0xe0000000)
>> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00c28000)
>> r->clock[0]=22000000 (calculated=100000000)
>
> Why are the registers not updated? Is it the same situation when we
> get all the failures?
As per the patch that was attached to that email. The setting of the
registers and clock was "#if 0" out so you could see what the
power-up/boot-loader settings are. Those settings work reliably
with no nand failures. In between running various tests I have
left my hardware boot cycle testing with those settings. I don't
have an exact number but it has probably run at least 100 hours
and tens of thousands of boots with no problem using those.
Or am I misunderstanding your question?
Regards
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-05 5:51 ` Greg Ungerer
2019-08-07 16:05 ` Miquel Raynal
@ 2019-08-08 16:36 ` Boris Brezillon
2019-08-09 5:20 ` Greg Ungerer
1 sibling, 1 reply; 50+ messages in thread
From: Boris Brezillon @ 2019-08-08 16:36 UTC (permalink / raw)
To: Greg Ungerer
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
On Mon, 5 Aug 2019 15:51:05 +1000
Greg Ungerer <gerg@kernel.org> wrote:
> Hi Boris,
>
> On 2/8/19 10:51 pm, Boris Brezillon wrote:
> > On Fri, 2 Aug 2019 22:34:57 +1000
> > Greg Ungerer <gerg@kernel.org> wrote:
> >> On 31/7/19 4:28 pm, Boris Brezillon wrote:
> >>> On Wed, 31 Jul 2019 12:05:44 +1000
> >>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> >>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>>>>>> [snip]
> >>>> Note that this was generated on a normal boot up (not failure).
> >>>
> >>> The values looks good. Can you try with the below diff applied?
> >>> --->8---
> >>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>> index 334fe3130285..9771f6a82abe 100644
> >>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> >>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
> >>>
> >>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> >>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> >>> - if (!dll_wait_time_us)
> >>> - dll_wait_time_us = 1;
> >>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
> >>>
> >>> /* Wait for the DLL to settle. */
> >>> - udelay(dll_wait_time_us);
> >>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> >>> }
> >>>
> >>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>
> >> Eventually it failed, in the same way with with same errors.
> >> Took quite a while, over 600 boot cycles.
> >>
> >> Note also that I had to hand merge the changes, since in 5.1.14 that
> >> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
> >
> > Oh well. I guess the next thing to do would be to dump the timing regs
> > and clk rate that are set by the bootloader (before the driver override
> > them) or those applied by an older kernel (one that didn't have that
> > issue).
>
> Is this useful?
Hm, looks like it's configured in mode 0, so no, it's not super useful.
Can you try booting an older kernel (one that didn't have the
->setup_data_interface() hook implemented).
>
> With attached patch, I get the following dump of the timing
> settings in use:
>
> ...
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
> HW_GPMI_TIMING1=0x00000000 (calculated=0x60000000)
> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
> r->clock[0]=22000000 (calculated=22000000)
> random: fast init done
> 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
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
> HW_GPMI_TIMING1=0x00000000 (calculated=0xb0000000)
> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
> r->clock[0]=22000000 (calculated=22000000)
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010203 (calculated=0x00010101)
> HW_GPMI_TIMING1=0x00000000 (calculated=0xe0000000)
> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00c28000)
> r->clock[0]=22000000 (calculated=100000000)
> Scanning device for bad blocks
> 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.
> ...
>
> Regards
> Greg
>
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-08 16:36 ` Boris Brezillon
@ 2019-08-09 5:20 ` Greg Ungerer
2019-08-09 6:23 ` Boris Brezillon
0 siblings, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-08-09 5:20 UTC (permalink / raw)
To: Boris Brezillon
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
Hi Boris,
On 9/8/19 2:36 am, Boris Brezillon wrote:
> On Mon, 5 Aug 2019 15:51:05 +1000
> Greg Ungerer <gerg@kernel.org> wrote:
>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
>>> On Fri, 2 Aug 2019 22:34:57 +1000
>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>>>>>> [snip]
>>>>>> Note that this was generated on a normal boot up (not failure).
>>>>>
>>>>> The values looks good. Can you try with the below diff applied?
>>>>> --->8---
>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>> index 334fe3130285..9771f6a82abe 100644
>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>>>>>
>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
>>>>> - if (!dll_wait_time_us)
>>>>> - dll_wait_time_us = 1;
>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>>>>>
>>>>> /* Wait for the DLL to settle. */
>>>>> - udelay(dll_wait_time_us);
>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
>>>>> }
>>>>>
>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>>>>
>>>> Eventually it failed, in the same way with with same errors.
>>>> Took quite a while, over 600 boot cycles.
>>>>
>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
>>>
>>> Oh well. I guess the next thing to do would be to dump the timing regs
>>> and clk rate that are set by the bootloader (before the driver override
>>> them) or those applied by an older kernel (one that didn't have that
>>> issue).
>>
>> Is this useful?
>
> Hm, looks like it's configured in mode 0, so no, it's not super useful.
> Can you try booting an older kernel (one that didn't have the
> ->setup_data_interface() hook implemented).
Ok. I went back from 5.1 and the first kernel I could find that
returned no grep hits for "setup_data_interface" was 4.16.
So I built for my target with that and added similar trace to dump
the hardware register settings for that. Debug output looks like
this now for it:
...
drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
clk_get_rate(r->clock[0])=22000000
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
HW_GPMI_TIMING0=0x00010203
HW_GPMI_TIMING1=0x05000000
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
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
clk_get_rate(r->clock[0])=99000000
gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
HW_GPMI_TIMING0=0x00010101
HW_GPMI_TIMING1=0x90000000
Scanning device for bad blocks
5 ofpart 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.
...
I am running boot tests now on this to confirm it actually runs
reliably.
Regards
Greg
>> With attached patch, I get the following dump of the timing
>> settings in use:
>>
>> ...
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
>> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
>> HW_GPMI_TIMING1=0x00000000 (calculated=0x60000000)
>> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
>> r->clock[0]=22000000 (calculated=22000000)
>> random: fast init done
>> 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
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
>> HW_GPMI_TIMING0=0x00010203 (calculated=0x00020101)
>> HW_GPMI_TIMING1=0x00000000 (calculated=0xb0000000)
>> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00000000)
>> r->clock[0]=22000000 (calculated=22000000)
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(490): gpmi_nfc_apply_timings()
>> HW_GPMI_TIMING0=0x00010203 (calculated=0x00010101)
>> HW_GPMI_TIMING1=0x00000000 (calculated=0xe0000000)
>> HW_GPMI_CTRL1_SET=0x01c4000c (calculated=0x00c28000)
>> r->clock[0]=22000000 (calculated=100000000)
>> Scanning device for bad blocks
>> 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.
>> ...
>>
>> Regards
>> Greg
>>
>>
>
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-09 5:20 ` Greg Ungerer
@ 2019-08-09 6:23 ` Boris Brezillon
2019-08-09 6:55 ` Greg Ungerer
0 siblings, 1 reply; 50+ messages in thread
From: Boris Brezillon @ 2019-08-09 6:23 UTC (permalink / raw)
To: Greg Ungerer
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
On Fri, 9 Aug 2019 15:20:52 +1000
Greg Ungerer <gerg@kernel.org> wrote:
> Hi Boris,
>
> On 9/8/19 2:36 am, Boris Brezillon wrote:
> > On Mon, 5 Aug 2019 15:51:05 +1000
> > Greg Ungerer <gerg@kernel.org> wrote:
> >> On 2/8/19 10:51 pm, Boris Brezillon wrote:
> >>> On Fri, 2 Aug 2019 22:34:57 +1000
> >>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
> >>>>> On Wed, 31 Jul 2019 12:05:44 +1000
> >>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> >>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>>>>>>>> [snip]
> >>>>>> Note that this was generated on a normal boot up (not failure).
> >>>>>
> >>>>> The values looks good. Can you try with the below diff applied?
> >>>>> --->8---
> >>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>> index 334fe3130285..9771f6a82abe 100644
> >>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> >>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
> >>>>>
> >>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> >>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> >>>>> - if (!dll_wait_time_us)
> >>>>> - dll_wait_time_us = 1;
> >>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
> >>>>>
> >>>>> /* Wait for the DLL to settle. */
> >>>>> - udelay(dll_wait_time_us);
> >>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> >>>>> }
> >>>>>
> >>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>>>
> >>>> Eventually it failed, in the same way with with same errors.
> >>>> Took quite a while, over 600 boot cycles.
> >>>>
> >>>> Note also that I had to hand merge the changes, since in 5.1.14 that
> >>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
> >>>
> >>> Oh well. I guess the next thing to do would be to dump the timing regs
> >>> and clk rate that are set by the bootloader (before the driver override
> >>> them) or those applied by an older kernel (one that didn't have that
> >>> issue).
> >>
> >> Is this useful?
> >
> > Hm, looks like it's configured in mode 0, so no, it's not super useful.
> > Can you try booting an older kernel (one that didn't have the
> > ->setup_data_interface() hook implemented).
>
> Ok. I went back from 5.1 and the first kernel I could find that
> returned no grep hits for "setup_data_interface" was 4.16.
>
> So I built for my target with that and added similar trace to dump
> the hardware register settings for that. Debug output looks like
> this now for it:
>
> ...
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
> clk_get_rate(r->clock[0])=22000000
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> HW_GPMI_TIMING0=0x00010203
> HW_GPMI_TIMING1=0x05000000
> 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
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
> clk_get_rate(r->clock[0])=99000000
> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> HW_GPMI_TIMING0=0x00010101
TIMING0 match the one you have with 5.1 kernels.
> HW_GPMI_TIMING1=0x90000000
And we even have a bigger timeout value in 5.1 (0xe0000000), so we
should be all safe WRT to timings in TIMING{0,1}.
Can you dump CTRL1?
> Scanning device for bad blocks
> 5 ofpart 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.
> ...
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-09 6:23 ` Boris Brezillon
@ 2019-08-09 6:55 ` Greg Ungerer
2019-08-09 7:32 ` Boris Brezillon
0 siblings, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-08-09 6:55 UTC (permalink / raw)
To: Boris Brezillon
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
On 9/8/19 4:23 pm, Boris Brezillon wrote:
> On Fri, 9 Aug 2019 15:20:52 +1000
> Greg Ungerer <gerg@kernel.org> wrote:
>> On 9/8/19 2:36 am, Boris Brezillon wrote:
>>> On Mon, 5 Aug 2019 15:51:05 +1000
>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
>>>>> On Fri, 2 Aug 2019 22:34:57 +1000
>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
>>>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>>>>>>>> [snip]
>>>>>>>> Note that this was generated on a normal boot up (not failure).
>>>>>>>
>>>>>>> The values looks good. Can you try with the below diff applied?
>>>>>>> --->8---
>>>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>> index 334fe3130285..9771f6a82abe 100644
>>>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
>>>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>>>>>>>
>>>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
>>>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
>>>>>>> - if (!dll_wait_time_us)
>>>>>>> - dll_wait_time_us = 1;
>>>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>>>>>>>
>>>>>>> /* Wait for the DLL to settle. */
>>>>>>> - udelay(dll_wait_time_us);
>>>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
>>>>>>> }
>>>>>>>
>>>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>>>>>>
>>>>>> Eventually it failed, in the same way with with same errors.
>>>>>> Took quite a while, over 600 boot cycles.
>>>>>>
>>>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
>>>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
>>>>>
>>>>> Oh well. I guess the next thing to do would be to dump the timing regs
>>>>> and clk rate that are set by the bootloader (before the driver override
>>>>> them) or those applied by an older kernel (one that didn't have that
>>>>> issue).
>>>>
>>>> Is this useful?
>>>
>>> Hm, looks like it's configured in mode 0, so no, it's not super useful.
>>> Can you try booting an older kernel (one that didn't have the
>>> ->setup_data_interface() hook implemented).
>>
>> Ok. I went back from 5.1 and the first kernel I could find that
>> returned no grep hits for "setup_data_interface" was 4.16.
>>
>> So I built for my target with that and added similar trace to dump
>> the hardware register settings for that. Debug output looks like
>> this now for it:
>>
>> ...
>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
>> clk_get_rate(r->clock[0])=22000000
>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>> HW_GPMI_TIMING0=0x00010203
>> HW_GPMI_TIMING1=0x05000000
>> 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
>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
>> clk_get_rate(r->clock[0])=99000000
>> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>> HW_GPMI_TIMING0=0x00010101
>
> TIMING0 match the one you have with 5.1 kernels.
>
>> HW_GPMI_TIMING1=0x90000000
>
> And we even have a bigger timeout value in 5.1 (0xe0000000), so we
> should be all safe WRT to timings in TIMING{0,1}.
>
> Can you dump CTRL1?
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
HW_GPMI_TIMING0=0x00010101
HW_GPMI_TIMING1=0x90000000
HW_GPMI_CTRL1_SET=0x01c4800c
Scanning device for bad blocks
5 ofpart 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.
Regards
Greg
>> Scanning device for bad blocks
>> 5 ofpart 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.
>> ...
>>
>
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-09 6:55 ` Greg Ungerer
@ 2019-08-09 7:32 ` Boris Brezillon
2019-08-09 13:57 ` Greg Ungerer
0 siblings, 1 reply; 50+ messages in thread
From: Boris Brezillon @ 2019-08-09 7:32 UTC (permalink / raw)
To: Greg Ungerer
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
On Fri, 9 Aug 2019 16:55:22 +1000
Greg Ungerer <gerg@kernel.org> wrote:
> On 9/8/19 4:23 pm, Boris Brezillon wrote:
> > On Fri, 9 Aug 2019 15:20:52 +1000
> > Greg Ungerer <gerg@kernel.org> wrote:
> >> On 9/8/19 2:36 am, Boris Brezillon wrote:
> >>> On Mon, 5 Aug 2019 15:51:05 +1000
> >>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
> >>>>> On Fri, 2 Aug 2019 22:34:57 +1000
> >>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
> >>>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
> >>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> >>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >>>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>>>>>>>>>> [snip]
> >>>>>>>> Note that this was generated on a normal boot up (not failure).
> >>>>>>>
> >>>>>>> The values looks good. Can you try with the below diff applied?
> >>>>>>> --->8---
> >>>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>> index 334fe3130285..9771f6a82abe 100644
> >>>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> >>>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
> >>>>>>>
> >>>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> >>>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> >>>>>>> - if (!dll_wait_time_us)
> >>>>>>> - dll_wait_time_us = 1;
> >>>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
> >>>>>>>
> >>>>>>> /* Wait for the DLL to settle. */
> >>>>>>> - udelay(dll_wait_time_us);
> >>>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> >>>>>>> }
> >>>>>>>
> >>>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>>>>>
> >>>>>> Eventually it failed, in the same way with with same errors.
> >>>>>> Took quite a while, over 600 boot cycles.
> >>>>>>
> >>>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
> >>>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
> >>>>>
> >>>>> Oh well. I guess the next thing to do would be to dump the timing regs
> >>>>> and clk rate that are set by the bootloader (before the driver override
> >>>>> them) or those applied by an older kernel (one that didn't have that
> >>>>> issue).
> >>>>
> >>>> Is this useful?
> >>>
> >>> Hm, looks like it's configured in mode 0, so no, it's not super useful.
> >>> Can you try booting an older kernel (one that didn't have the
> >>> ->setup_data_interface() hook implemented).
> >>
> >> Ok. I went back from 5.1 and the first kernel I could find that
> >> returned no grep hits for "setup_data_interface" was 4.16.
> >>
> >> So I built for my target with that and added similar trace to dump
> >> the hardware register settings for that. Debug output looks like
> >> this now for it:
> >>
> >> ...
> >> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
> >> clk_get_rate(r->clock[0])=22000000
> >> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >> HW_GPMI_TIMING0=0x00010203
> >> HW_GPMI_TIMING1=0x05000000
> >> 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
> >> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
> >> clk_get_rate(r->clock[0])=99000000
> >> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
> >> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >> HW_GPMI_TIMING0=0x00010101
> >
> > TIMING0 match the one you have with 5.1 kernels.
> >
> >> HW_GPMI_TIMING1=0x90000000
> >
> > And we even have a bigger timeout value in 5.1 (0xe0000000), so we
> > should be all safe WRT to timings in TIMING{0,1}.
> >
> > Can you dump CTRL1?
>
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> HW_GPMI_TIMING0=0x00010101
> HW_GPMI_TIMING1=0x90000000
> HW_GPMI_CTRL1_SET=0x01c4800c
The read/write delay fields seem to match, but there are a few more
fields set in this version:
- DECOUPLE_CS
- BCH_MODE
- DEV_RESET
- CTRL1_ATA_IRQRDY_POLARITY__ACTIVEHIGH
Looks like those fields are not explicitly set in the gpmi_begin()
patch, but maybe you dumped CTRL1. Would you mind sharing your patch?
If I'm right and you indeed dumped CTRL1, it might be worth doing the
same in your 5.1 kernel so we can more easily compare those dumps.
While at it, can you dump CTRL1 before and after applying the changes?
> Scanning device for bad blocks
> 5 ofpart 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.
>
> Regards
> Greg
>
>
> >> Scanning device for bad blocks
> >> 5 ofpart 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.
> >> ...
> >>
> >
> >
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-09 7:32 ` Boris Brezillon
@ 2019-08-09 13:57 ` Greg Ungerer
2019-08-09 13:59 ` Boris Brezillon
0 siblings, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-08-09 13:57 UTC (permalink / raw)
To: Boris Brezillon
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
[-- Attachment #1: Type: text/plain, Size: 5440 bytes --]
Hi Boris,
On 9/8/19 5:32 pm, Boris Brezillon wrote:
> On Fri, 9 Aug 2019 16:55:22 +1000
> Greg Ungerer <gerg@kernel.org> wrote:
>> On 9/8/19 4:23 pm, Boris Brezillon wrote:
>>> On Fri, 9 Aug 2019 15:20:52 +1000
>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>> On 9/8/19 2:36 am, Boris Brezillon wrote:
>>>>> On Mon, 5 Aug 2019 15:51:05 +1000
>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
>>>>>>> On Fri, 2 Aug 2019 22:34:57 +1000
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
>>>>>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>>>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>>>>>>>>>> [snip]
>>>>>>>>>> Note that this was generated on a normal boot up (not failure).
>>>>>>>>>
>>>>>>>>> The values looks good. Can you try with the below diff applied?
>>>>>>>>> --->8---
>>>>>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>> index 334fe3130285..9771f6a82abe 100644
>>>>>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
>>>>>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>>>>>>>>>
>>>>>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
>>>>>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
>>>>>>>>> - if (!dll_wait_time_us)
>>>>>>>>> - dll_wait_time_us = 1;
>>>>>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>>>>>>>>>
>>>>>>>>> /* Wait for the DLL to settle. */
>>>>>>>>> - udelay(dll_wait_time_us);
>>>>>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>>>>>>>>
>>>>>>>> Eventually it failed, in the same way with with same errors.
>>>>>>>> Took quite a while, over 600 boot cycles.
>>>>>>>>
>>>>>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
>>>>>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
>>>>>>>
>>>>>>> Oh well. I guess the next thing to do would be to dump the timing regs
>>>>>>> and clk rate that are set by the bootloader (before the driver override
>>>>>>> them) or those applied by an older kernel (one that didn't have that
>>>>>>> issue).
>>>>>>
>>>>>> Is this useful?
>>>>>
>>>>> Hm, looks like it's configured in mode 0, so no, it's not super useful.
>>>>> Can you try booting an older kernel (one that didn't have the
>>>>> ->setup_data_interface() hook implemented).
>>>>
>>>> Ok. I went back from 5.1 and the first kernel I could find that
>>>> returned no grep hits for "setup_data_interface" was 4.16.
>>>>
>>>> So I built for my target with that and added similar trace to dump
>>>> the hardware register settings for that. Debug output looks like
>>>> this now for it:
>>>>
>>>> ...
>>>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
>>>> clk_get_rate(r->clock[0])=22000000
>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>> HW_GPMI_TIMING0=0x00010203
>>>> HW_GPMI_TIMING1=0x05000000
>>>> 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
>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
>>>> clk_get_rate(r->clock[0])=99000000
>>>> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>> HW_GPMI_TIMING0=0x00010101
>>>
>>> TIMING0 match the one you have with 5.1 kernels.
>>>
>>>> HW_GPMI_TIMING1=0x90000000
>>>
>>> And we even have a bigger timeout value in 5.1 (0xe0000000), so we
>>> should be all safe WRT to timings in TIMING{0,1}.
>>>
>>> Can you dump CTRL1?
>>
>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>> HW_GPMI_TIMING0=0x00010101
>> HW_GPMI_TIMING1=0x90000000
>> HW_GPMI_CTRL1_SET=0x01c4800c
>
> The read/write delay fields seem to match, but there are a few more
> fields set in this version:
> - DECOUPLE_CS
> - BCH_MODE
> - DEV_RESET
> - CTRL1_ATA_IRQRDY_POLARITY__ACTIVEHIGH
>
> Looks like those fields are not explicitly set in the gpmi_begin()
> patch, but maybe you dumped CTRL1. Would you mind sharing your patch?
Attached.
> If I'm right and you indeed dumped CTRL1, it might be worth doing the
> same in your 5.1 kernel so we can more easily compare those dumps.
> While at it, can you dump CTRL1 before and after applying the changes?
Will do. I am out of my lab for the weekend, but I'll get
those numbers first thing Monday morning.
Regards
Greg
[-- Attachment #2: gpmi-416.patch --]
[-- Type: text/x-patch, Size: 2481 bytes --]
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -963,6 +963,7 @@ static int enable_edo_mode(struct gpmi_n
unsigned long rate;
int ret;
+printk("%s(%d): enable_edo_mode()\n", __FILE__, __LINE__);
feature = kzalloc(ONFI_SUBFEATURE_PARAM_LEN, GFP_KERNEL);
if (!feature)
return -ENOMEM;
@@ -988,6 +989,7 @@ static int enable_edo_mode(struct gpmi_n
/* [3] set the main IO clock, 100MHz for mode 5, 80MHz for mode 4. */
rate = (mode == 5) ? 100000000 : 80000000;
clk_set_rate(r->clock[0], rate);
+printk(" clk_get_rate(r->clock[0])=%ld\n", clk_get_rate(r->clock[0]));
/* Let the gpmi_begin() re-compute the timing again. */
this->flags &= ~GPMI_TIMING_INIT_OK;
@@ -1049,6 +1051,7 @@ void gpmi_begin(struct gpmi_nand_data *t
return;
this->flags |= GPMI_TIMING_INIT_OK;
+printk("%s(%d): gpmi_begin()\n", __FILE__, __LINE__);
if (this->flags & GPMI_ASYNC_EDO_ENABLED)
gpmi_compute_edo_timing(this, &hw);
else
@@ -1060,10 +1063,12 @@ void gpmi_begin(struct gpmi_nand_data *t
BF_GPMI_TIMING0_DATA_SETUP(hw.data_setup_in_cycles);
writel(reg, gpmi_regs + HW_GPMI_TIMING0);
+printk(" HW_GPMI_TIMING0=0x%08x\n", readl(gpmi_regs + HW_GPMI_TIMING0));
/* [2] Set HW_GPMI_TIMING1 */
writel(BF_GPMI_TIMING1_BUSY_TIMEOUT(hw.device_busy_timeout),
gpmi_regs + HW_GPMI_TIMING1);
+printk(" HW_GPMI_TIMING1=0x%08x\n", readl(gpmi_regs + HW_GPMI_TIMING1));
/* [3] The following code is to set the HW_GPMI_CTRL1. */
@@ -1088,6 +1093,7 @@ void gpmi_begin(struct gpmi_nand_data *t
| BF_GPMI_CTRL1_RDN_DELAY(hw.sample_delay_factor);
writel(reg, gpmi_regs + HW_GPMI_CTRL1_SET);
+printk(" HW_GPMI_CTRL1_SET=0x%08x\n", readl(gpmi_regs + HW_GPMI_CTRL1_SET));
/* At last, we enable the DLL. */
writel(BM_GPMI_CTRL1_DLL_ENABLE, gpmi_regs + HW_GPMI_CTRL1_SET);
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -804,6 +804,7 @@ static int gpmi_get_clks(struct gpmi_nan
struct clk *clk;
int err, i;
+printk("%s(%d): gpmi_get_clks()\n", __FILE__, __LINE__);
for (i = 0; i < this->devdata->clks_count; i++) {
clk = devm_clk_get(this->dev, this->devdata->clks[i]);
if (IS_ERR(clk)) {
@@ -822,6 +823,7 @@ static int gpmi_get_clks(struct gpmi_nan
* Synchronous Mode, you should change the clock as you need.
*/
clk_set_rate(r->clock[0], 22000000);
+printk(" clk_get_rate(r->clock[0])=%ld\n", clk_get_rate(r->clock[0]));
return 0;
[-- Attachment #3: Type: text/plain, Size: 144 bytes --]
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-09 13:57 ` Greg Ungerer
@ 2019-08-09 13:59 ` Boris Brezillon
2019-08-12 2:50 ` Greg Ungerer
0 siblings, 1 reply; 50+ messages in thread
From: Boris Brezillon @ 2019-08-09 13:59 UTC (permalink / raw)
To: Greg Ungerer
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
On Fri, 9 Aug 2019 23:57:08 +1000
Greg Ungerer <gerg@kernel.org> wrote:
> Hi Boris,
>
> On 9/8/19 5:32 pm, Boris Brezillon wrote:
> > On Fri, 9 Aug 2019 16:55:22 +1000
> > Greg Ungerer <gerg@kernel.org> wrote:
> >> On 9/8/19 4:23 pm, Boris Brezillon wrote:
> >>> On Fri, 9 Aug 2019 15:20:52 +1000
> >>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>> On 9/8/19 2:36 am, Boris Brezillon wrote:
> >>>>> On Mon, 5 Aug 2019 15:51:05 +1000
> >>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
> >>>>>>> On Fri, 2 Aug 2019 22:34:57 +1000
> >>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
> >>>>>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
> >>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> >>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >>>>>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>>>>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>>>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>>>>>>>>>>>> [snip]
> >>>>>>>>>> Note that this was generated on a normal boot up (not failure).
> >>>>>>>>>
> >>>>>>>>> The values looks good. Can you try with the below diff applied?
> >>>>>>>>> --->8---
> >>>>>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>>>> index 334fe3130285..9771f6a82abe 100644
> >>>>>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> >>>>>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
> >>>>>>>>>
> >>>>>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> >>>>>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> >>>>>>>>> - if (!dll_wait_time_us)
> >>>>>>>>> - dll_wait_time_us = 1;
> >>>>>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
> >>>>>>>>>
> >>>>>>>>> /* Wait for the DLL to settle. */
> >>>>>>>>> - udelay(dll_wait_time_us);
> >>>>>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> >>>>>>>>> }
> >>>>>>>>>
> >>>>>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>>>>>>>
> >>>>>>>> Eventually it failed, in the same way with with same errors.
> >>>>>>>> Took quite a while, over 600 boot cycles.
> >>>>>>>>
> >>>>>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
> >>>>>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
> >>>>>>>
> >>>>>>> Oh well. I guess the next thing to do would be to dump the timing regs
> >>>>>>> and clk rate that are set by the bootloader (before the driver override
> >>>>>>> them) or those applied by an older kernel (one that didn't have that
> >>>>>>> issue).
> >>>>>>
> >>>>>> Is this useful?
> >>>>>
> >>>>> Hm, looks like it's configured in mode 0, so no, it's not super useful.
> >>>>> Can you try booting an older kernel (one that didn't have the
> >>>>> ->setup_data_interface() hook implemented).
> >>>>
> >>>> Ok. I went back from 5.1 and the first kernel I could find that
> >>>> returned no grep hits for "setup_data_interface" was 4.16.
> >>>>
> >>>> So I built for my target with that and added similar trace to dump
> >>>> the hardware register settings for that. Debug output looks like
> >>>> this now for it:
> >>>>
> >>>> ...
> >>>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
> >>>> clk_get_rate(r->clock[0])=22000000
> >>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >>>> HW_GPMI_TIMING0=0x00010203
> >>>> HW_GPMI_TIMING1=0x05000000
> >>>> 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
> >>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
> >>>> clk_get_rate(r->clock[0])=99000000
> >>>> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
> >>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >>>> HW_GPMI_TIMING0=0x00010101
> >>>
> >>> TIMING0 match the one you have with 5.1 kernels.
> >>>
> >>>> HW_GPMI_TIMING1=0x90000000
> >>>
> >>> And we even have a bigger timeout value in 5.1 (0xe0000000), so we
> >>> should be all safe WRT to timings in TIMING{0,1}.
> >>>
> >>> Can you dump CTRL1?
> >>
> >> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >> HW_GPMI_TIMING0=0x00010101
> >> HW_GPMI_TIMING1=0x90000000
> >> HW_GPMI_CTRL1_SET=0x01c4800c
> >
> > The read/write delay fields seem to match, but there are a few more
> > fields set in this version:
> > - DECOUPLE_CS
> > - BCH_MODE
> > - DEV_RESET
> > - CTRL1_ATA_IRQRDY_POLARITY__ACTIVEHIGH
> >
> > Looks like those fields are not explicitly set in the gpmi_begin()
> > patch, but maybe you dumped CTRL1. Would you mind sharing your patch?
>
> Attached.
Hm, you should read CTRL1 instead of CTRL1_SET which I guess is WO.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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
0 siblings, 2 replies; 50+ messages in thread
From: Greg Ungerer @ 2019-08-12 2:50 UTC (permalink / raw)
To: Boris Brezillon
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
Hi Boris,
On 9/8/19 11:59 pm, Boris Brezillon wrote:
> On Fri, 9 Aug 2019 23:57:08 +1000
> Greg Ungerer <gerg@kernel.org> wrote:
>> On 9/8/19 5:32 pm, Boris Brezillon wrote:
>>> On Fri, 9 Aug 2019 16:55:22 +1000
>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>> On 9/8/19 4:23 pm, Boris Brezillon wrote:
>>>>> On Fri, 9 Aug 2019 15:20:52 +1000
>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>> On 9/8/19 2:36 am, Boris Brezillon wrote:
>>>>>>> On Mon, 5 Aug 2019 15:51:05 +1000
>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
>>>>>>>>> On Fri, 2 Aug 2019 22:34:57 +1000
>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
>>>>>>>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>>>>>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>>>>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>>>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>>>>>>>>>>>> [snip]
>>>>>>>>>>>> Note that this was generated on a normal boot up (not failure).
>>>>>>>>>>>
>>>>>>>>>>> The values looks good. Can you try with the below diff applied?
>>>>>>>>>>> --->8---
>>>>>>>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>>>> index 334fe3130285..9771f6a82abe 100644
>>>>>>>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
>>>>>>>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>>>>>>>>>>>
>>>>>>>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
>>>>>>>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
>>>>>>>>>>> - if (!dll_wait_time_us)
>>>>>>>>>>> - dll_wait_time_us = 1;
>>>>>>>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>>>>>>>>>>>
>>>>>>>>>>> /* Wait for the DLL to settle. */
>>>>>>>>>>> - udelay(dll_wait_time_us);
>>>>>>>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>>>>>>>>>>
>>>>>>>>>> Eventually it failed, in the same way with with same errors.
>>>>>>>>>> Took quite a while, over 600 boot cycles.
>>>>>>>>>>
>>>>>>>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
>>>>>>>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
>>>>>>>>>
>>>>>>>>> Oh well. I guess the next thing to do would be to dump the timing regs
>>>>>>>>> and clk rate that are set by the bootloader (before the driver override
>>>>>>>>> them) or those applied by an older kernel (one that didn't have that
>>>>>>>>> issue).
>>>>>>>>
>>>>>>>> Is this useful?
>>>>>>>
>>>>>>> Hm, looks like it's configured in mode 0, so no, it's not super useful.
>>>>>>> Can you try booting an older kernel (one that didn't have the
>>>>>>> ->setup_data_interface() hook implemented).
>>>>>>
>>>>>> Ok. I went back from 5.1 and the first kernel I could find that
>>>>>> returned no grep hits for "setup_data_interface" was 4.16.
>>>>>>
>>>>>> So I built for my target with that and added similar trace to dump
>>>>>> the hardware register settings for that. Debug output looks like
>>>>>> this now for it:
>>>>>>
>>>>>> ...
>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
>>>>>> clk_get_rate(r->clock[0])=22000000
>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>>>> HW_GPMI_TIMING0=0x00010203
>>>>>> HW_GPMI_TIMING1=0x05000000
>>>>>> 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
>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
>>>>>> clk_get_rate(r->clock[0])=99000000
>>>>>> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>>>> HW_GPMI_TIMING0=0x00010101
>>>>>
>>>>> TIMING0 match the one you have with 5.1 kernels.
>>>>>
>>>>>> HW_GPMI_TIMING1=0x90000000
>>>>>
>>>>> And we even have a bigger timeout value in 5.1 (0xe0000000), so we
>>>>> should be all safe WRT to timings in TIMING{0,1}.
>>>>>
>>>>> Can you dump CTRL1?
>>>>
>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>> HW_GPMI_TIMING0=0x00010101
>>>> HW_GPMI_TIMING1=0x90000000
>>>> HW_GPMI_CTRL1_SET=0x01c4800c
>>>
>>> The read/write delay fields seem to match, but there are a few more
>>> fields set in this version:
>>> - DECOUPLE_CS
>>> - BCH_MODE
>>> - DEV_RESET
>>> - CTRL1_ATA_IRQRDY_POLARITY__ACTIVEHIGH
>>>
>>> Looks like those fields are not explicitly set in the gpmi_begin()
>>> patch, but maybe you dumped CTRL1. Would you mind sharing your patch?
>>
>> Attached.
>
> Hm, you should read CTRL1 instead of CTRL1_SET which I guess is WO.
Here is 2 sets of trace dumping the same set of registers.
This first is on the linux-4.16 kernel:
Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #9 Mon Aug 12 10:46:25 AEST 2019
...
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: use legacy bch geometry
gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1110): gpmi_begin()
HW_GPMI_TIMING0=0x00010101
HW_GPMI_TIMING1=0x90000000
HW_GPMI_CTRL1=0x01c6800c
r->clock[0]=99000000
Scanning device for bad blocks
5 ofpart 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.
...
And then this is from the 5.1.14 kernel:
Linux version 5.1.14 (gerg@goober) (gcc version 4.8.3 (GCC)) #25 Mon Aug 12 10:49:21 AEST 2019
...
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
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
HW_GPMI_TIMING0=0x00020101
HW_GPMI_TIMING1=0xb0000000
HW_GPMI_CTRL1=0x0104000c
r->clock[0]=22000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
HW_GPMI_TIMING0=0x00010101
HW_GPMI_TIMING1=0xe0000000
HW_GPMI_CTRL1=0x01c6800c
r->clock[0]=99000000
Scanning device for bad blocks
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.
Register settings read back from the registers themselves at the end
of the respective setting routines (so gpmi_begin() for 4.16 and
gpmi_nfc_apply_timings() for 5.1.14)
So something I notice here is that gpmi_nfc_apply_timings() is
being run multiple times. When I look back to the original
failure dumps the first error ("DMA timeout, last DMA") occurred
after the device type messages ("nand: 256 MiB, SLC,..."). Is it
happening with that higher clock rate still set?
Regards
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-12 2:50 ` Greg Ungerer
@ 2019-08-12 4:04 ` Greg Ungerer
2019-08-12 7:31 ` Boris Brezillon
1 sibling, 0 replies; 50+ messages in thread
From: Greg Ungerer @ 2019-08-12 4:04 UTC (permalink / raw)
To: Boris Brezillon
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
On 12/8/19 12:50 pm, Greg Ungerer wrote:
> On 9/8/19 11:59 pm, Boris Brezillon wrote:
>> On Fri, 9 Aug 2019 23:57:08 +1000
>> Greg Ungerer <gerg@kernel.org> wrote:
>>> On 9/8/19 5:32 pm, Boris Brezillon wrote:
>>>> On Fri, 9 Aug 2019 16:55:22 +1000
>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>> On 9/8/19 4:23 pm, Boris Brezillon wrote:
>>>>>> On Fri, 9 Aug 2019 15:20:52 +1000
>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>> On 9/8/19 2:36 am, Boris Brezillon wrote:
>>>>>>>> On Mon, 5 Aug 2019 15:51:05 +1000
>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
>>>>>>>>>> On Fri, 2 Aug 2019 22:34:57 +1000
>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
>>>>>>>>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
>>>>>>>>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
>>>>>>>>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
>>>>>>>>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
>>>>>>>>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
>>>>>>>>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
>>>>>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
>>>>>>>>>>>>>>>> [snip]
>>>>>>>>>>>>> Note that this was generated on a normal boot up (not failure).
>>>>>>>>>>>>
>>>>>>>>>>>> The values looks good. Can you try with the below diff applied?
>>>>>>>>>>>> --->8---
>>>>>>>>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>>>>> index 334fe3130285..9771f6a82abe 100644
>>>>>>>>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
>>>>>>>>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
>>>>>>>>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
>>>>>>>>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
>>>>>>>>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
>>>>>>>>>>>> - if (!dll_wait_time_us)
>>>>>>>>>>>> - dll_wait_time_us = 1;
>>>>>>>>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
>>>>>>>>>>>> /* Wait for the DLL to settle. */
>>>>>>>>>>>> - udelay(dll_wait_time_us);
>>>>>>>>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
>>>>>>>>>>>> }
>>>>>>>>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
>>>>>>>>>>>
>>>>>>>>>>> Eventually it failed, in the same way with with same errors.
>>>>>>>>>>> Took quite a while, over 600 boot cycles.
>>>>>>>>>>>
>>>>>>>>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
>>>>>>>>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
>>>>>>>>>>
>>>>>>>>>> Oh well. I guess the next thing to do would be to dump the timing regs
>>>>>>>>>> and clk rate that are set by the bootloader (before the driver override
>>>>>>>>>> them) or those applied by an older kernel (one that didn't have that
>>>>>>>>>> issue).
>>>>>>>>>
>>>>>>>>> Is this useful?
>>>>>>>>
>>>>>>>> Hm, looks like it's configured in mode 0, so no, it's not super useful.
>>>>>>>> Can you try booting an older kernel (one that didn't have the
>>>>>>>> ->setup_data_interface() hook implemented).
>>>>>>>
>>>>>>> Ok. I went back from 5.1 and the first kernel I could find that
>>>>>>> returned no grep hits for "setup_data_interface" was 4.16.
>>>>>>>
>>>>>>> So I built for my target with that and added similar trace to dump
>>>>>>> the hardware register settings for that. Debug output looks like
>>>>>>> this now for it:
>>>>>>>
>>>>>>> ...
>>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
>>>>>>> clk_get_rate(r->clock[0])=22000000
>>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>>>>> HW_GPMI_TIMING0=0x00010203
>>>>>>> HW_GPMI_TIMING1=0x05000000
>>>>>>> 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
>>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
>>>>>>> clk_get_rate(r->clock[0])=99000000
>>>>>>> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
>>>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>>>>> HW_GPMI_TIMING0=0x00010101
>>>>>>
>>>>>> TIMING0 match the one you have with 5.1 kernels.
>>>>>>> HW_GPMI_TIMING1=0x90000000
>>>>>>
>>>>>> And we even have a bigger timeout value in 5.1 (0xe0000000), so we
>>>>>> should be all safe WRT to timings in TIMING{0,1}.
>>>>>>
>>>>>> Can you dump CTRL1?
>>>>>
>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
>>>>> HW_GPMI_TIMING0=0x00010101
>>>>> HW_GPMI_TIMING1=0x90000000
>>>>> HW_GPMI_CTRL1_SET=0x01c4800c
>>>>
>>>> The read/write delay fields seem to match, but there are a few more
>>>> fields set in this version:
>>>> - DECOUPLE_CS
>>>> - BCH_MODE
>>>> - DEV_RESET
>>>> - CTRL1_ATA_IRQRDY_POLARITY__ACTIVEHIGH
>>>>
>>>> Looks like those fields are not explicitly set in the gpmi_begin()
>>>> patch, but maybe you dumped CTRL1. Would you mind sharing your patch?
>>>
>>> Attached.
>>
>> Hm, you should read CTRL1 instead of CTRL1_SET which I guess is WO.
>
>
> Here is 2 sets of trace dumping the same set of registers.
> This first is on the linux-4.16 kernel:
>
> Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #9 Mon Aug 12 10:46:25 AEST 2019
> ...
> 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: use legacy bch geometry
> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1110): gpmi_begin()
> HW_GPMI_TIMING0=0x00010101
> HW_GPMI_TIMING1=0x90000000
> HW_GPMI_CTRL1=0x01c6800c
> r->clock[0]=99000000
> Scanning device for bad blocks
> 5 ofpart 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.
> ...
>
>
> And then this is from the 5.1.14 kernel:
>
> Linux version 5.1.14 (gerg@goober) (gcc version 4.8.3 (GCC)) #25 Mon Aug 12 10:49:21 AEST 2019
> ...
> 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
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00020101
> HW_GPMI_TIMING1=0xb0000000
> HW_GPMI_CTRL1=0x0104000c
> r->clock[0]=22000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010101
> HW_GPMI_TIMING1=0xe0000000
> HW_GPMI_CTRL1=0x01c6800c
> r->clock[0]=99000000
> Scanning device for bad blocks
> 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.
>
>
> Register settings read back from the registers themselves at the end
> of the respective setting routines (so gpmi_begin() for 4.16 and
> gpmi_nfc_apply_timings() for 5.1.14)
>
> So something I notice here is that gpmi_nfc_apply_timings() is
> being run multiple times. When I look back to the original
> failure dumps the first error ("DMA timeout, last DMA") occurred
> after the device type messages ("nand: 256 MiB, SLC,..."). Is it
> happening with that higher clock rate still set?
Looks like that is not the case...
...
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
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
HW_GPMI_TIMING0=0x00020101
HW_GPMI_TIMING1=0xb0000000
HW_GPMI_CTRL1=0x0104000c
r->clock[0]=22000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
HW_GPMI_TIMING0=0x00010101
HW_GPMI_TIMING1=0xe0000000
HW_GPMI_CTRL1=0x01c6800c
r->clock[0]=99000000
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 : 0x00000100
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
Regards
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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
1 sibling, 1 reply; 50+ messages in thread
From: Boris Brezillon @ 2019-08-12 7:31 UTC (permalink / raw)
To: Greg Ungerer
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
On Mon, 12 Aug 2019 12:50:36 +1000
Greg Ungerer <gerg@kernel.org> wrote:
> Hi Boris,
>
> On 9/8/19 11:59 pm, Boris Brezillon wrote:
> > On Fri, 9 Aug 2019 23:57:08 +1000
> > Greg Ungerer <gerg@kernel.org> wrote:
> >> On 9/8/19 5:32 pm, Boris Brezillon wrote:
> >>> On Fri, 9 Aug 2019 16:55:22 +1000
> >>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>> On 9/8/19 4:23 pm, Boris Brezillon wrote:
> >>>>> On Fri, 9 Aug 2019 15:20:52 +1000
> >>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>> On 9/8/19 2:36 am, Boris Brezillon wrote:
> >>>>>>> On Mon, 5 Aug 2019 15:51:05 +1000
> >>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>>>> On 2/8/19 10:51 pm, Boris Brezillon wrote:
> >>>>>>>>> On Fri, 2 Aug 2019 22:34:57 +1000
> >>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>>>>>> On 31/7/19 4:28 pm, Boris Brezillon wrote:
> >>>>>>>>>>> On Wed, 31 Jul 2019 12:05:44 +1000
> >>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote:
> >>>>>>>>>>>> On 30/7/19 6:38 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Tue, 30 Jul 2019 16:06:55 +1000:
> >>>>>>>>>>>>>> On 30/7/19 10:41 am, Greg Ungerer wrote:
> >>>>>>>>>>>>>>> On 30/7/19 10:28 am, Greg Ungerer wrote:
> >>>>>>>>>>>>>>>> On 29/7/19 10:47 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 22:33:56 +1000:
> >>>>>>>>>>>>>>>>>> On 29/7/19 6:36 pm, Miquel Raynal wrote:
> >>>>>>>>>>>>>>>>>>> Greg Ungerer <gerg@kernel.org> wrote on Mon, 29 Jul 2019 16:41:51 +1000:
> >>>>>>>>>>>>>>> [snip]
> >>>>>>>>>>>> Note that this was generated on a normal boot up (not failure).
> >>>>>>>>>>>
> >>>>>>>>>>> The values looks good. Can you try with the below diff applied?
> >>>>>>>>>>> --->8---
> >>>>>>>>>>> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>>>>>> index 334fe3130285..9771f6a82abe 100644
> >>>>>>>>>>> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>>>>>> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
> >>>>>>>>>>> @@ -721,12 +721,10 @@ static void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> >>>>>>>>>>> writel(hw->ctrl1n, gpmi_regs + HW_GPMI_CTRL1_SET);
> >>>>>>>>>>>
> >>>>>>>>>>> /* Wait 64 clock cycles before using the GPMI after enabling the DLL */
> >>>>>>>>>>> - dll_wait_time_us = USEC_PER_SEC / hw->clk_rate * 64;
> >>>>>>>>>>> - if (!dll_wait_time_us)
> >>>>>>>>>>> - dll_wait_time_us = 1;
> >>>>>>>>>>> + dll_wait_time_us = DIV_ROUND_UP(USEC_PER_SEC * 64, hw->clk_rate);
> >>>>>>>>>>>
> >>>>>>>>>>> /* Wait for the DLL to settle. */
> >>>>>>>>>>> - udelay(dll_wait_time_us);
> >>>>>>>>>>> + usleep_range(dll_wait_time_us, dll_wait_time_us * 10);
> >>>>>>>>>>> }
> >>>>>>>>>>>
> >>>>>>>>>>> static int gpmi_setup_data_interface(struct nand_chip *chip, int chipnr,
> >>>>>>>>>>
> >>>>>>>>>> Eventually it failed, in the same way with with same errors.
> >>>>>>>>>> Took quite a while, over 600 boot cycles.
> >>>>>>>>>>
> >>>>>>>>>> Note also that I had to hand merge the changes, since in 5.1.14 that
> >>>>>>>>>> gpmi_nfc_apply_timings() is in gpmi-lib.c. But it was trivial to do.
> >>>>>>>>>
> >>>>>>>>> Oh well. I guess the next thing to do would be to dump the timing regs
> >>>>>>>>> and clk rate that are set by the bootloader (before the driver override
> >>>>>>>>> them) or those applied by an older kernel (one that didn't have that
> >>>>>>>>> issue).
> >>>>>>>>
> >>>>>>>> Is this useful?
> >>>>>>>
> >>>>>>> Hm, looks like it's configured in mode 0, so no, it's not super useful.
> >>>>>>> Can you try booting an older kernel (one that didn't have the
> >>>>>>> ->setup_data_interface() hook implemented).
> >>>>>>
> >>>>>> Ok. I went back from 5.1 and the first kernel I could find that
> >>>>>> returned no grep hits for "setup_data_interface" was 4.16.
> >>>>>>
> >>>>>> So I built for my target with that and added similar trace to dump
> >>>>>> the hardware register settings for that. Debug output looks like
> >>>>>> this now for it:
> >>>>>>
> >>>>>> ...
> >>>>>> drivers/mtd/nand/gpmi-nand/gpmi-nand.c(807): gpmi_get_clks()
> >>>>>> clk_get_rate(r->clock[0])=22000000
> >>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >>>>>> HW_GPMI_TIMING0=0x00010203
> >>>>>> HW_GPMI_TIMING1=0x05000000
> >>>>>> 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
> >>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(966): enable_edo_mode()
> >>>>>> clk_get_rate(r->clock[0])=99000000
> >>>>>> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
> >>>>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >>>>>> HW_GPMI_TIMING0=0x00010101
> >>>>>
> >>>>> TIMING0 match the one you have with 5.1 kernels.
> >>>>>
> >>>>>> HW_GPMI_TIMING1=0x90000000
> >>>>>
> >>>>> And we even have a bigger timeout value in 5.1 (0xe0000000), so we
> >>>>> should be all safe WRT to timings in TIMING{0,1}.
> >>>>>
> >>>>> Can you dump CTRL1?
> >>>>
> >>>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1054): gpmi_begin()
> >>>> HW_GPMI_TIMING0=0x00010101
> >>>> HW_GPMI_TIMING1=0x90000000
> >>>> HW_GPMI_CTRL1_SET=0x01c4800c
> >>>
> >>> The read/write delay fields seem to match, but there are a few more
> >>> fields set in this version:
> >>> - DECOUPLE_CS
> >>> - BCH_MODE
> >>> - DEV_RESET
> >>> - CTRL1_ATA_IRQRDY_POLARITY__ACTIVEHIGH
> >>>
> >>> Looks like those fields are not explicitly set in the gpmi_begin()
> >>> patch, but maybe you dumped CTRL1. Would you mind sharing your patch?
> >>
> >> Attached.
> >
> > Hm, you should read CTRL1 instead of CTRL1_SET which I guess is WO.
>
>
> Here is 2 sets of trace dumping the same set of registers.
> This first is on the linux-4.16 kernel:
>
> Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #9 Mon Aug 12 10:46:25 AEST 2019
> ...
> 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: use legacy bch geometry
> gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1110): gpmi_begin()
> HW_GPMI_TIMING0=0x00010101
> HW_GPMI_TIMING1=0x90000000
> HW_GPMI_CTRL1=0x01c6800c
> r->clock[0]=99000000
> Scanning device for bad blocks
> 5 ofpart 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.
> ...
>
>
> And then this is from the 5.1.14 kernel:
>
> Linux version 5.1.14 (gerg@goober) (gcc version 4.8.3 (GCC)) #25 Mon Aug 12 10:49:21 AEST 2019
> ...
> 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
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00020101
> HW_GPMI_TIMING1=0xb0000000
> HW_GPMI_CTRL1=0x0104000c
> r->clock[0]=22000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(510): gpmi_nfc_apply_timings()
> HW_GPMI_TIMING0=0x00010101
> HW_GPMI_TIMING1=0xe0000000
> HW_GPMI_CTRL1=0x01c6800c
> r->clock[0]=99000000
> Scanning device for bad blocks
> 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.
>
>
> Register settings read back from the registers themselves at the end
> of the respective setting routines (so gpmi_begin() for 4.16 and
> gpmi_nfc_apply_timings() for 5.1.14)
Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
the end of those funcs?
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-12 7:31 ` Boris Brezillon
@ 2019-08-13 0:50 ` Greg Ungerer
2021-01-28 9:45 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2019-08-13 0:50 UTC (permalink / raw)
To: Boris Brezillon
Cc: Miquel Raynal, s.hauer, Michael Nazzareno Trimarchi, linux-mtd,
Boris Brezillon
Hi Boris,
On 12/8/19 5:31 pm, Boris Brezillon wrote:
> On Mon, 12 Aug 2019 12:50:36 +1000
[snip]
> Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
> the end of those funcs?
Here is a more complete dump of registers. Trace points are at
entry and exit of the respective functions in the different
kernel versions. Register dumping code is identical for both.
Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #10 Tue Aug 13 10:24:28 AEST 2019
...
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
HW_GPMI_CTRL0=0x00000000
HW_GPMI_CTRL1=0x01c4000c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000400
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00010203
HW_GPMI_TIMING1=0x00000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x00000000
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000000
r->clock[0]=22000000
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: enable the asynchronous EDO mode 5
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
HW_GPMI_CTRL0=0x01800001
HW_GPMI_CTRL1=0x0104000c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000000
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00010203
HW_GPMI_TIMING1=0x05000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x00000000
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000101
r->clock[0]=99000000
drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1136): gpmi_begin(): EXIT
HW_GPMI_CTRL0=0x01800001
HW_GPMI_CTRL1=0x01c6800c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000000
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00010101
HW_GPMI_TIMING1=0x90000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x00000000
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000101
r->clock[0]=99000000
Scanning device for bad blocks
5 ofpart 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.
...
Note that the first ENTRY dump has no matching EXIT dump. From the
code I assume it is returning from gpmi_begin() at the
"if (!hw.sample_delay_factor)" check.
And for the 5.1.14 kernel:
Linux version 5.1.14 (gerg@goober) (gcc version 4.8.3 (GCC)) #27 Tue Aug 13 10:20:32 AEST 2019
...
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
HW_GPMI_CTRL0=0x00000000
HW_GPMI_CTRL1=0x01c4000c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000400
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00010203
HW_GPMI_TIMING1=0x00000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x00000000
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000000
r->clock[0]=22000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
HW_GPMI_CTRL0=0x00000000
HW_GPMI_CTRL1=0x0104000c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000400
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00020101
HW_GPMI_TIMING1=0x60000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x00000000
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000000
r->clock[0]=22000000
random: fast init done
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
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
HW_GPMI_CTRL0=0x01800001
HW_GPMI_CTRL1=0x0104000c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000000
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00020101
HW_GPMI_TIMING1=0x60000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x0000003f
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000101
r->clock[0]=22000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
HW_GPMI_CTRL0=0x01800001
HW_GPMI_CTRL1=0x0104000c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000000
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00020101
HW_GPMI_TIMING1=0xb0000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x0000003f
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000101
r->clock[0]=22000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
HW_GPMI_CTRL0=0x01800001
HW_GPMI_CTRL1=0x0104000c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000000
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00020101
HW_GPMI_TIMING1=0xb0000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x000000e0
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000000
r->clock[0]=22000000
drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
HW_GPMI_CTRL0=0x01800001
HW_GPMI_CTRL1=0x01c6800c
HW_GPMI_COMPARE=0x00000000
HW_GPMI_ECCCTRL=0x00000000
HW_GPMI_ECCCOUNT=0x00000000
HW_GPMI_PAYLOAD=0x00000000
HW_GPMI_AUXILIARY=0x00000000
HW_GPMI_TIMING0=0x00010101
HW_GPMI_TIMING1=0xe0000000
HW_GPMI_TIMING2=0x23023336
HW_GPMI_DATA=0x000000e0
HW_GPMI_STAT=0xff000005
HW_GPMI_DEBUG=0x00000000
r->clock[0]=99000000
Scanning device for bad blocks
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.
...
Regards
Greg
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2019-08-13 0:50 ` Greg Ungerer
@ 2021-01-28 9:45 ` Michael Nazzareno Trimarchi
2021-01-28 10:26 ` Miquel Raynal
2021-01-29 12:43 ` Greg Ungerer
0 siblings, 2 replies; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-01-28 9:45 UTC (permalink / raw)
To: Greg Ungerer
Cc: Miquel Raynal, Sascha Hauer, Boris Brezillon, linux-mtd, Boris Brezillon
Hi Greg
On Tue, Aug 13, 2019 at 2:50 AM Greg Ungerer <gerg@kernel.org> wrote:
>
> Hi Boris,
>
> On 12/8/19 5:31 pm, Boris Brezillon wrote:
> > On Mon, 12 Aug 2019 12:50:36 +1000
> [snip]
> > Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
> > the end of those funcs?
>
> Here is a more complete dump of registers. Trace points are at
> entry and exit of the respective functions in the different
> kernel versions. Register dumping code is identical for both.
>
>
> Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #10 Tue Aug 13 10:24:28 AEST 2019
> ...
I ran an overnight reboot process on linux-4.19.y tag: v4.19.169 and
I'm not able to reproduce up to now.
Do you have an update from your side?
Michael
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
> HW_GPMI_CTRL0=0x00000000
> HW_GPMI_CTRL1=0x01c4000c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000400
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00010203
> HW_GPMI_TIMING1=0x00000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x00000000
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000000
> r->clock[0]=22000000
> 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: enable the asynchronous EDO mode 5
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
> HW_GPMI_CTRL0=0x01800001
> HW_GPMI_CTRL1=0x0104000c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000000
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00010203
> HW_GPMI_TIMING1=0x05000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x00000000
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000101
> r->clock[0]=99000000
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1136): gpmi_begin(): EXIT
> HW_GPMI_CTRL0=0x01800001
> HW_GPMI_CTRL1=0x01c6800c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000000
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00010101
> HW_GPMI_TIMING1=0x90000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x00000000
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000101
> r->clock[0]=99000000
> Scanning device for bad blocks
> 5 ofpart 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.
> ...
>
> Note that the first ENTRY dump has no matching EXIT dump. From the
> code I assume it is returning from gpmi_begin() at the
> "if (!hw.sample_delay_factor)" check.
>
>
> And for the 5.1.14 kernel:
>
> Linux version 5.1.14 (gerg@goober) (gcc version 4.8.3 (GCC)) #27 Tue Aug 13 10:20:32 AEST 2019
> ...
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
> HW_GPMI_CTRL0=0x00000000
> HW_GPMI_CTRL1=0x01c4000c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000400
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00010203
> HW_GPMI_TIMING1=0x00000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x00000000
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000000
> r->clock[0]=22000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
> HW_GPMI_CTRL0=0x00000000
> HW_GPMI_CTRL1=0x0104000c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000400
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00020101
> HW_GPMI_TIMING1=0x60000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x00000000
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000000
> r->clock[0]=22000000
> random: fast init done
> 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
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
> HW_GPMI_CTRL0=0x01800001
> HW_GPMI_CTRL1=0x0104000c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000000
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00020101
> HW_GPMI_TIMING1=0x60000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x0000003f
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000101
> r->clock[0]=22000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
> HW_GPMI_CTRL0=0x01800001
> HW_GPMI_CTRL1=0x0104000c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000000
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00020101
> HW_GPMI_TIMING1=0xb0000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x0000003f
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000101
> r->clock[0]=22000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
> HW_GPMI_CTRL0=0x01800001
> HW_GPMI_CTRL1=0x0104000c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000000
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00020101
> HW_GPMI_TIMING1=0xb0000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x000000e0
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000000
> r->clock[0]=22000000
> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
> HW_GPMI_CTRL0=0x01800001
> HW_GPMI_CTRL1=0x01c6800c
> HW_GPMI_COMPARE=0x00000000
> HW_GPMI_ECCCTRL=0x00000000
> HW_GPMI_ECCCOUNT=0x00000000
> HW_GPMI_PAYLOAD=0x00000000
> HW_GPMI_AUXILIARY=0x00000000
> HW_GPMI_TIMING0=0x00010101
> HW_GPMI_TIMING1=0xe0000000
> HW_GPMI_TIMING2=0x23023336
> HW_GPMI_DATA=0x000000e0
> HW_GPMI_STAT=0xff000005
> HW_GPMI_DEBUG=0x00000000
> r->clock[0]=99000000
> Scanning device for bad blocks
> 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.
> ...
>
>
> Regards
> Greg
>
>
--
Michael Nazzareno Trimarchi
Amarula Solutions BV
COO Co-Founder
Cruquiuskade 47 Amsterdam 1018 AM NL
T. +31(0)851119172
M. +39(0)3479132170
[`as] https://www.amarulasolutions.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
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-29 12:43 ` Greg Ungerer
1 sibling, 1 reply; 50+ messages in thread
From: Miquel Raynal @ 2021-01-28 10:26 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi Michael,
Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
Thu, 28 Jan 2021 10:45:29 +0100:
> Hi Greg
>
> On Tue, Aug 13, 2019 at 2:50 AM Greg Ungerer <gerg@kernel.org> wrote:
> >
> > Hi Boris,
> >
> > On 12/8/19 5:31 pm, Boris Brezillon wrote:
> > > On Mon, 12 Aug 2019 12:50:36 +1000
> > [snip]
> > > Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
> > > the end of those funcs?
> >
> > Here is a more complete dump of registers. Trace points are at
> > entry and exit of the respective functions in the different
> > kernel versions. Register dumping code is identical for both.
> >
> >
> > Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #10 Tue Aug 13 10:24:28 AEST 2019
> > ...
>
> I ran an overnight reboot process on linux-4.19.y tag: v4.19.169 and
> I'm not able to reproduce up to now.
>
> Do you have an update from your side?
Perhaps this patch [1] was backported to v4.19.169 (I didn't check) but
it might have fixed the DMA issue you were seeing, at least in the
recent kernel versions.
[1] mtd: rawnand: gpmi: Fix the random DMA timeout issue
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-01-28 10:26 ` Miquel Raynal
@ 2021-01-28 10:35 ` Michael Nazzareno Trimarchi
2021-01-28 11:55 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-01-28 10:35 UTC (permalink / raw)
To: Miquel Raynal
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi
On Thu, Jan 28, 2021 at 11:26 AM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> Hi Michael,
>
> Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> Thu, 28 Jan 2021 10:45:29 +0100:
>
> > Hi Greg
> >
> > On Tue, Aug 13, 2019 at 2:50 AM Greg Ungerer <gerg@kernel.org> wrote:
> > >
> > > Hi Boris,
> > >
> > > On 12/8/19 5:31 pm, Boris Brezillon wrote:
> > > > On Mon, 12 Aug 2019 12:50:36 +1000
> > > [snip]
> > > > Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
> > > > the end of those funcs?
> > >
> > > Here is a more complete dump of registers. Trace points are at
> > > entry and exit of the respective functions in the different
> > > kernel versions. Register dumping code is identical for both.
> > >
> > >
> > > Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #10 Tue Aug 13 10:24:28 AEST 2019
> > > ...
> >
> > I ran an overnight reboot process on linux-4.19.y tag: v4.19.169 and
> > I'm not able to reproduce up to now.
> >
> > Do you have an update from your side?
>
> Perhaps this patch [1] was backported to v4.19.169 (I didn't check) but
> it might have fixed the DMA issue you were seeing, at least in the
> recent kernel versions.
It's not there and should not go because this patch fixes another
regression. Apply
it means apply anyway both.
I will decode the registers on those thread and check the difference
Michael
>
> [1] mtd: rawnand: gpmi: Fix the random DMA timeout issue
>
> Thanks,
> Miquèl
--
Michael Nazzareno Trimarchi
Amarula Solutions BV
COO Co-Founder
Cruquiuskade 47 Amsterdam 1018 AM NL
T. +31(0)851119172
M. +39(0)3479132170
[`as] https://www.amarulasolutions.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-01-28 10:35 ` Michael Nazzareno Trimarchi
@ 2021-01-28 11:55 ` Michael Nazzareno Trimarchi
0 siblings, 0 replies; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-01-28 11:55 UTC (permalink / raw)
To: Miquel Raynal
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi
I have a couple of questions
On Thu, Jan 28, 2021 at 11:35 AM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:
>
> Hi
>
> On Thu, Jan 28, 2021 at 11:26 AM Miquel Raynal
> <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Michael,
> >
> > Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> > Thu, 28 Jan 2021 10:45:29 +0100:
> >
> > > Hi Greg
> > >
> > > On Tue, Aug 13, 2019 at 2:50 AM Greg Ungerer <gerg@kernel.org> wrote:
> > > >
> > > > Hi Boris,
> > > >
> > > > On 12/8/19 5:31 pm, Boris Brezillon wrote:
> > > > > On Mon, 12 Aug 2019 12:50:36 +1000
> > > > [snip]
> > > > > Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
> > > > > the end of those funcs?
> > > >
> > > > Here is a more complete dump of registers. Trace points are at
> > > > entry and exit of the respective functions in the different
> > > > kernel versions. Register dumping code is identical for both.
> > > >
> > > >
> > > > Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #10 Tue Aug 13 10:24:28 AEST 2019
> > > > ...
> > >
> > > I ran an overnight reboot process on linux-4.19.y tag: v4.19.169 and
> > > I'm not able to reproduce up to now.
> > >
> > > Do you have an update from your side?
> >
> > Perhaps this patch [1] was backported to v4.19.169 (I didn't check) but
> > it might have fixed the DMA issue you were seeing, at least in the
> > recent kernel versions.
>
> It's not there and should not go because this patch fixes another
> regression. Apply
> it means apply anyway both.
> I will decode the registers on those thread and check the difference
>
maxchips is 2 for IMX6 and I think that is connected to NAND_CE0_B and
NAND_CE1_B, When
we probe I think both are probed. Is that right?
Michael
> Michae
>
> >
> > [1] mtd: rawnand: gpmi: Fix the random DMA timeout issue
> >
> > Thanks,
> > Miquèl
>
>
>
> --
> Michael Nazzareno Trimarchi
> Amarula Solutions BV
> COO Co-Founder
> Cruquiuskade 47 Amsterdam 1018 AM NL
> T. +31(0)851119172
> M. +39(0)3479132170
> [`as] https://www.amarulasolutions.com
--
Michael Nazzareno Trimarchi
Amarula Solutions BV
COO Co-Founder
Cruquiuskade 47 Amsterdam 1018 AM NL
T. +31(0)851119172
M. +39(0)3479132170
[`as] https://www.amarulasolutions.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-01-28 9:45 ` Michael Nazzareno Trimarchi
2021-01-28 10:26 ` Miquel Raynal
@ 2021-01-29 12:43 ` Greg Ungerer
2021-01-30 9:41 ` Michael Nazzareno Trimarchi
1 sibling, 1 reply; 50+ messages in thread
From: Greg Ungerer @ 2021-01-29 12:43 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi
Cc: Miquel Raynal, Sascha Hauer, Boris Brezillon, linux-mtd, Boris Brezillon
Hi Michael,
On 28/1/21 7:45 pm, Michael Nazzareno Trimarchi wrote:
> Hi Greg
>
> On Tue, Aug 13, 2019 at 2:50 AM Greg Ungerer <gerg@kernel.org> wrote:
>>
>> Hi Boris,
>>
>> On 12/8/19 5:31 pm, Boris Brezillon wrote:
>>> On Mon, 12 Aug 2019 12:50:36 +1000
>> [snip]
>>> Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
>>> the end of those funcs?
>>
>> Here is a more complete dump of registers. Trace points are at
>> entry and exit of the respective functions in the different
>> kernel versions. Register dumping code is identical for both.
>>
>>
>> Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #10 Tue Aug 13 10:24:28 AEST 2019
>> ...
>
> I ran an overnight reboot process on linux-4.19.y tag: v4.19.169 and
> I'm not able to reproduce up to now.
>
> Do you have an update from your side?
I haven't seen the problem for a while now.
I pretty much only run modern kernels, I am currently using 5.10.
So I am guessing it was resolved somewhere at some point, but I
don't know exactly what change resolved it.
Regards
Greg
>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
>> HW_GPMI_CTRL0=0x00000000
>> HW_GPMI_CTRL1=0x01c4000c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000400
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00010203
>> HW_GPMI_TIMING1=0x00000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x00000000
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000000
>> r->clock[0]=22000000
>> 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: enable the asynchronous EDO mode 5
>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
>> HW_GPMI_CTRL0=0x01800001
>> HW_GPMI_CTRL1=0x0104000c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000000
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00010203
>> HW_GPMI_TIMING1=0x05000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x00000000
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000101
>> r->clock[0]=99000000
>> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1136): gpmi_begin(): EXIT
>> HW_GPMI_CTRL0=0x01800001
>> HW_GPMI_CTRL1=0x01c6800c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000000
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00010101
>> HW_GPMI_TIMING1=0x90000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x00000000
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000101
>> r->clock[0]=99000000
>> Scanning device for bad blocks
>> 5 ofpart 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.
>> ...
>>
>> Note that the first ENTRY dump has no matching EXIT dump. From the
>> code I assume it is returning from gpmi_begin() at the
>> "if (!hw.sample_delay_factor)" check.
>>
>>
>> And for the 5.1.14 kernel:
>>
>> Linux version 5.1.14 (gerg@goober) (gcc version 4.8.3 (GCC)) #27 Tue Aug 13 10:20:32 AEST 2019
>> ...
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
>> HW_GPMI_CTRL0=0x00000000
>> HW_GPMI_CTRL1=0x01c4000c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000400
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00010203
>> HW_GPMI_TIMING1=0x00000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x00000000
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000000
>> r->clock[0]=22000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
>> HW_GPMI_CTRL0=0x00000000
>> HW_GPMI_CTRL1=0x0104000c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000400
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00020101
>> HW_GPMI_TIMING1=0x60000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x00000000
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000000
>> r->clock[0]=22000000
>> random: fast init done
>> 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
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
>> HW_GPMI_CTRL0=0x01800001
>> HW_GPMI_CTRL1=0x0104000c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000000
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00020101
>> HW_GPMI_TIMING1=0x60000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x0000003f
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000101
>> r->clock[0]=22000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
>> HW_GPMI_CTRL0=0x01800001
>> HW_GPMI_CTRL1=0x0104000c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000000
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00020101
>> HW_GPMI_TIMING1=0xb0000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x0000003f
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000101
>> r->clock[0]=22000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
>> HW_GPMI_CTRL0=0x01800001
>> HW_GPMI_CTRL1=0x0104000c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000000
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00020101
>> HW_GPMI_TIMING1=0xb0000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x000000e0
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000000
>> r->clock[0]=22000000
>> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
>> HW_GPMI_CTRL0=0x01800001
>> HW_GPMI_CTRL1=0x01c6800c
>> HW_GPMI_COMPARE=0x00000000
>> HW_GPMI_ECCCTRL=0x00000000
>> HW_GPMI_ECCCOUNT=0x00000000
>> HW_GPMI_PAYLOAD=0x00000000
>> HW_GPMI_AUXILIARY=0x00000000
>> HW_GPMI_TIMING0=0x00010101
>> HW_GPMI_TIMING1=0xe0000000
>> HW_GPMI_TIMING2=0x23023336
>> HW_GPMI_DATA=0x000000e0
>> HW_GPMI_STAT=0xff000005
>> HW_GPMI_DEBUG=0x00000000
>> r->clock[0]=99000000
>> Scanning device for bad blocks
>> 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.
>> ...
>>
>>
>> Regards
>> Greg
>>
>>
>
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-01-29 12:43 ` Greg Ungerer
@ 2021-01-30 9:41 ` Michael Nazzareno Trimarchi
2021-02-01 14:13 ` Miquel Raynal
0 siblings, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-01-30 9:41 UTC (permalink / raw)
To: Greg Ungerer
Cc: Miquel Raynal, Sascha Hauer, Boris Brezillon, linux-mtd, Boris Brezillon
Hi Miquel
commit f8e6ad14388067f91b26d044185d95623fbc9535
Author: Michael Trimarchi <michael@amarulasolutions.com>
Date: Fri Jan 29 08:46:53 2021 +0100
mtd: nand: Calculate the clock before enable it
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Change-Id: I79b0da39de0a9b32ea0b002fa200d7f44d4f8ce7
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
index 322a008290e5..0bca52b3bc8f 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
@@ -377,6 +377,7 @@ static void gpmi_nfc_compute_timings(struct
gpmi_nand_data *this,
const struct nand_sdr_timings *sdr)
{
struct gpmi_nfc_hardware_timing *hw = &this->hw;
+ struct resources *r = &this->resources;
unsigned int dll_threshold_ps = this->devdata->max_chain_delay;
unsigned int period_ps, reference_period_ps;
unsigned int data_setup_cycles, data_hold_cycles, addr_setup_cycles;
@@ -440,6 +441,8 @@ static void gpmi_nfc_compute_timings(struct
gpmi_nand_data *this,
hw->ctrl1n |= BF_GPMI_CTRL1_RDN_DELAY(sample_delay_factor) |
BM_GPMI_CTRL1_DLL_ENABLE |
(use_half_period ? BM_GPMI_CTRL1_HALF_PERIOD : 0);
+
+ clk_set_rate(r->clock[0], hw->clk_rate);
}
void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
@@ -449,8 +452,6 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
void __iomem *gpmi_regs = r->gpmi_regs;
unsigned int dll_wait_time_us;
- clk_set_rate(r->clock[0], hw->clk_rate);
-
writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
writel(hw->timing1, gpmi_regs + HW_GPMI_TIMING1);
Right now I have this change applied and seems fine. That is the only
difference I get. Clock is apply a bit earlier that when is enabled
it.
Michael
On Fri, Jan 29, 2021 at 1:43 PM Greg Ungerer <gerg@kernel.org> wrote:
>
> Hi Michael,
>
> On 28/1/21 7:45 pm, Michael Nazzareno Trimarchi wrote:
> > Hi Greg
> >
> > On Tue, Aug 13, 2019 at 2:50 AM Greg Ungerer <gerg@kernel.org> wrote:
> >>
> >> Hi Boris,
> >>
> >> On 12/8/19 5:31 pm, Boris Brezillon wrote:
> >>> On Mon, 12 Aug 2019 12:50:36 +1000
> >> [snip]
> >>> Hm, CTRL1 is identical. Can you dump all regs at the beginning and at
> >>> the end of those funcs?
> >>
> >> Here is a more complete dump of registers. Trace points are at
> >> entry and exit of the respective functions in the different
> >> kernel versions. Register dumping code is identical for both.
> >>
> >>
> >> Linux version 4.16.0 (gerg@goober) (gcc version 4.8.3 (GCC)) #10 Tue Aug 13 10:24:28 AEST 2019
> >> ...
> >
> > I ran an overnight reboot process on linux-4.19.y tag: v4.19.169 and
> > I'm not able to reproduce up to now.
> >
> > Do you have an update from your side?
>
> I haven't seen the problem for a while now.
> I pretty much only run modern kernels, I am currently using 5.10.
> So I am guessing it was resolved somewhere at some point, but I
> don't know exactly what change resolved it.
>
> Regards
> Greg
>
>
>
> >> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
> >> HW_GPMI_CTRL0=0x00000000
> >> HW_GPMI_CTRL1=0x01c4000c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000400
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00010203
> >> HW_GPMI_TIMING1=0x00000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x00000000
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000000
> >> r->clock[0]=22000000
> >> 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: enable the asynchronous EDO mode 5
> >> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1073): gpmi_begin(): ENTRY
> >> HW_GPMI_CTRL0=0x01800001
> >> HW_GPMI_CTRL1=0x0104000c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000000
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00010203
> >> HW_GPMI_TIMING1=0x05000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x00000000
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000101
> >> r->clock[0]=99000000
> >> drivers/mtd/nand/gpmi-nand/gpmi-lib.c(1136): gpmi_begin(): EXIT
> >> HW_GPMI_CTRL0=0x01800001
> >> HW_GPMI_CTRL1=0x01c6800c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000000
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00010101
> >> HW_GPMI_TIMING1=0x90000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x00000000
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000101
> >> r->clock[0]=99000000
> >> Scanning device for bad blocks
> >> 5 ofpart 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.
> >> ...
> >>
> >> Note that the first ENTRY dump has no matching EXIT dump. From the
> >> code I assume it is returning from gpmi_begin() at the
> >> "if (!hw.sample_delay_factor)" check.
> >>
> >>
> >> And for the 5.1.14 kernel:
> >>
> >> Linux version 5.1.14 (gerg@goober) (gcc version 4.8.3 (GCC)) #27 Tue Aug 13 10:20:32 AEST 2019
> >> ...
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
> >> HW_GPMI_CTRL0=0x00000000
> >> HW_GPMI_CTRL1=0x01c4000c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000400
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00010203
> >> HW_GPMI_TIMING1=0x00000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x00000000
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000000
> >> r->clock[0]=22000000
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
> >> HW_GPMI_CTRL0=0x00000000
> >> HW_GPMI_CTRL1=0x0104000c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000400
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00020101
> >> HW_GPMI_TIMING1=0x60000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x00000000
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000000
> >> r->clock[0]=22000000
> >> random: fast init done
> >> 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
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
> >> HW_GPMI_CTRL0=0x01800001
> >> HW_GPMI_CTRL1=0x0104000c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000000
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00020101
> >> HW_GPMI_TIMING1=0x60000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x0000003f
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000101
> >> r->clock[0]=22000000
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
> >> HW_GPMI_CTRL0=0x01800001
> >> HW_GPMI_CTRL1=0x0104000c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000000
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00020101
> >> HW_GPMI_TIMING1=0xb0000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x0000003f
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000101
> >> r->clock[0]=22000000
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(512): gpmi_nfc_apply_timings(): ENTRY
> >> HW_GPMI_CTRL0=0x01800001
> >> HW_GPMI_CTRL1=0x0104000c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000000
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00020101
> >> HW_GPMI_TIMING1=0xb0000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x000000e0
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000000
> >> r->clock[0]=22000000
> >> drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c(536): gpmi_nfc_apply_timings(): EXIT
> >> HW_GPMI_CTRL0=0x01800001
> >> HW_GPMI_CTRL1=0x01c6800c
> >> HW_GPMI_COMPARE=0x00000000
> >> HW_GPMI_ECCCTRL=0x00000000
> >> HW_GPMI_ECCCOUNT=0x00000000
> >> HW_GPMI_PAYLOAD=0x00000000
> >> HW_GPMI_AUXILIARY=0x00000000
> >> HW_GPMI_TIMING0=0x00010101
> >> HW_GPMI_TIMING1=0xe0000000
> >> HW_GPMI_TIMING2=0x23023336
> >> HW_GPMI_DATA=0x000000e0
> >> HW_GPMI_STAT=0xff000005
> >> HW_GPMI_DEBUG=0x00000000
> >> r->clock[0]=99000000
> >> Scanning device for bad blocks
> >> 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.
> >> ...
> >>
> >>
> >> Regards
> >> Greg
> >>
> >>
> >
> >
--
Michael Nazzareno Trimarchi
Amarula Solutions BV
COO Co-Founder
Cruquiuskade 47 Amsterdam 1018 AM NL
T. +31(0)851119172
M. +39(0)3479132170
[`as] https://www.amarulasolutions.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-01-30 9:41 ` Michael Nazzareno Trimarchi
@ 2021-02-01 14:13 ` Miquel Raynal
2021-02-01 14:32 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Miquel Raynal @ 2021-02-01 14:13 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi Michael,
Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
Sat, 30 Jan 2021 10:41:29 +0100:
> Hi Miquel
>
> commit f8e6ad14388067f91b26d044185d95623fbc9535
> Author: Michael Trimarchi <michael@amarulasolutions.com>
> Date: Fri Jan 29 08:46:53 2021 +0100
>
> mtd: nand: Calculate the clock before enable it
>
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Change-Id: I79b0da39de0a9b32ea0b002fa200d7f44d4f8ce7
>
> diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> index 322a008290e5..0bca52b3bc8f 100644
> --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> @@ -377,6 +377,7 @@ static void gpmi_nfc_compute_timings(struct
> gpmi_nand_data *this,
> const struct nand_sdr_timings *sdr)
> {
> struct gpmi_nfc_hardware_timing *hw = &this->hw;
> + struct resources *r = &this->resources;
> unsigned int dll_threshold_ps = this->devdata->max_chain_delay;
> unsigned int period_ps, reference_period_ps;
> unsigned int data_setup_cycles, data_hold_cycles, addr_setup_cycles;
> @@ -440,6 +441,8 @@ static void gpmi_nfc_compute_timings(struct
> gpmi_nand_data *this,
> hw->ctrl1n |= BF_GPMI_CTRL1_RDN_DELAY(sample_delay_factor) |
> BM_GPMI_CTRL1_DLL_ENABLE |
> (use_half_period ? BM_GPMI_CTRL1_HALF_PERIOD : 0);
> +
> + clk_set_rate(r->clock[0], hw->clk_rate);
> }
>
> void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> @@ -449,8 +452,6 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> void __iomem *gpmi_regs = r->gpmi_regs;
> unsigned int dll_wait_time_us;
>
> - clk_set_rate(r->clock[0], hw->clk_rate);
> -
> writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
> writel(hw->timing1, gpmi_regs + HW_GPMI_TIMING1);
>
> Right now I have this change applied and seems fine. That is the only
> difference I get. Clock is apply a bit earlier that when is enabled
> it.
This is very interesting. So this would mean the issue you are
experiencing comes from the clock driver which kind of returns too
early from clk_set_rate()? Could you report this to the clk ML/NXP clk
maintainers and keep us in copy? If it is as global as it sounds, we
might not be the only ones affected.
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-02-01 14:13 ` Miquel Raynal
@ 2021-02-01 14:32 ` Michael Nazzareno Trimarchi
2021-02-01 15:08 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-02-01 14:32 UTC (permalink / raw)
To: Miquel Raynal
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi
On Mon, Feb 1, 2021 at 3:13 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Michael,
>
> Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> Sat, 30 Jan 2021 10:41:29 +0100:
>
> > Hi Miquel
> >
> > commit f8e6ad14388067f91b26d044185d95623fbc9535
> > Author: Michael Trimarchi <michael@amarulasolutions.com>
> > Date: Fri Jan 29 08:46:53 2021 +0100
> >
> > mtd: nand: Calculate the clock before enable it
> >
> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > Change-Id: I79b0da39de0a9b32ea0b002fa200d7f44d4f8ce7
> >
> > diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > index 322a008290e5..0bca52b3bc8f 100644
> > --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > @@ -377,6 +377,7 @@ static void gpmi_nfc_compute_timings(struct
> > gpmi_nand_data *this,
> > const struct nand_sdr_timings *sdr)
> > {
> > struct gpmi_nfc_hardware_timing *hw = &this->hw;
> > + struct resources *r = &this->resources;
> > unsigned int dll_threshold_ps = this->devdata->max_chain_delay;
> > unsigned int period_ps, reference_period_ps;
> > unsigned int data_setup_cycles, data_hold_cycles, addr_setup_cycles;
> > @@ -440,6 +441,8 @@ static void gpmi_nfc_compute_timings(struct
> > gpmi_nand_data *this,
> > hw->ctrl1n |= BF_GPMI_CTRL1_RDN_DELAY(sample_delay_factor) |
> > BM_GPMI_CTRL1_DLL_ENABLE |
> > (use_half_period ? BM_GPMI_CTRL1_HALF_PERIOD : 0);
> > +
> > + clk_set_rate(r->clock[0], hw->clk_rate);
> > }
> >
> > void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > @@ -449,8 +452,6 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > void __iomem *gpmi_regs = r->gpmi_regs;
> > unsigned int dll_wait_time_us;
> >
> > - clk_set_rate(r->clock[0], hw->clk_rate);
> > -
> > writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
> > writel(hw->timing1, gpmi_regs + HW_GPMI_TIMING1);
> >
> > Right now I have this change applied and seems fine. That is the only
> > difference I get. Clock is apply a bit earlier that when is enabled
> > it.
>
> This is very interesting. So this would mean the issue you are
> experiencing comes from the clock driver which kind of returns too
> early from clk_set_rate()? Could you report this to the clk ML/NXP clk
> maintainers and keep us in copy? If it is as global as it sounds, we
> might not be the only ones affected.
>
The imx28 is broken too, so it's a general problem. I need to trace it down
I have a reverting for lts but it\s not the way to go
Michael
> Thanks,
> Miquèl
--
Michael Nazzareno Trimarchi
Amarula Solutions BV
COO Co-Founder
Cruquiuskade 47 Amsterdam 1018 AM NL
T. +31(0)851119172
M. +39(0)3479132170
[`as] https://www.amarulasolutions.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-02-01 14:32 ` Michael Nazzareno Trimarchi
@ 2021-02-01 15:08 ` Michael Nazzareno Trimarchi
2021-02-01 15:14 ` Miquel Raynal
0 siblings, 1 reply; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-02-01 15:08 UTC (permalink / raw)
To: Miquel Raynal
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi
On Mon, Feb 1, 2021 at 3:32 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:
>
> Hi
>
> On Mon, Feb 1, 2021 at 3:13 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Hi Michael,
> >
> > Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> > Sat, 30 Jan 2021 10:41:29 +0100:
> >
> > > Hi Miquel
> > >
> > > commit f8e6ad14388067f91b26d044185d95623fbc9535
> > > Author: Michael Trimarchi <michael@amarulasolutions.com>
> > > Date: Fri Jan 29 08:46:53 2021 +0100
> > >
> > > mtd: nand: Calculate the clock before enable it
> > >
> > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > Change-Id: I79b0da39de0a9b32ea0b002fa200d7f44d4f8ce7
> > >
> > > diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > index 322a008290e5..0bca52b3bc8f 100644
> > > --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > @@ -377,6 +377,7 @@ static void gpmi_nfc_compute_timings(struct
> > > gpmi_nand_data *this,
> > > const struct nand_sdr_timings *sdr)
> > > {
> > > struct gpmi_nfc_hardware_timing *hw = &this->hw;
> > > + struct resources *r = &this->resources;
> > > unsigned int dll_threshold_ps = this->devdata->max_chain_delay;
> > > unsigned int period_ps, reference_period_ps;
> > > unsigned int data_setup_cycles, data_hold_cycles, addr_setup_cycles;
> > > @@ -440,6 +441,8 @@ static void gpmi_nfc_compute_timings(struct
> > > gpmi_nand_data *this,
> > > hw->ctrl1n |= BF_GPMI_CTRL1_RDN_DELAY(sample_delay_factor) |
> > > BM_GPMI_CTRL1_DLL_ENABLE |
> > > (use_half_period ? BM_GPMI_CTRL1_HALF_PERIOD : 0);
> > > +
> > > + clk_set_rate(r->clock[0], hw->clk_rate);
> > > }
> > >
> > > void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > > @@ -449,8 +452,6 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > > void __iomem *gpmi_regs = r->gpmi_regs;
> > > unsigned int dll_wait_time_us;
> > >
> > > - clk_set_rate(r->clock[0], hw->clk_rate);
> > > -
> > > writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
> > > writel(hw->timing1, gpmi_regs + HW_GPMI_TIMING1);
> > >
> > > Right now I have this change applied and seems fine. That is the only
> > > difference I get. Clock is apply a bit earlier that when is enabled
> > > it.
> >
> > This is very interesting. So this would mean the issue you are
> > experiencing comes from the clock driver which kind of returns too
> > early from clk_set_rate()? Could you report this to the clk ML/NXP clk
> > maintainers and keep us in copy? If it is as global as it sounds, we
> > might not be the only ones affected.
> >
>
> The imx28 is broken too, so it's a general problem. I need to trace it down
> I have a reverting for lts but it\s not the way to go
>
For imx28 you ask to set the rate to 22Mhz but you don't care about the clock
that you get back. You get back 12Mhz because the base clock is 24 Mhz and seems
that it can not get the point. You need to check if the clock
requested is in range or ask
for set_rate_clk_min to avoid to have somenthing lower. Then for
imx6ull because is sporadic
I think that is more connected to the clk_set_rate and when you change
the register. Can not be a
setting time?
Michael
> Michael
>
> > Thanks,
> > Miquèl
>
>
>
> --
> Michael Nazzareno Trimarchi
> Amarula Solutions BV
> COO Co-Founder
> Cruquiuskade 47 Amsterdam 1018 AM NL
> T. +31(0)851119172
> M. +39(0)3479132170
> [`as] https://www.amarulasolutions.com
--
Michael Nazzareno Trimarchi
Amarula Solutions BV
COO Co-Founder
Cruquiuskade 47 Amsterdam 1018 AM NL
T. +31(0)851119172
M. +39(0)3479132170
[`as] https://www.amarulasolutions.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-02-01 15:08 ` Michael Nazzareno Trimarchi
@ 2021-02-01 15:14 ` Miquel Raynal
2021-02-01 15:17 ` Michael Nazzareno Trimarchi
0 siblings, 1 reply; 50+ messages in thread
From: Miquel Raynal @ 2021-02-01 15:14 UTC (permalink / raw)
To: Michael Nazzareno Trimarchi
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi Michael,
Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
Mon, 1 Feb 2021 16:08:23 +0100:
> Hi
>
> On Mon, Feb 1, 2021 at 3:32 PM Michael Nazzareno Trimarchi
> <michael@amarulasolutions.com> wrote:
> >
> > Hi
> >
> > On Mon, Feb 1, 2021 at 3:13 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > >
> > > Hi Michael,
> > >
> > > Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> > > Sat, 30 Jan 2021 10:41:29 +0100:
> > >
> > > > Hi Miquel
> > > >
> > > > commit f8e6ad14388067f91b26d044185d95623fbc9535
> > > > Author: Michael Trimarchi <michael@amarulasolutions.com>
> > > > Date: Fri Jan 29 08:46:53 2021 +0100
> > > >
> > > > mtd: nand: Calculate the clock before enable it
> > > >
> > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > > Change-Id: I79b0da39de0a9b32ea0b002fa200d7f44d4f8ce7
> > > >
> > > > diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > index 322a008290e5..0bca52b3bc8f 100644
> > > > --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > @@ -377,6 +377,7 @@ static void gpmi_nfc_compute_timings(struct
> > > > gpmi_nand_data *this,
> > > > const struct nand_sdr_timings *sdr)
> > > > {
> > > > struct gpmi_nfc_hardware_timing *hw = &this->hw;
> > > > + struct resources *r = &this->resources;
> > > > unsigned int dll_threshold_ps = this->devdata->max_chain_delay;
> > > > unsigned int period_ps, reference_period_ps;
> > > > unsigned int data_setup_cycles, data_hold_cycles, addr_setup_cycles;
> > > > @@ -440,6 +441,8 @@ static void gpmi_nfc_compute_timings(struct
> > > > gpmi_nand_data *this,
> > > > hw->ctrl1n |= BF_GPMI_CTRL1_RDN_DELAY(sample_delay_factor) |
> > > > BM_GPMI_CTRL1_DLL_ENABLE |
> > > > (use_half_period ? BM_GPMI_CTRL1_HALF_PERIOD : 0);
> > > > +
> > > > + clk_set_rate(r->clock[0], hw->clk_rate);
> > > > }
> > > >
> > > > void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > > > @@ -449,8 +452,6 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > > > void __iomem *gpmi_regs = r->gpmi_regs;
> > > > unsigned int dll_wait_time_us;
> > > >
> > > > - clk_set_rate(r->clock[0], hw->clk_rate);
> > > > -
> > > > writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
> > > > writel(hw->timing1, gpmi_regs + HW_GPMI_TIMING1);
> > > >
> > > > Right now I have this change applied and seems fine. That is the only
> > > > difference I get. Clock is apply a bit earlier that when is enabled
> > > > it.
> > >
> > > This is very interesting. So this would mean the issue you are
> > > experiencing comes from the clock driver which kind of returns too
> > > early from clk_set_rate()? Could you report this to the clk ML/NXP clk
> > > maintainers and keep us in copy? If it is as global as it sounds, we
> > > might not be the only ones affected.
> > >
> >
> > The imx28 is broken too, so it's a general problem. I need to trace it down
> > I have a reverting for lts but it\s not the way to go
> >
>
> For imx28 you ask to set the rate to 22Mhz but you don't care about the clock
> that you get back. You get back 12Mhz because the base clock is 24 Mhz and seems
> that it can not get the point. You need to check if the clock
> requested is in range or ask
> for set_rate_clk_min to avoid to have somenthing lower. Then for
> imx6ull because is sporadic
> I think that is more connected to the clk_set_rate and when you change
> the register. Can not be a
> setting time?
So, if I understand correctly, we face two different problems:
- imx6*: seems like a clock issue regarding the clock settlement
- imx28: actual NAND driver issue (does not check the validity of the
new frequency). This should be handled properly in
->setup_interface().
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI iMX6ull timeout on DMA
2021-02-01 15:14 ` Miquel Raynal
@ 2021-02-01 15:17 ` Michael Nazzareno Trimarchi
0 siblings, 0 replies; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-02-01 15:17 UTC (permalink / raw)
To: Miquel Raynal
Cc: linux-mtd, Sascha Hauer, Greg Ungerer, Boris Brezillon, Boris Brezillon
Hi
On Mon, Feb 1, 2021 at 4:14 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Michael,
>
> Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> Mon, 1 Feb 2021 16:08:23 +0100:
>
> > Hi
> >
> > On Mon, Feb 1, 2021 at 3:32 PM Michael Nazzareno Trimarchi
> > <michael@amarulasolutions.com> wrote:
> > >
> > > Hi
> > >
> > > On Mon, Feb 1, 2021 at 3:13 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > > >
> > > > Hi Michael,
> > > >
> > > > Michael Nazzareno Trimarchi <michael@amarulasolutions.com> wrote on
> > > > Sat, 30 Jan 2021 10:41:29 +0100:
> > > >
> > > > > Hi Miquel
> > > > >
> > > > > commit f8e6ad14388067f91b26d044185d95623fbc9535
> > > > > Author: Michael Trimarchi <michael@amarulasolutions.com>
> > > > > Date: Fri Jan 29 08:46:53 2021 +0100
> > > > >
> > > > > mtd: nand: Calculate the clock before enable it
> > > > >
> > > > > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> > > > > Change-Id: I79b0da39de0a9b32ea0b002fa200d7f44d4f8ce7
> > > > >
> > > > > diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > > b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > > index 322a008290e5..0bca52b3bc8f 100644
> > > > > --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > > +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c
> > > > > @@ -377,6 +377,7 @@ static void gpmi_nfc_compute_timings(struct
> > > > > gpmi_nand_data *this,
> > > > > const struct nand_sdr_timings *sdr)
> > > > > {
> > > > > struct gpmi_nfc_hardware_timing *hw = &this->hw;
> > > > > + struct resources *r = &this->resources;
> > > > > unsigned int dll_threshold_ps = this->devdata->max_chain_delay;
> > > > > unsigned int period_ps, reference_period_ps;
> > > > > unsigned int data_setup_cycles, data_hold_cycles, addr_setup_cycles;
> > > > > @@ -440,6 +441,8 @@ static void gpmi_nfc_compute_timings(struct
> > > > > gpmi_nand_data *this,
> > > > > hw->ctrl1n |= BF_GPMI_CTRL1_RDN_DELAY(sample_delay_factor) |
> > > > > BM_GPMI_CTRL1_DLL_ENABLE |
> > > > > (use_half_period ? BM_GPMI_CTRL1_HALF_PERIOD : 0);
> > > > > +
> > > > > + clk_set_rate(r->clock[0], hw->clk_rate);
> > > > > }
> > > > >
> > > > > void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > > > > @@ -449,8 +452,6 @@ void gpmi_nfc_apply_timings(struct gpmi_nand_data *this)
> > > > > void __iomem *gpmi_regs = r->gpmi_regs;
> > > > > unsigned int dll_wait_time_us;
> > > > >
> > > > > - clk_set_rate(r->clock[0], hw->clk_rate);
> > > > > -
> > > > > writel(hw->timing0, gpmi_regs + HW_GPMI_TIMING0);
> > > > > writel(hw->timing1, gpmi_regs + HW_GPMI_TIMING1);
> > > > >
> > > > > Right now I have this change applied and seems fine. That is the only
> > > > > difference I get. Clock is apply a bit earlier that when is enabled
> > > > > it.
> > > >
> > > > This is very interesting. So this would mean the issue you are
> > > > experiencing comes from the clock driver which kind of returns too
> > > > early from clk_set_rate()? Could you report this to the clk ML/NXP clk
> > > > maintainers and keep us in copy? If it is as global as it sounds, we
> > > > might not be the only ones affected.
> > > >
> > >
> > > The imx28 is broken too, so it's a general problem. I need to trace it down
> > > I have a reverting for lts but it\s not the way to go
> > >
> >
> > For imx28 you ask to set the rate to 22Mhz but you don't care about the clock
> > that you get back. You get back 12Mhz because the base clock is 24 Mhz and seems
> > that it can not get the point. You need to check if the clock
> > requested is in range or ask
> > for set_rate_clk_min to avoid to have somenthing lower. Then for
> > imx6ull because is sporadic
> > I think that is more connected to the clk_set_rate and when you change
> > the register. Can not be a
> > setting time?
>
> So, if I understand correctly, we face two different problems:
> - imx6*: seems like a clock issue regarding the clock settlement
> - imx28: actual NAND driver issue (does not check the validity of the
> new frequency). This should be handled properly in
> ->setup_interface().
I'm planning to work on it, I need to deliver on the field updates on
the new LTS release.
Everything is correct what you said. I will check and try to fix the
issues properly after this
Michael
>
> Thanks,
> Miquèl
--
Michael Nazzareno Trimarchi
Amarula Solutions BV
COO Co-Founder
Cruquiuskade 47 Amsterdam 1018 AM NL
T. +31(0)851119172
M. +39(0)3479132170
[`as] https://www.amarulasolutions.com
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 50+ messages in thread
* Re: GPMI IMX6ull timeout on dma
2018-10-02 13:22 GPMI IMX6ull timeout on dma Michael Nazzareno Trimarchi
@ 2018-10-04 14:36 ` Michael Nazzareno Trimarchi
0 siblings, 0 replies; 50+ messages in thread
From: Michael Nazzareno Trimarchi @ 2018-10-04 14:36 UTC (permalink / raw)
To: Han Xu, Boris Brezillon; +Cc: linux-mtd
Hi
I add now this code but nand seems incosistent
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index c2597c8107a0..b1598dc5013f 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -466,11 +466,9 @@ void prepare_data_dma(struct gpmi_nand_data
*this, enum dma_data_direction dr)
this->direct_dma_map_ok = false;
}
-/* This will be called after the DMA operation is finished. */
-static void dma_irq_callback(void *param)
+static void dma_unmap_request(void *param)
{
struct gpmi_nand_data *this = param;
- struct completion *dma_c = &this->dma_done;
switch (this->dma_type) {
case DMA_FOR_COMMAND:
@@ -492,11 +490,18 @@ static void dma_irq_callback(void *param)
case DMA_FOR_WRITE_ECC_PAGE:
/* We have to wait the BCH interrupt to finish. */
break;
-
default:
dev_err(this->dev, "in wrong DMA operation.\n");
}
+}
+
+/* This will be called after the DMA operation is finished. */
+static void dma_irq_callback(void *param)
+{
+ struct gpmi_nand_data *this = param;
+ struct completion *dma_c = &this->dma_done;
+ dma_unmap_request(param);
complete(dma_c);
}
Michael
On Tue, Oct 2, 2018 at 3:22 PM Michael Nazzareno Trimarchi
<michael@amarulasolutions.com> wrote:
>
> 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
--
| Michael Nazzareno Trimarchi Amarula Solutions BV |
| COO - Founder Cruquiuskade 47 |
| +31(0)851119172 Amsterdam 1018 AM NL |
| [`as] http://www.amarulasolutions.com |
^ permalink raw reply [flat|nested] 50+ 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; 50+ 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] 50+ messages in thread
end of thread, back to index
Thread overview: 50+ 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
-- 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
Linux-mtd Archive on lore.kernel.org
Archives are clonable:
git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
linux-mtd@lists.infradead.org
public-inbox-index linux-mtd
Example config snippet for mirrors
Newsgroup available over NNTP:
nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git