2004-01-14 22:45:37

by Greg Stark

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report


Jeff Garzik <[email protected]> writes:

> Intel ICH5
>
> Issue #2: Excessive interrupts are seen in some configurations.

I guess I'm seeing this problem. I'm trying to get my P4P800 motherboard with
an ICH5 chipset working completely. So far I've been living without the cdrom
or DVD players. I see lots of other posts on linux-kernel about the same
problems:

Whenever I try to access the cdrom my system becomes unusable. Due to high
interrupts, typically over 150k/s. I thought libata would help, but I don't
understand how to use the PATA drive and the cdrom drives while I'm using it.

The situation is that I have two SATA drives, a PATA drive and two cdrom
drives (actually one CD burner and one DVD drive). They are

Primary Master: PATA Drive
Secondary Master: CD Burner
Secondary Slave: DVD-Rom
SATA-1: SATA Drive
SATA-2: SATA Drive

I've tried 2.4.23pre4 (no libata), 2.6.1 (IDE drivers), and 2.6.1 (with scsi
libata drivers) with the following results:

2.4.23pre4: as soon as the cdrom is touched I see bursts of 150k interrupts
per second and the system becomes unresponsive momentarily every few
seconds.

2.6.1 with regular IDE drivers: same as above except the system feels
responsive except for disk i/o. I see printks of "Disabling interrupt #18"
and all disk i/o freezes for a few seconds.

2.6.1 with scsi ata_piix driver: the SATA drives show up and work fine but the
PATA drive and the cdroms doesn't show up at all. This is true even when I
compile with the CONFIG_IDE, CONFIG_BLK_DEV_IDE, and CONFIG_BLK_DEV_IDECD
enabled.


--
greg


2004-01-14 23:07:03

by Erik Andersen

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

On Wed Jan 14, 2004 at 05:18:34PM -0500, Greg Stark wrote:
>
> Jeff Garzik <[email protected]> writes:
>
> > Intel ICH5
> >
> > Issue #2: Excessive interrupts are seen in some configurations.
>
> I guess I'm seeing this problem. I'm trying to get my P4P800 motherboard with
> an ICH5 chipset working completely. So far I've been living without the cdrom
> or DVD players. I see lots of other posts on linux-kernel about the same
> problems:

I have the same deal. My offer to send Jeff a P4P800 motherboard
to test with is still open....

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

2004-01-14 23:16:18

by Erik Steffl

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

Greg Stark wrote:
> Jeff Garzik <[email protected]> writes:
>
>
>>Intel ICH5
>>
>>Issue #2: Excessive interrupts are seen in some configurations.
>
>
> I guess I'm seeing this problem. I'm trying to get my P4P800 motherboard with
> an ICH5 chipset working completely. So far I've been living without the cdrom
> or DVD players. I see lots of other posts on linux-kernel about the same
> problems:
>
> Whenever I try to access the cdrom my system becomes unusable. Due to high
> interrupts, typically over 150k/s. I thought libata would help, but I don't
> understand how to use the PATA drive and the cdrom drives while I'm using it.
>
> The situation is that I have two SATA drives, a PATA drive and two cdrom
> drives (actually one CD burner and one DVD drive). They are
>
> Primary Master: PATA Drive
> Secondary Master: CD Burner
> Secondary Slave: DVD-Rom
> SATA-1: SATA Drive
> SATA-2: SATA Drive
>
> I've tried 2.4.23pre4 (no libata), 2.6.1 (IDE drivers), and 2.6.1 (with scsi
> libata drivers) with the following results:
>
> 2.4.23pre4: as soon as the cdrom is touched I see bursts of 150k interrupts
> per second and the system becomes unresponsive momentarily every few
> seconds.
>
> 2.6.1 with regular IDE drivers: same as above except the system feels
> responsive except for disk i/o. I see printks of "Disabling interrupt #18"
> and all disk i/o freezes for a few seconds.
>
> 2.6.1 with scsi ata_piix driver: the SATA drives show up and work fine but the
> PATA drive and the cdroms doesn't show up at all. This is true even when I
> compile with the CONFIG_IDE, CONFIG_BLK_DEV_IDE, and CONFIG_BLK_DEV_IDECD
> enabled.

