On 9/8/21 2:05 AM, Cheng, Xuzhou wrote:
Thanks Bin added me into this loop.
Hi, Guenter
I am interested in your patch and the issue what you found. I want to reproduce
your issue on Linux, but I failed, the spi-nor of sabrelite on Linux does not
work.
Could you share your Linux kernel version? It would be great if you can share
the detailed steps to reproduce.
My test record:
Linux version: https://github.com/torvalds/linux, the last commit is
ac08b1c68d1b1ed3cebb218fc3ea2c07484eb07d.
Linux configuration: imx_v6_v7_defconfig.
QEMU command:
qemu-system-arm -nographic -M sabrelite -smp 4 -m 1G -serial null -serial /dev/pts/50
-kernel zImage -initrd rootfs.ext4 -append "root=/dev/ram rdinit=sbin/init"
-dtb imx6q-sabrelite.dtb -net nic -net tap,ifname=tap_xcheng,script=no -drive
file=flash.sabre,format=raw,if=mtd
Logs: there are same logs when I apply your patch or not apply. So I don't
understand what this patch fixes, maybe I missed something? :(...
# cat /proc/mtd
dev: size erasesize name
mtd0: 00200000 00001000 "spi0.0"
# ls /dev/mtd*
/dev/mtd0 /dev/mtd0ro /dev/mtdblock0
# echo "01234567899876543210" > test
# dd if=test of=/dev/mtd0 /* flash.sabre is empty */
0+1 records in
0+1 records out
# dd if=/dev/mtd0 of=test_out
4096+0 records in
4096+0 records out
# cat test_out /* test_out is empty */
It is a flash. I don't think dd erases the flash, so unless your flash.sabre
is all-ones you probably won't see the overwritten data.
Guenter