0

I wrote an SD host-controller Linux driver for a totally customized board, using IP TE4395.


With the driver I wrote,

  • I can mount an SD card, read and write.
  • when mounted, once I umount, the next mount will fail.
  • command mount -o remount /dev/mmcblk0p1 worked normally....

# ls /mnt/
aaa.txt     lost+found
# mount -o remount /dev/mmcblk0p1
EXT4-fs (mmcblk0p1): re-mounted. Opts: block_validity,delalloc,barrier,user_xattr,acl
# echo adfaf >/mnt/bbb.txt
# ls /mnt/
aaa.txt     bbb.txt     lost+found
# cat /mnt/bbb.txt
adfaf
# sync
# ls /mnt/
aaa.txt     bbb.txt     lost+found
# umount /mnt/
# mount /dev/mmcblk0p1 /mnt
mount: mounting /dev/mmcblk0p1 on /mnt failed: Invalid argument
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
jianing
  • 153
  • 1
  • 1
  • 9

1 Answers1

0

I know the reason. the driver has a problem. I added some code for debug, that read register when driver write registers. And the Data Port register is special, when access the register the buffer pointer inside the controller will be incremented automatically. The debug code read before and after write to the register, so accessed the register 3 times, but expected just 1 time access(write).

jianing
  • 153
  • 1
  • 1
  • 9