I have intel D865PERL, three IDE HDs, one CD burner, one SATA disk,
using scsi ata, kernel 2.4.21-ac4 with libata5 patches (libata patches
needed beacause SATA driver is over 133GB), seems to be working fine, I
am not using CD burner very often but I didn't see any instability when
I used it (read or burn CDs).

When I use cdparanoia to rip audio CDs the system is quite slow but
that was always the case (even with different MB, no SATA, different
kernels etc.)

Using SATA disk as IDE disk caused the system to freeze during boot
(right after the HDs were detected)

erik

2004-01-14 23:37:16

by Raphaël RIGO

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

Erik Andersen wrote:
> On Wed Jan 14, 2004 at 05:18:34PM -0500, Greg Stark wrote:
>
>>Jeff Garzik <[email protected]> writes:
>>
>>
>>>Intel ICH5
>>>
>>>Issue #2: Excessive interrupts are seen in some configurations.
>>
>>I guess I'm seeing this problem. I'm trying to get my P4P800 motherboard with
>>an ICH5 chipset working completely. So far I've been living without the cdrom
>>or DVD players. I see lots of other posts on linux-kernel about the same
>>problems:
>
>
> I have the same deal. My offer to send Jeff a P4P800 motherboard
> to test with is still open....
>
> -Erik
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

> --
> Erik B. Andersen http://codepoet-consulting.com/
> --This message was written using 73% post-consumer electrons--
> -
One possible workaround it to enable both PATA and SATA drivers (using
libata) and pass "ide2=noprobe ide3=noprobe" to kernel at boot.
More detailled answer can be found here :
http://www.hentges.net/howtos/p4p800_deluxe.html
Regards,
Rapha?l.

2004-01-14 23:36:53

by James Courtier-Dutton

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

Erik Andersen wrote:
> On Wed Jan 14, 2004 at 05:18:34PM -0500, Greg Stark wrote:
>
>>Jeff Garzik <[email protected]> writes:
>>
>>
>>>Intel ICH5
>>>
>>>Issue #2: Excessive interrupts are seen in some configurations.
>>
>>I guess I'm seeing this problem. I'm trying to get my P4P800 motherboard with
>>an ICH5 chipset working completely. So far I've been living without the cdrom
>>or DVD players. I see lots of other posts on linux-kernel about the same
>>problems:
>
>
> I have the same deal. My offer to send Jeff a P4P800 motherboard
> to test with is still open....
>
> -Erik
>
> --
> Erik B. Andersen http://codepoet-consulting.com/

I have a ABIT IC7-G motherboard with the ICH5 chipset.
No reported problems with it. I would be happy to do some tests, just in
case I have not actually noticed the problems.

hda=DVD-ROM
hdb=DVD writer
hdc=SATA Seagate Hard Disc 160 Gig.
hdd=Empty.

I do sometimes have problems during BIOS startup, with it not detecting
the SATA hard disc, but pressing the reset button a few times fixes that.

Jan 14 01:01:17 new kernel: Uniform Multi-Platform E-IDE driver
revision: 7.00alpha2
Jan 14 01:01:17 new kernel: ide: Assuming 33MHz system bus speed for PIO
modes; override with idebus=xx
Jan 14 01:01:17 new kernel: ICH5-SATA: IDE controller at PCI slot
0000:00:1f.2
Jan 14 01:01:17 new kernel: ICH5-SATA: chipset revision 2
Jan 14 01:01:17 new kernel: ICH5-SATA: not 100%% native mode: will probe
irqs later
Jan 14 01:01:17 new kernel: ide0: BM-DMA at 0xf000-0xf007, BIOS
settings: hda:DMA, hdb:DMA
Jan 14 01:01:17 new kernel: ide1: BM-DMA at 0xf008-0xf00f, BIOS
settings: hdc:DMA, hdd:pio
Jan 14 01:01:17 new kernel: hda: ATAPI DVD-ROM 16XMax, ATAPI CD/DVD-ROM
drive
Jan 14 01:01:17 new kernel: hdb: OPTORITEDVD RW DD0203, ATAPI CD/DVD-ROM
drive
Jan 14 01:01:17 new kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Jan 14 01:01:17 new kernel: hdc: ST3160023AS, ATA DISK drive
Jan 14 01:01:17 new kernel: ide1 at 0x170-0x177,0x376 on irq 15
Jan 14 01:01:17 new kernel: hdc: max request size: 1024KiB
Jan 14 01:01:17 new kernel: hdc: 312581808 sectors (160041 MB) w/8192KiB
Cache, CHS=19457/255/63, UDMA(33)
Jan 14 01:01:17 new kernel: /dev/ide/host0/bus1/target0/lun0: p1 p2 <
p5 p6 p7 >

