public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* davinci_mmc issues on kernel 3.17.0
@ 2014-11-19 14:32 Angelo Dureghello
  2014-11-19 15:31 ` Angelo Dureghello
  0 siblings, 1 reply; 4+ messages in thread
From: Angelo Dureghello @ 2014-11-19 14:32 UTC (permalink / raw)
  To: linux-mmc

Dear all,

i am moving from a working 3.5.1 kernel to the 3.17.0.
My system is am1808 (ti arm) based, and i access a 4 data
wires microsd card.

mmc access is not working properly anymore on kernel
3.17.0

For example, trying a simple mkfs.ext3 on the mmc card, verifying
just after with fsck.ext3, i get several errors. Similarly, i get errors
if i use ext2, ext4 or fa.

See below:



|kernel 3.5.1

|
||
|[root@barix ~]# mkfs.ext3 /dev/mmcblk0p1 |
|mke2fs 1.42.4 (12-June-2012) |
|Filesystem label= |
|OS type: Linux |
|Block size=4096 (||log||=2) |
|Fragment size=4096 (||log||=2) |
|Stride=0 blocks, Stripe width=0 blocks |
|488640 inodes, 1952881 blocks |
|97644 blocks (5.00%) reserved ||for| |the super user |
|First data block=0 |
|Maximum filesystem blocks=2000683008 |
|60 block groups |
|32768 blocks per group, 32768 fragments per group |
|8144 inodes per group |
|Superblock backups stored on blocks: |
|||32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 |
||
|Allocating group tables: done |
|Writing inode tables: done |
|Creating journal (32768 blocks): done |
|Writing superblocks and filesystem accounting information: done

** fsck now gives a clean state. **


|
||
|kernel 3.17.0 |
||
|
[root@barix ~]# mkfs.ext3 /dev/mmcblk0p1 |
|mke2fs 1.42.4 (12-June-2012) |
|Filesystem label= |
|OS type: Linux |
|Block size=4096 (||log||=2) |
|Fragment size=4096 (||log||=2) |
|Stride=0 blocks, Stripe width=0 blocks |
|240000 inodes, 959232 blocks |
|47961 blocks (5.00%) reserved ||for| |the super user |
|First data block=0 |
|Maximum filesystem blocks=985661440 |
|30 block groups |
|32768 blocks per group, 32768 fragments per group |
|8000 inodes per group |
|Superblock backups stored on blocks: |
|||32768, 98304, 163840, 229376, 294912, 819200, 884736 |
||
|Allocating group tables: done |
|Writing inode tables: done |
|Creating journal (16384 blocks): done |
|Writing superblocks and filesystem accounting information: done

||
[root@barix ~]# fsck.ext3 /dev/mmcblk0p1
e2fsck 1.42.4 (12-June-2012)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext3: Group descriptors look bad... trying backup blocks...
Superblock has an invalid journal (inode 8).
Clear<y>? Automount: /dev/mmcblk0p1 inserted
Automount: DEVICE LOCK found quiting...
yes
*** ext3 journal has been deleted - filesystem is now ext2 only ***

/dev/mmcblk0p1 was not cleanly unmounted, check forced.
Resize inode not valid.  Recreate<y>? yes
Pass 1: Checking inodes, blocks, and sizes
The bad block inode looks invalid.  Clear<y>? yes
Root inode is not a directory.  Clear<y>? yes
Inode 5 has EXTENTS_FL flag set on filesystem without extents support.
Clear<y>? yes
Inode 6 has EXTENTS_FL flag set on filesystem without extents support.
Clear<y>? yes
Inode 8 has EXTENTS_FL flag set on filesystem without extents support.
Clear<y>? yes
Inode 9 has EXTENTS_FL flag set on filesystem without extents support.
Clear<y>? yes
Inode 10 has EXTENTS_FL flag set on filesystem without extents support.
Clear<y>?
.... (continue)


I am suspecting of a mmc driver issue, or, something new to be set
from my board.c.

I also strangely see different inodes number, in kernel 3.5.1 are double.

hope in some help,

Regards,
angelo


|

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

* Re: davinci_mmc issues on kernel 3.17.0
  2014-11-19 14:32 davinci_mmc issues on kernel 3.17.0 Angelo Dureghello
@ 2014-11-19 15:31 ` Angelo Dureghello
  2014-11-20 11:24   ` Angelo Dureghello
  0 siblings, 1 reply; 4+ messages in thread
From: Angelo Dureghello @ 2014-11-19 15:31 UTC (permalink / raw)
  To: linux-mmc

Hi,

did an additional test, that i hope can help:

- prepared a 16K ASCI pattern of 0x30,0x31,0x30,0x31.. and so
- written to mmc sd

[root@barix boot]# cat 16kpattern.hex > /dev/mmcblk0p1
[root@barix boot]# Automount: /dev/mmcblk0p1 inserted
Automount: DEVICE LOCK found quiting...


[root@barix boot]# cat /dev/mmcblk0p1

i could read out _only_ 8K of patterns bytes and then i see other fs 
bytes just after.

So seems i can't write 8K blocks, seems 4K are truncated.

Regards
angelo

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

* Re: davinci_mmc issues on kernel 3.17.0
  2014-11-19 15:31 ` Angelo Dureghello
