RE: spi-imx: extra data in rxfifo after DMA transfer on i.MX6q

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> Sent: 2018年12月21日 18:31
> To: Robin Gong <yibin.gong@xxxxxxx>
> Cc: kernel@xxxxxxxxxxxxxx; linux-spi@xxxxxxxxxxxxxxx
> Subject: spi-imx: extra data in rxfifo after DMA transfer on i.MX6q
> 
> Hello Robin,
> 
> while debugging a problem where sometimes reading from an spi flash
> contains wrong data in the read stream I stumbled over
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.ke
> rnel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Fc
> ommit%2F%3Fid%3Df62caccd12c17e4cb516d43a6e4dd8a3abc1f7e0&amp;dat
> a=02%7C01%7Cyibin.gong%40nxp.com%7C885ec75727814a97d16808d6672f6
> 10d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63680985052095
> 1429&amp;sdata=w%2FTS6yuvVJmOpTA6ZZXGFmCBUODd5k5Z1zaqUbJgWvQ
> %3D&amp;reserved=0
> .
> 
> I'm on i.MX6q, but the problem you described in the note does seem to match
> exactly my problem. Are you aware of more details for this problem? When
> disabling DMA the problem isn't reproducible.
Yes, this is a common ecspi hardware issue which means it should be on all i.mx6 legacy
Family(including i.mx6q/dl/sl/sx and i.mx7d), though it may not easily be reproduced on
some chip like i.mx6dl.  Design team fix the issue from i.mx6ul (including i.mx6ul/ull/sll),
software workround should be apply before i.mx6ul. I will make the patch set once I
have bandwidth, Thanks for your report :)
PS: please check below errata (ERR009165):
https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf
 
> 
> What I actually do to get the problem (sometimes) is:
> 
>         check_one() {
>                 mtdpath="$1"
>                 pattern="$2"
> 
>                 echo "$pattern" > "$mtdpath"
>                 mtdcontent="$(head -c ${#pattern} $mtdpath)"
> 
>                 test "$pattern" = "$mtdcontent"
>         }
> 
>         check() {
>                 i=0
>                 while check_one "$@"; do ((i++)); echo "good $i"; done
>         }
> 
> 	check /dev/mtd0 Pattern123Pattern123Pattern123
> 
> (mtd0 is an MRAM, so no need for erase).
> 
> In the error case I get:
> 
> 	# hexdump -C /dev/mtd0 | head -n 2
>         00000000  ff 50 61 74 74 65 72 6e  31 32 33 50 61 74 74 65
> |.Pattern123Patte|
>         00000010  72 6e 31 32 33 50 61 74  74 65 72 6e 31 32 33 0a
> |rn123Pattern123.|
> 
> which is reproducible until the spi driver is rebound.
> 
> Best regards
> Uwe
> 
> --
> Pengutronix e.K.                           | Uwe Kleine-König
> |
> Industrial Linux Solutions                 |
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> pengutronix.de%2F&amp;data=02%7C01%7Cyibin.gong%40nxp.com%7C885ec
> 75727814a97d16808d6672f610d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7
> C0%7C0%7C636809850520951429&amp;sdata=XFB25YDJTsIS1USgxhvPVsJ9T
> T86eWFQb%2B%2BoCdCvqyI%3D&amp;reserved=0  |




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux