New: Compact Flash HD: dma and seek_error/badCRC problems
http://bugzilla.kernel.org/show_bug.cgi?id=10436
Summary: Compact Flash HD: dma and seek_error/badCRC problems
Product: IO/Storage
Version: 2.5
KernelVersion: 2.6.24.3 / 2.6.24.4
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: IDE
AssignedTo: [email protected]
ReportedBy: [email protected]Latest working kernel version: 2.6.22 about DMA only
Earliest failing kernel version:
Distribution: Debian testing (Lenny)
Hardware Environment: Mini-ITX VIA EPIA SN Motherboard, Sandisk SDCFX4-8192 Compact Flash (hda), Maxtor PATA HD (hdb)
Problem Description:
I'm going to report two different problems but maybe related one with the other.
I own a VIA SN board that comes with VIA VT8251 South Bridge (that includes a VT82C5xx IDE interface). It has a single PATA connector (allowing thus max two PATA drives) and a CF connector soldered in the back of the board (allowing thus one CF and one PATA drive).
The SanDisk Extreme IV CF I'm using is udma4 capable and rated for 40MB/s.
The first problem:
With a 2.6.24 kernel I see in dmesg:
hda: drive side 80-wire cable detection failed, limiting max speed to UDMA33
hda: UDMA/33 mode selected
and the CF drive is reported to work with udma2 by hdparm:
DMA: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4
Using dd for some testing, the max throughput "speed" reached is about 28MB/s, accordingly with the configuration above.
However I discovered that using a 2.6.22 kernel, dmesg still reports that message but the kernel configures my CF to use udma4 as it should. Now dd shows a 38MB/s (about) "speed", reaching the maximum speed for this CF. Well, I don't really know how the CF slot is connected to the South Bridge but for sure there are really short traces, and I think I can safely say I had no data corruption using a 2.6.22 kernel and udma4 mode.
Changing the disk BIOS settings has no influence at all.
It seems I'm not the only one suffering this problem:
http://crazyduke.blogspot.com/2007/12/cflinux.html
It's not a big issue, really, but I'd like to understand why this happens and how to use my CF at full speed with udma4.
The second problem:
Adding a second HD (Maxtor PATA UDMA/133) results in a udma0 setting (for this drive, while the CF behaves normally) and in lots of errors in dmesg:
[...]
hdb: dma_intr: status=0x51 { DriveReady SeekComplete Error }
hdb: dma_intr: error=0x84 { DriveStatusError BadCRC }
ide: failed opcode was: unknown
hda: DMA disabled
hdb: UDMA/100 mode selected
ide0: reset: success
[...]
hdb: dma_intr: status=0x51 { DriveReady SeekComplete Error }
hdb: dma_intr: error=0x84 { DriveStatusError BadCRC }
ide: failed opcode was: unknown
hdb: no DMA mode selected
ide0: reset: success ldm_validate_partition_table(): Disk read failed. Dev hdb: unable to read RDB block 0
unable to read partition table
Once the system was up, only /dev/hdb had been created and I had to rewrite the partition table to the disk to see the partitions on it and correctly access them. However when I tried to set udma6 or udma4/2 with hdparm I obtained just a udma0 mode (infatc the system is lagging when coping files). I don't think I had data corruption, but in this case I'm not that sure.
In the beginning I though that the CF does not want to share the ide channel with another device. However I had no problem when I connected a (really) old CDROM instead (using mdma2), for the system installation to the CF. Using a 2.6.22 or a 2.6.24 kernel makes no difference.
Here it is a similar problem but without a solution:
http://readlist.com/lists/vger.kernel.org/linux-kernel/69/348695.html
Again, not a huge problem since I'm going to buy a larger SATA drive soon, but maybe it's usefull to understand why this happens.
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #1 from [email protected] 2008-04-10 06:01 ------- Created an attachment (id=15717)
--> (http://bugzilla.kernel.org/attachment.cgi?id=15717&action=view)
dmes and test logs
Here are some datas, reporting the first problem, executed under debian with 2.6.22 and 2.6.24 plus ubuntu 7.10 livecd using a 2.6.22 kernel. Let me know if further testing is needed.
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #2 from [email protected] 2008-04-10 06:57 ------- No real suprises there
CF devices and adapters are sometimes good enough for UDMA at 66MHz or better but forget to report the cable detection. For those boards we keep tables and if you provide the output of dmidecode that can be updated to include this board (in the windows world vendors ship drivers so they can knobble the check in their driver or .inf file)
High UDMA modes demand good cable and signal quality and we regularly see mixed CF and disk on the same cable as failing (the CRC message is signal corruption on the wire). I don't therefore think this is a software bug
The dmidecode and lspci -vvxxx output would be nice so we can let the kernel know your system has a hardwired DMA capable CF slot and automate that bit.
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #3 from [email protected] 2008-04-10 12:21 ------- Created an attachment (id=15724)
--> (http://bugzilla.kernel.org/attachment.cgi?id=15724&action=view)
dmidecode output
I'm afraid dmi data isn't much of help. As you can see at
http://www.lm-sensors.org/ticket/2298 this problem already occurred with sensors-detect, due to a non-standard address in the SuperIO chip. Maybe asking VIA a BIOS containing a motherboard identifier string would help? However I have two questions for you:
1) Why does it work using udma4 with the previous 2.6.22?
2) In the BIOS at "ATA(PI) 80 pin Cable Detection" I can select "Host & Device", "Host" and "Device". Which one should I choose? Which one could/should be better?
About the second (hardware related) issue, I simply had this drive laying around, so I gave a try, but I'll buy a new sata II one and use AHIC. So let me know if you find something useful in the dmidecode output, otherwise feel free to close this bug.
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #4 from [email protected] 2008-04-10 13:21 ------- Joyous. Is there anything useful in lspci -vvxxx ?
UDMA4 probably used to work because the old code was less careful about modes. You can override it by hand with the libata driver and also the old driver so a hand override exists. Not sure there is much you can do about the CRC errors though.
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #5 from [email protected] 2008-04-10 13:35 ------- Created an attachment (id=15726)
--> (http://bugzilla.kernel.org/attachment.cgi?id=15726&action=view)
lspci output
Sorry, I forgot about the lspci output.
How the override can be done? It's a specific module parameter? I removed the second HD a couple of days ago and I'm using just the CF.
BTW, thank you for your help!
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #6 from [email protected] 2008-04-10 15:08 ------- Ok, I have found this:
http://www.mail-archive.com/[email protected]/msg14722.html
Different CF adapter but same CF and same problem. Tomorrow I'll try to reboot the computer passing the "libata.force=80c,udma4" parameter. I think it should work fine then.
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #7 from [email protected] 2008-04-12 09:53 ------- It didn't worked. I tried a couple of patch and many boot parameters but it still work with udma2. Moreover, hda is now shown as sda: what's happening with libata?
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
------- Comment #8 from [email protected] 2008-04-12 10:05 ------- If your disk controller is setup to use libata it appears as /dev/sd* if it uses the legacy IDE drivers /dev/hd*
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
[Bug 10436] Compact Flash HD: dma and seek_error/badCRC problems
In reply to [email protected]http://bugzilla.kernel.org/show_bug.cgi?id=10436
[email protected] changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |CLOSED
Resolution| |PATCH_ALREADY_AVAILABLE------- Comment #9 from [email protected] 2008-04-12 13:51 ------- Halt! Finally I got it working! I had to manually insert the new code but then everything went fine then. Now we can close this bug (hoping to see this this patch in the upstream kernel).
Signature · 3 lines
Configure bugmail: http://bugzilla.kernel.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.