Bug 13882 - Cannot read CD: "Logical unit communication CRC error"
Summary: Cannot read CD: "Logical unit communication CRC error"
Status: CLOSED WILL_NOT_FIX
Alias: None
Product: IO/Storage
Classification: Unclassified
Component: IDE (show other bugs)
Hardware: All Linux
: P1 high
Assignee: io_ide@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 22:44 UTC by checkit
Modified: 2012-06-13 14:31 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.27.10
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
dmesg 2.6.30.3 (36.84 KB, text/plain)
2009-07-30 22:53 UTC, checkit
Details
dmesg 2.6.24.6 (23.38 KB, text/plain)
2009-07-31 13:16 UTC, checkit
Details
lspci -vvxxx 2.6.24.6 (9.41 KB, text/plain)
2009-07-31 18:42 UTC, checkit
Details
lspci -vvxxx 2.6.30.3 (9.35 KB, text/plain)
2009-07-31 18:43 UTC, checkit
Details
lspci -vvxxx 2.6.30.3 (18.81 KB, text/plain)
2009-07-31 18:57 UTC, checkit
Details
lspci -vvxxx 2.6.24.6 (18.88 KB, text/plain)
2009-07-31 18:57 UTC, checkit
Details

Description checkit 2009-07-30 22:44:30 UTC
I have an official Ubuntu 9.04 (Jaunty) CD ordered using the Ubuntu ShipIt service.  I put the disc in my DVD drive and attempt to validate the contents of the CD using the following command:

md5sum -c md5sum.txt | grep -vi 'OK$'

This returns the following error message in the terminal:

md5sum: ./casper/filesystem.squashfs: Input/output error
./casper/filesystem.squashfs: FAILED open or read
md5sum: WARNING: 1 of 65 listed files could not be read

Opening /var/log/messages in a text editor shows the following:

Jul 30 18:12:23 phoenix kernel: [  724.994491] UDF-fs: No VRS found
Jul 30 18:12:23 phoenix kernel: [  724.994500] UDF-fs: No partition found (1)
Jul 30 18:13:12 phoenix kernel: [  773.810949] sr 1:0:1:0: [sr0] Unhandled sense code
Jul 30 18:13:12 phoenix kernel: [  773.810958] sr 1:0:1:0: [sr0] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jul 30 18:13:12 phoenix kernel: [  773.810964] sr 1:0:1:0: [sr0] Sense Key : Hardware Error [current] 
Jul 30 18:13:12 phoenix kernel: [  773.810971] sr 1:0:1:0: [sr0] Add. Sense: Logical unit communication CRC error (Ultra-DMA/32)

The earliest kernel I have found that reproduces this bug is 2.6.27.10.
The latest kernel I have found that works as expected is 2.6.24.6.
This bug is reproducible using the latest stable kernel (2.6.30.3).

All these tests were conducted on a Ubuntu 8.10 (Intrepid) system, and all kernel versions specified are mainline kernels (not Ubuntu distributed kernels) installed using the instructions at https://wiki.ubuntu.com/KernelTeam/MainlineBuilds.

The DVD drive used is a Lite-On 201AH DVDRW, firmware revision LL0D.  This is an IDE drive.
Comment 1 checkit 2009-07-30 22:53:43 UTC
Created attachment 22547 [details]
dmesg 2.6.30.3

Attaching dmesg output.
Comment 2 Robert Hancock 2009-07-31 02:39:41 UTC
It looks like you're indeed getting UDMA CRC errors. The drive is getting configured for UDMA/66. Is it using an 80-wire PATA cable? If not then that would explain why as 40-wire are only good to UDMA/33, however in that case it would point to the cable detection not working properly.
Comment 3 checkit 2009-07-31 12:51:31 UTC
ata1 is using an 80-wire cable, and ata2 is using a 40-wire cable.  So I think you are right about cable detection not working properly.
Comment 4 checkit 2009-07-31 13:16:31 UTC
Created attachment 22551 [details]
dmesg 2.6.24.6

Here is the dmesg output using 2.6.24.6.

As you can see it detects the 40-wire cable properly.
Comment 5 Alan 2009-07-31 15:22:02 UTC
Can you attach an lspci -vvxx