2004-01-15 00:08:28

by Erik Steffl

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

Raphael Rigo wrote:
...<ICH5problems snipped>...
> One possible workaround it to enable both PATA and SATA drivers (using
> libata) and pass "ide2=noprobe ide3=noprobe" to kernel at boot.
> More detailled answer can be found here :
> http://www.hentges.net/howtos/p4p800_deluxe.html

I have pretty much the same setup he recommends in UPDATE except of
the "ide2=noprobe ide3=noprobe" kernel boot options, not sure why would
that be needed but my system (interl D865PERL, cd burner, ide and sata
disks) works OK without it.

erik

2004-01-15 00:43:33

by Jeff Garzik

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

--- libata-core.c-orig 2003-12-07 01:54:19.000000000 +0000
+++ libata-core.c 2003-12-07 16:25:11.961806872 +0000
@@ -2386,6 +2386,37 @@
}

/**
+ * ata_chk_spurious_int - Check for spurious interrupts
+ * @ap: port to which command is being issued
+ *
+ * Examines the DMA status registers and clears
+ * unexpected interrupts
+ *
+ * LOCKING:
+ */
+static inline void ata_chk_spurious_int(struct ata_port *ap) {
+ int host_stat;
+
+ if (ap->flags & ATA_FLAG_MMIO) {
+ void *mmio = (void *) ap->ioaddr.bmdma_addr;
+ host_stat = readb(mmio + ATA_DMA_STATUS);
+ } else
+ host_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+
+ if ((host_stat & (ATA_DMA_INTR | ATA_DMA_ERR | ATA_DMA_ACTIVE)) == ATA_DMA_INTR) {
+ if (ap->flags & ATA_FLAG_MMIO) {
+ void *mmio = (void *) ap->ioaddr.bmdma_addr;
+ writeb(host_stat & ~ATA_DMA_ERR, mmio + ATA_DMA_STATUS);
+ } else
+ outb(host_stat & ~ATA_DMA_ERR, ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
+
+ DPRINTK("ata%u: Caught spurious interrupt, status 0x%X\n", ap->id, host_stat);
+ udelay(1);
+ }
+}
+
+
+/**
* ata_interrupt -
* @irq:
* @dev_instance:
@@ -2417,6 +2448,7 @@
qc = ata_qc_from_tag(ap, ap->active_tag);
if (qc && ((qc->flags & ATA_QCFLAG_POLL) == 0))
handled += ata_host_intr(ap, qc);
+ ata_chk_spurious_int(ap);
}
}


Attachments:
libata-spurious2.diff (1.29 kB)

2004-01-15 02:38:51

by Erik Andersen

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

On Wed Jan 14, 2004 at 07:41:56PM -0500, Jeff Garzik wrote:
>
> I'm pretty sure the "excessive interrupts" issue was successfully
> tracked down by Jon Burgess (thanks!). He found this post describing an
> ICH5 hardware issue,
> http://www.mail-archive.com/[email protected]/msg58421.html
>
> and he also submitted the attached patch.
>
> I've been meaning to rewrite his patch to isolate it more to ata_piix,
> but in the meantime maybe folks could test this?

Tried it on top of 2.4.25-pre4-libata1. I set the BIOS on my
Asus P4P800 to Enhanced mode, and the kernel locked solid during
boot while trying to clean /tmp.... Setting the BIOS back to
Compatible mode allows my system to boot.

-Erik

--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

2004-01-15 02:39:25

by Matthias Hentges

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

Hello all,

Am Don, 2004-01-15 um 01.08 schrieb Erik Steffl:
> Raphael Rigo wrote:
> ...<ICH5problems snipped>...
> > One possible workaround it to enable both PATA and SATA drivers (using
> > libata) and pass "ide2=noprobe ide3=noprobe" to kernel at boot.
> > More detailled answer can be found here :
> > http://www.hentges.net/howtos/p4p800_deluxe.html
>
> I have pretty much the same setup he recommends in UPDATE except of
> the "ide2=noprobe ide3=noprobe" kernel boot options, not sure why would
> that be needed but my system (interl D865PERL, cd burner, ide and sata
> disks) works OK without it.

The "Update" section describes the setup which - after *weeks* of
frustrating trail-and-error - managed to get things going.

Notice the unusual BIOS setting (Enhanced Mode - SATA only) which did
the trick and enabled PATA *and* SATA.
You may want to try that if you haven't already.

The ideN=noprobe my indeed not be necessary . It was recommended by Jeff
Garzik to me at some time IIRC. Kernel 2.6 does *not* need the noprobe
stuff AFAICT.

FWIW my P4P800 Deluxe is working flawlessly with 4 P-ATA devices (2 HDs,
a ZIP100 and a 48x Burner) and one SATA 160Gb HD.

I'm using 2.4.22-bk36 with matching libata patch so i'd think that any
kernel 2.4.23+ will do the trick.

HTH and GL
--

Matthias Hentges
Cologne / Germany

[http://www.hentges.net] -> PGP welcome, HTML tolerated
ICQ: 97 26 97 4 -> No files, no URL's

My OS: Debian Woody. Geek by Nature, Linux by Choice

2004-01-15 21:09:44

by Greg Stark

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report


Matthias Hentges <[email protected]> writes:

> Notice the unusual BIOS setting (Enhanced Mode - SATA only) which did
> the trick and enabled PATA *and* SATA.
> You may want to try that if you haven't already.

Thank you!

That was the key thing I was missing. With this setting the PATA drives show
up on /dev/hd{a,b,c,d} and the SATA drives show up on /dev/sd{a,b} (using
ata_piix). And everything seems to work pretty well in 2.6.1.

I've only tried the PATA hard drive and reading from cdrom. I haven't tried
burning cds or playing a dvd yet.

--
greg

2004-01-18 12:31:28

by Martin Schlemmer

[permalink] [raw]
Subject: Re: Serial ATA (SATA) for Linux status report

On Thu, 2004-01-15 at 02:41, Jeff Garzik wrote:
> I'm pretty sure the "excessive interrupts" issue was successfully
> tracked down by Jon Burgess (thanks!). He found this post describing an
> ICH5 hardware issue,
> http://www.mail-archive.com/[email protected]/msg58421.html
>
> and he also submitted the attached patch.
>
> I've been meaning to rewrite his patch to isolate it more to ata_piix,
> but in the meantime maybe folks could test this?
>

I have an Asus P4C800-E Deluxe, with two drivers on the ICH5 sata
controllers. It is a 3Ghz cpu using HT.

I use the normal PIIX ide drivers for the pata channels, and libata for
the sata ones. I also use the vector based interrupts. Kernel is
2.6.1-bk4.

Anyhow, I do not think the interrupt count is _that_ high, as it shares
with usb and network and I cannot complain of problems with cdrom, etc,
but I decided to try the patch anyhow. It have some interesting results
though. First, network stops responding after a few minutes of uptime
(especially easy to reproduce if you have heavy network traffic), then
for some reason you cannot start a new program/login/etc, but those
running seems Ok, and lastly X becomes totally unresponsive (although
alt-sysrq-b still do work).

--
# cat /proc/interrupts
CPU0 CPU1
0: 29703539 29690292 IO-APIC-edge timer
2: 0 0 XT-PIC cascade
8: 2 0 IO-APIC-edge rtc
9: 0 0 IO-APIC-level acpi
14: 564 210 IO-APIC-edge ide0
15: 1 0 IO-APIC-edge ide1
169: 1049180 1055746 IO-APIC-level libata, uhci_hcd, eth0
177: 39519 37904 IO-APIC-level Intel ICH5
185: 2521873 2494269 IO-APIC-level uhci_hcd, uhci_hcd, nvidia
193: 0 0 IO-APIC-level uhci_hcd
201: 0 0 IO-APIC-level ehci_hcd
NMI: 0 0
LOC: 59387583 59387287
ERR: 0
MIS: 0
--

--
Martin Schlemmer


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part