This has already been discussed at some length on #rockbox, but I thought best to archive this information here for possible future reference.
Enabling ATA DMA on pp5020 targets, as introduced in
r24405, breaks disk use on my Nano 1G 2GB (which I originally acquired right after the launch). Possible problems include:
1) "No .rockbox directory / Installation incomplete" on svn, or on earlier revisions I've tried, "No partition found. Insert USB cable and fix it.", on boot. Firmware boots normally, but doesn't see anything on the disk.
2) All writes by rockbox to the file system get corrupted with funny filenames. (~NVR@I.IN, nvr`m*"in, NVRAM.BHN, etc)
3) Extremely slow/stalled boot (constant disk I/O, so probably bottlenecked by it).
Cooling the device down from the ambient 25°C/77°F before booting makes it start up normally, but after a song or two it starts skipping, then looping randomly from the file system (from different songs accompanied by MPEG clicks and pops) before either halting or crashing with a "*PANIC* Dir entry 2 in sector 0 is not free! E1 50 4F 44" or similar message.
Similarly, heating the unit greatly increases the severity of the slighest problem. Original firmware works fine, and I did a full restore to see if a fresh install of rockbox would help, and it didn't, either.
Someone on #rockbox suggested the UDMA timings, which I proceeded to test by forcing ATA_MAX_UDMA to always be 1 (instead of 2 when >= 30MHz), but this did not correct the problem.
So, I took r27545, commented out the following line from /firmware/export/config/ipodnano1g.h to disable DMA entirely (falling back to PIO)...
/* DMA is used only for reading on PP502x because although reads are ~8x faster
* writes appear to be ~25% slower.
*/
#define HAVE_ATA_DMA
... and some compiling later, everything works. Even when heated so the backplate is hot to touch. So, obviously, at least on my Nano 1G, something is wrong with the ATA DMA implementation.
My problems originally started after upgrading Rockbox to current, so it took some work to find out what caused the sudden problems. As most nanos are just fine with DMA reads, it's certainly a mystery why mine is the only one showing symptoms of this. It's possible that someone else has run into this bug but attributed it to aging hardware or just unstable software.
Attached is a patch to disable ATA DMA altogether, in case I'm not alone with my troubles.
Here's a list of revisions I tried as written proof of the existence of the problem (there are some doubting Thomases ;)
r27544 BAD
r25642 BAD
r24691 BAD
r24572 BAD
r24453 BAD
r24424 BAD
r24413 BAD
r24405 BAD enables ATA DMA on pp5020
r24404 GOOD
r24397 GOOD
r24394 GOOD
r24334 GOOD
r24216 GOOD
r23740 GOOD