Would also be useful to know if 2.6.29/30 get it right
Comment 6 checkit 2009-07-31 18:42:34 UTC
Created attachment 22555 [details]
lspci -vvxxx 2.6.24.6
Comment 7 checkit 2009-07-31 18:43:39 UTC
Created attachment 22556 [details]
lspci -vvxxx 2.6.30.3
Comment 8 checkit 2009-07-31 18:48:14 UTC
Alan, I'm not sure what you mean by "Would also be useful to know if 2.6.29/30 get it right".  If you are asking whether or not the bug occurs in 2.6.29/30, then the answer is yes (as can be verified by looking at dmesg 2.6.30.3).
Comment 9 Robert Hancock 2009-07-31 18:49:15 UTC
Can you rerun the lspci output for 2.6.30 as root? When run as normal user it omits the part of the PCI configuration space that contains the cable detection bits.
Comment 10 checkit 2009-07-31 18:57:03 UTC
Created attachment 22557 [details]
lspci -vvxxx 2.6.30.3
Comment 11 checkit 2009-07-31 18:57:43 UTC
Created attachment 22558 [details]
lspci -vvxxx 2.6.24.6
Comment 12 checkit 2009-07-31 18:58:41 UTC
Ok Robert, I have rerun both lspci outputs as root.
Comment 13 Robert Hancock 2009-07-31 20:07:16 UTC
Presumably it's hitting this case:

	pci_read_config_dword(pdev, 0x50, &ata66);
	/* Check both the drive cable reporting bits, we might not have
	   two drives */
	if (ata66 & (0x10100000 >> (16 * ap->port_no)))
		return ATA_CBL_PATA80;

The value at 0x50 is F1F1F6F2, which according to this logic means that an 80-wire cable is detected on all 4 drives. Hmm..
Comment 14 Robert Hancock 2009-08-01 18:40:24 UTC
Alan, do you have access to any documentation that indicates what those bits are supposed to actually mean?

For the original reporter, you can try just deleting those lines from drivers/ata/pata_via.c and see if the cable detection then reports 40-wire..
Comment 15 Alan 2009-08-01 21:30:26 UTC
I have complete documentation for them. They are set by the BIOS to indicate whether the cable is 40 or 80 wire. We cannot do drive side detect as there is no guarantee the boards support it.

If the system supports ACPI we also check the ACPI data. There isn't much else we can do and unfortunately the ACPI tells us "80 wire or dunno" not 80/40 so I don't see a good way to use that for both.


The other bits in that register pertain to mode/timing stuff.
Comment 16 Sergei Shtylyov 2009-08-01 22:06:00 UTC
--- Comment #15 from Alan <alan@lxorguk.ukuu.org.uk> 2009-08-01 21:30:26 ---
> I have complete documentation for them. They are set by the BIOS to indicate
> whether the cable is 40 or 80 wire. We cannot do drive side detect as there
> is
> no guarantee the boards support it.
>   

I wonder how boards can support (or not) *drive side* cable detection...
Comment 17 Alan 2009-08-02 10:53:01 UTC
Because someone didn't bother fitting a suitable capacitor I would imagine (ATA 5 AnnexB). It may also be the boot process before Linux runs (eg ACPI) samples and confuses stuff. Neither the VIA nor the Nvidia reliabily support drive side detect and Nvidia in fact specify the use of ACPI for detection purposes should always be done.
Comment 18 checkit 2009-08-03 21:24:33 UTC
How does 2.6.24.6 detect the cables correctly?  Does it not use ACPI?
Comment 19 Alan 2009-08-03 21:49:31 UTC
2.6.24 has various differences, without knowing exactly what path is taken it's hard to tell. Most likely the fact the old code erroneously also checked drvie detect on VIA (which broke lots of systems) happened by luck to make yours work.

One way to test that would be to make the cases which return ATA_CBL_PATA80 in the pata_via driver return ATA_CBL_PATA_UNK and see if that helps you. If it does we are probably going to have to special case some boards by PCI svid/sdid 8(
Comment 20 checkit 2009-08-09 22:41:14 UTC
I just replaced my 40-wire cable with an 80-wire cable, reran the md5sum test using 2.6.27.14, and it looks like my DVD drive is working fine now.

I don't have the inclination to spend any more time on the original bug.  Perhaps somebody else with more time and inclination will want to look into this further.

Note You need to log in before you can comment on or make changes to this bug.