@ 2014-11-20 11:24   ` Angelo Dureghello
  2014-11-20 18:32     ` Angelo Dureghello
  0 siblings, 1 reply; 4+ messages in thread
From: Angelo Dureghello @ 2014-11-20 11:24 UTC (permalink / raw)
  To: linux-mmc

Sorry for the confusion,

i realized the card i use in the old kernel board is 8G, the one in 
kernel 3.17.0 is 4G,
so the size / inodes i see in mkfs or fdisk are correct.

I can confirm i have issues on the "write" part. With whatever FS,
if i format the card on PC, and then
fsck on the arm device board with kernel 3.17.0, fsck find no errors.
While if i mkfs on kernel 3.17.0 and then put the card on PC, it can't 
even be mounted,
and fsck gives errors.

I finally run mmc_test, in both PIO 4-bit and DMA 4-bit modes:

in PIO, all tests pass except 17
[root@barix boot]# echo 17 > /sys/kernel/debug/mmc0/mmc0\:0002/test
mmc0: Starting tests of card mmc0:0002...
mmc0: Test case 17. Correct xfer_size at write (midway failure)...
mmc0: Result: ERROR (-84)
mmc0: Tests completed

in DMA, test 17 fails too, and test 25 locks up.

[root@barix boot]# echo 17 > /sys/kernel/debug/mmc0/mmc0\:0002/test
mmc0: Starting tests of card mmc0:0002...
mmc0: Test case 17. Correct xfer_size at write (midway failure)...
mmc0: Result: ERROR (-84)
mmc0: Tests completed.

[root@barix boot]# echo 25 > /sys/kernel/debug/mmc0/mmc0\:0002/test
mmc0: Starting tests of card mmc0:0002...
mmc0: Test case 25. Best-case read performance into scattered pages...
edma-dma-engine edma-dma-engine.1: edma_prep_slave_sg: Failed to 
allocate slot


so seems i have some additional dma issue.

regards


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

* Re: davinci_mmc issues on kernel 3.17.0
  2014-11-20 11:24   ` Angelo Dureghello
@ 2014-11-20 18:32     ` Angelo Dureghello
  0 siblings, 0 replies; 4+ messages in thread
From: Angelo Dureghello @ 2014-11-20 18:32 UTC (permalink / raw)
  To: linux-mmc

Hi,

i fixed my mmc r/w issues.

In PIO 4-bit mode the davinci mmc host driver passed all the
mmc_test driver tests. But for some reason, in kernel 3.17,
i still have issues when i "fsck" just after the mkfs.
I still see errors.

So i moved back to DMA 4-bit mode (DMA/TI EDMA engine enabled),
as my board was working in kernel 3.5.1.

In DMA mode, there was some conditions where the mmc access
was blocking. This was due to the fact that the davinci mmc
host driver was not able to get all the edma chan slots needed
for the r/w operations. This because my board.c was reserving
several chans / slots for the audio.

I reduced those reservations, and all is fine.

Regards
Angelo

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

end of thread, other threads:[~2014-11-20 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-19 14:32 davinci_mmc issues on kernel 3.17.0 Angelo Dureghello
2014-11-19 15:31 ` Angelo Dureghello
2014-11-20 11:24   ` Angelo Dureghello
2014-11-20 18:32     ` Angelo Dureghello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox