Skip to contentSkip to conversation

ata_piix on MacBook4,1: CD/DVD drive often fails to work

PATCH MATSUBAYASHI, 'Shaolin' Kohji 2 participants 3 messages Jun 9, 2008 libata

lore
Share & tools
lore
#0 lore raw

Hi,

It happens very often on my MacBook4,1 (still running with i686 kernel for a certain personal reason, not x86_64 though) that the machine slows down, gnome CD player suddenly opens (even though there is no CD media loaded into the drive), and touchpad don't work nicely.

irq 21: nobody cared (try booting with the "irqpoll" option) Disabling IRQ #21

In such a situation, dmesg always shows the following messages every two seconds which slows down the machine so bad and annoying:

hda: status error: status=0x59 { DriveReady SeekComplete DataRequest Error }
hda: status error: error=0x40 { LastFailedSense=0x04 }
ide: failed opcode was: unknown
hda: drive not ready for command

Removing ide-cd_mod kernel module would help stopping these repeating messages though.

The IDE (PATA) controller attached with the CD/DVD drive is:

00:1f.1 IDE interface [0101]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller [8086:2850] (rev 03) (prog-if 8f [Master SecP SecO PriP PriO])

        Subsystem: Apple Computer Inc. Unknown device [106b:00a1]
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 0
        Interrupt: pin A routed to IRQ 21
        Region 0: I/O ports at 6108 [size=8]
        Region 1: I/O ports at 6124 [size=4]
        Region 2: I/O ports at 6100 [size=8]
        Region 3: I/O ports at 6120 [size=4]
        Region 4: I/O ports at 60e0 [size=16]

/proc/interrupts shows like this:

CPU0 CPU1

  0:     149053     159890   IO-APIC-edge      timer
  8:          0          3   IO-APIC-edge      rtc
  9:      21652       1462   IO-APIC-fasteoi   acpi
 16:      96958     103303   IO-APIC-fasteoi   uhci_hcd:usb2, uhci_hcd:usb3, i915@pci:0000:00:02.0
 17:      10238         17   IO-APIC-fasteoi   eth0
 18:      75785       3642   IO-APIC-fasteoi   ata_piix, uhci_hcd:usb5
 19:          2          0   IO-APIC-fasteoi   ohci1394
 20:         98         97   IO-APIC-fasteoi   uhci_hcd:usb1, ehci_hcd:usb6, HDA Intel
 21:      39926      36169   IO-APIC-fasteoi   ide0, ehci_hcd:usb4, uhci_hcd:usb7
NMI:          0          0   Non-maskable interrupts
LOC:     505228     495166   Local timer interrupts
RES:     115346     108647   Rescheduling interrupts
CAL:        110      14262   function call interrupts
TLB:        182        184   TLB shootdowns
TRM:          0          0   Thermal event interrupts
SPU:          0          0   Spurious interrupts
ERR:          0
MIS:          0

Then the following patch fixed the problem anyhow at least on my machine (I suspect changing from ich_pata_100 to ich_pata_66, especially removing the flag PIIX_FLAG_CHECKINTR, did something good in this case).

I am not certain whether this patch is the right/correct solution for that, but anyway here's it. Let me know if there's something I can do for debugging further.

--
Kohji

drivers/ata/ata_piix.c +2 -0
index 81b7ae3..93b5741 100644
@@ -214,6 +214,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	/* ICH7/7-R (i945, i975) UDMA 100*/
 	{ 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 	{ 0x8086, 0x269E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
+	/* ICH8 Mobile PATA Controller, Apple */
+	{ 0x8086, 0x2850, 0x106b, 0x00a1, 0, 0, ich_pata_66 },
 	/* ICH8 Mobile PATA Controller */
 	{ 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 
#1 lore raw

Sorry all, it was just my fault - this patch did not improve the stability. It just happened that annoying "status error" message did not appeared for a while. Now the message appears again every two seconds until I have to remove ide-cd_mod kernel module.

--
Kohji

At Mon, 09 Jun 2008 20:16:28 +0900,

Quoted 26 lines · Shaolin' Kohji

Then the following patch fixed the problem anyhow at least on my machine (I suspect changing from ich_pata_100 to ich_pata_66, especially removing the flag PIIX_FLAG_CHECKINTR, did something good in this case).

I am not certain whether this patch is the right/correct solution for that, but anyway here's it. Let me know if there's something I can do for debugging further.

--
Kohji

[2 ata_piix-pata-apple.patch <text/plain; US-ASCII (7bit)>]

drivers/ata/ata_piix.c +2 -0
index 81b7ae3..93b5741 100644
@@ -214,6 +214,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	/* ICH7/7-R (i945, i975) UDMA 100*/
 	{ 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 	{ 0x8086, 0x269E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
+	/* ICH8 Mobile PATA Controller, Apple */
+	{ 0x8086, 0x2850, 0x106b, 0x00a1, 0, 0, ich_pata_66 },
 	/* ICH8 Mobile PATA Controller */
 	{ 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 
#2 lore raw

Hello,

Quoted 21 lines · Shaolin' Kohji

Sorry all, it was just my fault - this patch did not improve the stability. It just happened that annoying "status error" message did not appeared for a while. Now the message appears again every two seconds until I have to remove ide-cd_mod kernel module.

--
Kohji

At Mon, 09 Jun 2008 20:16:28 +0900,

Quoted 11 lines · Shaolin' Kohji

Then the following patch fixed the problem anyhow at least on my machine (I suspect changing from ich_pata_100 to ich_pata_66, especially removing the flag PIIX_FLAG_CHECKINTR, did something good in this case).

I am not certain whether this patch is the right/correct solution for that, but anyway here's it. Let me know if there's something I can do for debugging further.

--
Kohji

Quoted 13 lines

drivers/ata/ata_piix.c static const struct pci_device_id piix_pci_tbl[] = { · line 220

Quoted 13 lines

[2 ata_piix-pata-apple.patch <text/plain; US-ASCII (7bit)>]

drivers/ata/ata_piix.c +2 -0
index 81b7ae3..93b5741 100644
@@ -214,6 +214,8 @@ static const struct pci_device_id piix_pci_tbl[] = {
 	/* ICH7/7-R (i945, i975) UDMA 100*/
 	{ 0x8086, 0x27DF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
 	{ 0x8086, 0x269E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
+	/* ICH8 Mobile PATA Controller, Apple */
+	{ 0x8086, 0x2850, 0x106b, 0x00a1, 0, 0, ich_pata_66 },
 	/* ICH8 Mobile PATA Controller */
 	{ 0x8086, 0x2850, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },

You're using IDE piix driver so modifying ata_piix won't help you much.
Can you please give a shot at ata_piix?

Signature · 1 line
tejun