ts-7000
[Top] [All Lists]

[ts-7000] TS-7390 tssdcard and tsuart driver incompatibility with DMA

To:
Subject: [ts-7000] TS-7390 tssdcard and tsuart driver incompatibility with DMA
From: "Doug" <>
Date: Fri, 07 Aug 2009 21:36:09 -0000
Hi,

We've been working on a project that uses the TS-7390 and we're finding a weird 
bug that is causing the SD card driver to get screwed up. I believe it's a bug 
in either the tsuart drivers or the tssdcard driver. I can reproduce the 
problem with a brand new SD card, after dd'ing the 512mbsd-latest.dd file from 
the TS FTP site to it (which contains the latest tsuart and tssdcard drivers).

It seems that when reading simultaneously from ttts0 and the SD card, the SD 
card gets messed up and starts returning corrupt data whenever reading from it. 
The file system starts exhibiting strange behavior showing empty directories 
and incorrect file content, but the data on the card itself is fine once I 
reboot.

If I rmmod tssdcard.ko and re-insmod it again, the problem is still there. 
After it happens I am no longer able to re-mount any file systems on the SD 
card.

The problem does not show up when reading from the AMBA serial ports (ttyAM*). 
I haven't tested on any of the other FPGA serial ports, but I can confirm that 
the behavior occurs with ttts0.

I have found a workaround--if the SD card driver is loaded with the parameter 
dmaenable=0, the problem never occurs. So I'm guessing this bug has something 
to do with DMA. If the problem has already occurred, I can actually unload the 
module and reload it with the dmaenable=0 parameter, and it works fine.

The bug may not be obvious to see unless you drop the disk caches before doing 
every read operation on the SD card -- otherwise you may not notice the SD card 
is not working, because it's using a disk cache in RAM. To drop the caches, you 
do: echo 3 > /proc/sys/vm/drop_caches

If you don't drop the disk cache, files you've already read (and the 
filesystem) will probably still show up okay. But if you try to open a 
different file after the problem has occurred, it will be messed up.

If I open ttts0 without reading from it, the problem doesn't occur. It only 
happens when data is coming into the serial port and it is actually being read 
by a program, at the same time as SD card operations. I have uploaded a test 
shell script that attempts to reproduce the problem to the Files section of 
this group, using "cat" to read from the serial port. It's called 
"causeSDProblem"

Boot from the SD card, put that file in /mnt/root, chmod +x it, and run it (I'd 
run it with the SD /mnt/root mounted read-only). It will sit there and display 
nothing. What it's doing is comparing the SD's version of itself to a copy of 
itself it stored in RAM over and over again. If it's sitting there doing 
nothing that means it's not finding any problems.

As soon as you start externally sending data to the ttts0 serial port, the 
program will exit because either the read of itself failed, or the data it read 
was different from the original copy of itself that it read into RAM.

Anyone else seen this happen? I am reporting it to TS and will refer them to 
this post, and figured this would be the best place to write this info down.

Doug



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU