* More information on ATI IXP failure in git9
@ 2006-06-25 21:59 Andi Kleen
2006-06-25 22:19 ` Jeff Garzik
2006-06-25 23:23 ` Jeff Garzik
0 siblings, 2 replies; 13+ messages in thread
From: Andi Kleen @ 2006-06-25 21:59 UTC (permalink / raw)
To: linux-ide; +Cc: jgarzik
The system uses sata_sil with
00:11.0 IDE interface: ATI Technologies Inc ATI 437A Serial ATA Controller
00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller
I added some printks and it fails here:
static void sil_host_intr(struct ata_port *ap, u32 bmdma2)
{
struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag);
u8 status;
if (unlikely(bmdma2 & SIL_DMA_SATA_IRQ)) {
u32 serror;
...
<------ hits two times,
goto freeze;
Appended a successfull boot from 2.6.16.
libata version 1.20 loaded.
sata_sil 0000:00:11.0: version 0.9
GSI 19 sharing vector 0xC9 and IRQ 19
ACPI: PCI Interrupt 0000:00:11.0[A] -> GSI 23 (level, low) -> IRQ 201
ata1: SATA max UDMA/100 cmd 0xFFFFC20000012080 ctl 0xFFFFC2000001208A bmdma 0xFFFFC20000012000 irq 201
ata2: SATA max UDMA/100 cmd 0xFFFFC200000120C0 ctl 0xFFFFC200000120CA bmdma 0xFFFFC20000012008 irq 201
ata1: SATA link down (SStatus 0)
scsi0 : sata_sil
ata2: SATA link up 1.5 Gbps (SStatus 113)
ata2: dev 0 cfg 00:0040 49:2f00 82:746b 83:7f01 84:4023 85:7469 86:3c01 87:4023 88:40ff 93:0000
ata2: dev 0 ATA-7, max UDMA7, 488397168 sectors: LBA48
sata_get_dev_handle: SATA dev addr=0x110000, handle=0x0000000000000000
ata2: dev 0 configured for UDMA/100
sata_get_dev_handle: SATA dev addr=0x110000, handle=0x0000000000000000
scsi1 : sata_sil
Vendor: ATA Model: SAMSUNG SP2504C Rev: VT10
Type: Direct-Access ANSI SCSI revision: 05
ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 22 (level, low) -> IRQ 177
ata3: SATA max UDMA/100 cmd 0xFFFFC20000014080 ctl 0xFFFFC2000001408A bmdma 0xFFFFC20000014000 irq 177
ata4: SATA max UDMA/100 cmd 0xFFFFC200000140C0 ctl 0xFFFFC200000140CA bmdma 0xFFFFC20000014008 irq 177
ata3: SATA link down (SStatus 0)
scsi2 : sata_sil
ata4: SATA link down (SStatus 0)
scsi3 : sata_sil
Driver 'sd' needs updating - please use bus_type methods
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: drive cache: write back
sda: sda1 sda2 sda3
sd 1:0:0:0: Attached scsi disk sda
-Andi
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: More information on ATI IXP failure in git9 2006-06-25 21:59 More information on ATI IXP failure in git9 Andi Kleen @ 2006-06-25 22:19 ` Jeff Garzik 2006-06-26 5:24 ` Andi Kleen 2006-06-25 23:23 ` Jeff Garzik 1 sibling, 1 reply; 13+ messages in thread From: Jeff Garzik @ 2006-06-25 22:19 UTC (permalink / raw) To: Andi Kleen; +Cc: linux-ide Andi Kleen wrote: > The system uses sata_sil with > > 00:11.0 IDE interface: ATI Technologies Inc ATI 437A Serial ATA Controller > 00:12.0 IDE interface: ATI Technologies Inc ATI 4379 Serial ATA Controller > > I added some printks and it fails here: > > > static void sil_host_intr(struct ata_port *ap, u32 bmdma2) > { > struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); > u8 status; > > if (unlikely(bmdma2 & SIL_DMA_SATA_IRQ)) { > u32 serror; > > > ... > > <------ hits two times, > goto freeze; Kernel 2.6.17's sata_sil always masks the SATA phy interrupts, whereas 2.6.17-git sata_sil does not. Can you print the hex value of 'serror' variable for us? Jeff ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-25 22:19 ` Jeff Garzik @ 2006-06-26 5:24 ` Andi Kleen 0 siblings, 0 replies; 13+ messages in thread From: Andi Kleen @ 2006-06-26 5:24 UTC (permalink / raw) To: Jeff Garzik; +Cc: linux-ide > Can you print the hex value of 'serror' variable for us? It's always 0 -Andi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-25 21:59 More information on ATI IXP failure in git9 Andi Kleen 2006-06-25 22:19 ` Jeff Garzik @ 2006-06-25 23:23 ` Jeff Garzik 2006-06-26 2:10 ` Tejun Heo 1 sibling, 1 reply; 13+ messages in thread From: Jeff Garzik @ 2006-06-25 23:23 UTC (permalink / raw) To: linux-ide, Tejun Heo; +Cc: Andi Kleen Andi created a patch at my suggestion: http://one.firstfloor.org/~andi/sil-debug and that got him mounting the device, but the EH was still giving him much pain: http://one.firstfloor.org/~andi/sata-error-loop It looks like some condition isn't getting ack'd... Jeff ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-25 23:23 ` Jeff Garzik @ 2006-06-26 2:10 ` Tejun Heo 2006-06-26 6:18 ` Andi Kleen 0 siblings, 1 reply; 13+ messages in thread From: Tejun Heo @ 2006-06-26 2:10 UTC (permalink / raw) To: Jeff Garzik; +Cc: linux-ide, Andi Kleen On Sun, Jun 25, 2006 at 07:23:26PM -0400, Jeff Garzik wrote: > Andi created a patch at my suggestion: > http://one.firstfloor.org/~andi/sil-debug > > and that got him mounting the device, but the EH was still giving him > much pain: > http://one.firstfloor.org/~andi/sata-error-loop > > It looks like some condition isn't getting ack'd... Weird. To me, it almost seems like BMDMA2 is lying about whether it generated interrupt or not. e.g. It's sharing IRQ w/ another device, but when the other device raises interrupt, BMDMA2 says it generated the IRQ. Once frozen, new EH does pretty good job of clearing status and the interrupts seem too sporadic to be unacked IRQ. Andi, can you pleaes try the following patch? It makes sata_sil print more data on errors and disables SATA PHY IRQ. Thanks. diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index bc9f918..cd96891 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c @@ -341,8 +341,11 @@ static void sil_scr_write (struct ata_po static void sil_host_intr(struct ata_port *ap, u32 bmdma2) { struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); + u32 bmdma; u8 status; + bmdma = readl(ap->host_set->mmio_base + sil_port[ap->port_no].bmdma); + if (unlikely(bmdma2 & SIL_DMA_SATA_IRQ)) { u32 serror; @@ -363,11 +366,18 @@ static void sil_host_intr(struct ata_por ap->eh_info.serror |= serror; } + ata_port_printk(ap, KERN_ERR, + "SIL freeze 1, bmdma=%x bmdma2=%x serr=%x\n", + bmdma, bmdma2, serror); goto freeze; } - if (unlikely(!qc || qc->tf.ctl & ATA_NIEN)) + if (unlikely(!qc || qc->tf.ctl & ATA_NIEN)) { + ata_port_printk(ap, KERN_ERR, + "SIL freeze 2, bmdma=%x bmdma2=%x\n", + bmdma, bmdma2); goto freeze; + } /* Check whether we are expecting interrupt in this state */ switch (ap->hsm_task_state) { @@ -398,13 +408,18 @@ static void sil_host_intr(struct ata_por case HSM_ST: break; default: + ata_port_printk(ap, KERN_ERR, "SIL hsm 1, bmdma=%x bmdma2=%x\n", + bmdma, bmdma2); goto err_hsm; } /* check main status, clearing INTRQ */ status = ata_chk_status(ap); - if (unlikely(status & ATA_BUSY)) + if (unlikely(status & ATA_BUSY)) { + ata_port_printk(ap, KERN_ERR, "SIL hsm 2, bmdma=%x bmdma2=%x\n", + bmdma, bmdma2); goto err_hsm; + } /* ack bmdma irq events */ ata_bmdma_irq_clear(ap); @@ -475,7 +490,7 @@ static void sil_thaw(struct ata_port *ap ata_bmdma_irq_clear(ap); /* turn on SATA IRQ */ - writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien); + /*writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien);*/ /* turn on IRQ */ tmp = readl(mmio_base + SIL_SYSCFG); ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-26 2:10 ` Tejun Heo @ 2006-06-26 6:18 ` Andi Kleen 2006-06-26 8:40 ` Tejun Heo 0 siblings, 1 reply; 13+ messages in thread From: Andi Kleen @ 2006-06-26 6:18 UTC (permalink / raw) To: Tejun Heo; +Cc: Jeff Garzik, linux-ide On Monday 26 June 2006 04:10, Tejun Heo wrote: > On Sun, Jun 25, 2006 at 07:23:26PM -0400, Jeff Garzik wrote: > > Andi created a patch at my suggestion: > > http://one.firstfloor.org/~andi/sil-debug > > > > and that got him mounting the device, but the EH was still giving him > > much pain: > > http://one.firstfloor.org/~andi/sata-error-loop > > > > It looks like some condition isn't getting ack'd... > > Weird. To me, it almost seems like BMDMA2 is lying about whether it > generated interrupt or not. e.g. It's sharing IRQ w/ another device, It shares the interrupt with a 8139 NIC > but when the other device raises interrupt, BMDMA2 says it generated > the IRQ. > > Once frozen, new EH does pretty good job of clearing status and the > interrupts seem too sporadic to be unacked IRQ. > > Andi, can you pleaes try the following patch? It makes sata_sil print > more data on errors and disables SATA PHY IRQ. Still doesn't work with it - see http://one.firstfloor.org/~andi/sata3.jpg For reference a working 2.6.16-suse boot again (I think the ports must be mislabelled on the mobo - i especially connected the disk to port 1 as printed on the PCB) ata1: SATA max UDMA/100 cmd 0xFFFFC20000012080 ctl 0xFFFFC2000001208A bmdma 0xFFFFC20000012000 irq 201 ata2: SATA max UDMA/100 cmd 0xFFFFC200000120C0 ctl 0xFFFFC200000120CA bmdma 0xFFFFC20000012008 irq 201 ata1: SATA link down (SStatus 0) scsi0 : sata_sil ata2: SATA link down (SStatus 0) scsi1 : sata_sil ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 22 (level, low) -> IRQ 177 ata3: SATA max UDMA/100 cmd 0xFFFFC20000014080 ctl 0xFFFFC2000001408A bmdma 0xFFFFC20000014000 irq 177 ata4: SATA max UDMA/100 cmd 0xFFFFC200000140C0 ctl 0xFFFFC200000140CA bmdma 0xFFFFC20000014008 irq 177 ata3: SATA link up 1.5 Gbps (SStatus 113) ata3: dev 0 cfg 00:0040 49:2f00 82:746b 83:7f01 84:4023 85:7469 86:3c01 87:4023 88:40ff 93:0000 ata3: dev 0 ATA-7, max UDMA7, 488397168 sectors: LBA48 sata_get_dev_handle: SATA dev addr=0x120000, handle=0x0000000000000000 ata3: dev 0 configured for UDMA/100 sata_get_dev_handle: SATA dev addr=0x120000, handle=0x0000000000000000 scsi2 : sata_sil ata4: SATA link down (SStatus 0) scsi3 : sata_sil Vendor: ATA Model: SAMSUNG SP2504C Rev: VT10 Type: Direct-Access ANSI SCSI revision: 05 Driver 'sd' needs updating - please use bus_type methods SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB) sda: Write Protect is off sda: Mode Sense: 00 3a 00 00 SCSI device sda: drive cache: write back SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB) sda: Write Protect is off sda: Mode Sense: 00 3a 00 00 SCSI device sda: drive cache: write back sda: sda1 sda2 sda3 sd 2:0:0:0: Attached scsi disk sda ehci_hcd: block sizes: qh 160 qtd 96 itd 192 sitd 96 -Andi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-26 6:18 ` Andi Kleen @ 2006-06-26 8:40 ` Tejun Heo 2006-06-26 8:57 ` Tejun Heo 2006-06-26 9:13 ` Andi Kleen 0 siblings, 2 replies; 13+ messages in thread From: Tejun Heo @ 2006-06-26 8:40 UTC (permalink / raw) To: Andi Kleen; +Cc: Jeff Garzik, linux-ide [-- Attachment #1: Type: text/plain, Size: 806 bytes --] Hello, Andi. Andi Kleen wrote: > Still doesn't work with it - see http://one.firstfloor.org/~andi/sata3.jpg * SATA_IRQ bit is stuck (on all other sil controllers, this gets cleared when SError is cleared) * whenever interrupt occurs (from itself or from any other ones sharing the IRQ), irq handler sees SATA_IRQ bit set and thus thinks it just received phy status changed IRQ. * phy status change aborts the active command, so no command gets completed. I'm attaching two patches. The first one tries to clear SATA_IRQ by writing 1 to it in thaw() assuming the bit is implemented as W1C (which BTW is out of spec). The second one kills SATA_IRQ handling completely. I wish the first one works but if not I'll update the second one such that it applies only to ATI IXP. Thanks. -- tejun [-- Attachment #2: patch0 --] [-- Type: text/plain, Size: 490 bytes --] diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index bc9f918..fca5333 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c @@ -474,6 +474,9 @@ static void sil_thaw(struct ata_port *ap ata_chk_status(ap); ata_bmdma_irq_clear(ap); + /* SATA_IRQ has to be cleared manually on some controllers */ + writel(SIL_DMA_SATA_IRQ, mmio_base + sil_port[ap->port_no].bmdma2); + /* turn on SATA IRQ */ writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien); [-- Attachment #3: patch1 --] [-- Type: text/plain, Size: 1098 bytes --] diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index bc9f918..024ce28 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c @@ -343,6 +343,7 @@ static void sil_host_intr(struct ata_por struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); u8 status; +#if 0 if (unlikely(bmdma2 & SIL_DMA_SATA_IRQ)) { u32 serror; @@ -365,6 +366,7 @@ static void sil_host_intr(struct ata_por goto freeze; } +#endif if (unlikely(!qc || qc->tf.ctl & ATA_NIEN)) goto freeze; @@ -438,7 +440,7 @@ static irqreturn_t sil_interrupt(int irq continue; if (bmdma2 == 0xffffffff || - !(bmdma2 & (SIL_DMA_COMPLETE | SIL_DMA_SATA_IRQ))) + !(bmdma2 & (SIL_DMA_COMPLETE/* | SIL_DMA_SATA_IRQ*/))) continue; sil_host_intr(ap, bmdma2); @@ -475,7 +477,7 @@ static void sil_thaw(struct ata_port *ap ata_bmdma_irq_clear(ap); /* turn on SATA IRQ */ - writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien); + /*writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien);*/ /* turn on IRQ */ tmp = readl(mmio_base + SIL_SYSCFG); ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-26 8:40 ` Tejun Heo @ 2006-06-26 8:57 ` Tejun Heo 2006-06-26 9:22 ` Andi Kleen 2006-06-26 9:13 ` Andi Kleen 1 sibling, 1 reply; 13+ messages in thread From: Tejun Heo @ 2006-06-26 8:57 UTC (permalink / raw) To: Andi Kleen; +Cc: Jeff Garzik, linux-ide [-- Attachment #1: Type: text/plain, Size: 940 bytes --] Tejun Heo wrote: > Hello, Andi. > > Andi Kleen wrote: >> Still doesn't work with it - see >> http://one.firstfloor.org/~andi/sata3.jpg > > * SATA_IRQ bit is stuck (on all other sil controllers, this gets cleared > when SError is cleared) > > * whenever interrupt occurs (from itself or from any other ones sharing > the IRQ), irq handler sees SATA_IRQ bit set and thus thinks it just > received phy status changed IRQ. > > * phy status change aborts the active command, so no command gets > completed. > > I'm attaching two patches. The first one tries to clear SATA_IRQ by > writing 1 to it in thaw() assuming the bit is implemented as W1C (which > BTW is out of spec). The second one kills SATA_IRQ handling completely. > I wish the first one works but if not I'll update the second one such > that it applies only to ATI IXP. And another one, just in case they were crazy enough to implement the bit as RW. -- tejun [-- Attachment #2: patch2 --] [-- Type: text/plain, Size: 546 bytes --] diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index bc9f918..0f19645 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c @@ -474,6 +474,10 @@ static void sil_thaw(struct ata_port *ap ata_chk_status(ap); ata_bmdma_irq_clear(ap); + /* SATA_IRQ has to be cleared manually on some controllers */ + writel(SIL_DMA_SATA_IRQ, mmio_base + sil_port[ap->port_no].bmdma2); + writel(0, mmio_base + sil_port[ap->port_no].bmdma2); + /* turn on SATA IRQ */ writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien); ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-26 8:57 ` Tejun Heo @ 2006-06-26 9:22 ` Andi Kleen 0 siblings, 0 replies; 13+ messages in thread From: Andi Kleen @ 2006-06-26 9:22 UTC (permalink / raw) To: Tejun Heo; +Cc: Jeff Garzik, linux-ide On Monday 26 June 2006 10:57, Tejun Heo wrote: > Tejun Heo wrote: > > Hello, Andi. > > > > Andi Kleen wrote: > >> Still doesn't work with it - see > >> http://one.firstfloor.org/~andi/sata3.jpg > > > > * SATA_IRQ bit is stuck (on all other sil controllers, this gets cleared > > when SError is cleared) > > > > * whenever interrupt occurs (from itself or from any other ones sharing > > the IRQ), irq handler sees SATA_IRQ bit set and thus thinks it just > > received phy status changed IRQ. > > > > * phy status change aborts the active command, so no command gets > > completed. > > > > I'm attaching two patches. The first one tries to clear SATA_IRQ by > > writing 1 to it in thaw() assuming the bit is implemented as W1C (which > > BTW is out of spec). The second one kills SATA_IRQ handling completely. > > I wish the first one works but if not I'll update the second one such > > that it applies only to ATI IXP. > > And another one, just in case they were crazy enough to implement the > bit as RW. patch0 + this one also don't work (zero err_mask etc.) -Andi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: More information on ATI IXP failure in git9 2006-06-26 8:40 ` Tejun Heo 2006-06-26 8:57 ` Tejun Heo @ 2006-06-26 9:13 ` Andi Kleen 2006-06-26 12:23 ` [PATCH] sata_sil: disable hotplug interrupts on two ATI IXPs Tejun Heo 1 sibling, 1 reply; 13+ messages in thread From: Andi Kleen @ 2006-06-26 9:13 UTC (permalink / raw) To: Tejun Heo 6t; +Cc: Jeff Garzik, linux-ide On Monday 26 June 2006 10:40, Tejun Heo wrote: > Hello, Andi. > > Andi Kleen wrote: > > Still doesn't work with it - see http://one.firstfloor.org/~andi/sata3.jpg > > * SATA_IRQ bit is stuck (on all other sil controllers, this gets cleared > when SError is cleared) > > * whenever interrupt occurs (from itself or from any other ones sharing > the IRQ), irq handler sees SATA_IRQ bit set and thus thinks it just > received phy status changed IRQ. > > * phy status change aborts the active command, so no command gets completed. > > I'm attaching two patches. The first one tries to clear SATA_IRQ by > writing 1 to it in thaw() assuming the bit is implemented as W1C (which > BTW is out of spec). The second one kills SATA_IRQ handling completely. > I wish the first one works but if not I'll update the second one such > that it applies only to ATI IXP. Patch 0 and 1 together work, patch 0 only runs into the usual zero err_mask problem and doesn't find root. -Andi ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] sata_sil: disable hotplug interrupts on two ATI IXPs 2006-06-26 9:13 ` Andi Kleen @ 2006-06-26 12:23 ` Tejun Heo 2006-06-26 16:33 ` Andi Kleen 2006-06-27 1:02 ` Jeff Garzik 0 siblings, 2 replies; 13+ messages in thread From: Tejun Heo @ 2006-06-26 12:23 UTC (permalink / raw) To: Andi Kleen; +Cc: Jeff Garzik, linux-ide Some SATA controllers embedded in ATI IXPs seem to have broken SATA_IRQ bit in their bmdma2 registers which is always stuck at 1. This makes the driver believe that there has been a hotplug event and freeze the port whenever there's an interrupt thus failing all commands. This patch disables SATA_IRQ for those controllers. Signed-off-by: Tejun Heo <htejun@gmail.com> --- Andi, can you please verify this patch works? Jeff, if Andi confirms it, please push this to Andrew & Linus. I'll contact SIMG and try to find another way around this. Also, can somebody test 0x437a? Thanks. diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index bc9f918..cd20b03 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c @@ -52,6 +52,7 @@ enum { /* * host flags */ + SIL_FLAG_NO_SATA_IRQ = (1 << 28), SIL_FLAG_RERR_ON_DMA_ACT = (1 << 29), SIL_FLAG_MOD15WRITE = (1 << 30), @@ -62,8 +63,9 @@ enum { * Controller IDs */ sil_3112 = 0, - sil_3512 = 1, - sil_3114 = 2, + sil_3112_no_sata_irq = 1, + sil_3512 = 2, + sil_3114 = 3, /* * Register offsets @@ -123,8 +125,8 @@ static const struct pci_device_id sil_pc { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3512 }, { 0x1095, 0x3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3114 }, { 0x1002, 0x436e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 }, - { 0x1002, 0x4379, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 }, - { 0x1002, 0x437a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 }, + { 0x1002, 0x4379, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_no_sata_irq }, + { 0x1002, 0x437a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_no_sata_irq }, { } /* terminate list */ }; @@ -217,6 +219,16 @@ static const struct ata_port_info sil_po .udma_mask = 0x3f, /* udma0-5 */ .port_ops = &sil_ops, }, + /* sil_3112_no_sata_irq */ + { + .sht = &sil_sht, + .host_flags = SIL_DFL_HOST_FLAGS | SIL_FLAG_MOD15WRITE | + SIL_FLAG_NO_SATA_IRQ, + .pio_mask = 0x1f, /* pio0-4 */ + .mwdma_mask = 0x07, /* mwdma0-2 */ + .udma_mask = 0x3f, /* udma0-5 */ + .port_ops = &sil_ops, + }, /* sil_3512 */ { .sht = &sil_sht, @@ -437,6 +449,10 @@ static irqreturn_t sil_interrupt(int irq if (unlikely(!ap || ap->flags & ATA_FLAG_DISABLED)) continue; + /* turn off SATA_IRQ if not supported */ + if (ap->flags & SIL_FLAG_NO_SATA_IRQ) + bmdma2 &= ~SIL_DMA_SATA_IRQ; + if (bmdma2 == 0xffffffff || !(bmdma2 & (SIL_DMA_COMPLETE | SIL_DMA_SATA_IRQ))) continue; @@ -474,8 +490,9 @@ static void sil_thaw(struct ata_port *ap ata_chk_status(ap); ata_bmdma_irq_clear(ap); - /* turn on SATA IRQ */ - writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien); + /* turn on SATA IRQ if supported */ + if (!(ap->flags & SIL_FLAG_NO_SATA_IRQ)) + writel(SIL_SIEN_N, mmio_base + sil_port[ap->port_no].sien); /* turn on IRQ */ tmp = readl(mmio_base + SIL_SYSCFG); ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] sata_sil: disable hotplug interrupts on two ATI IXPs 2006-06-26 12:23 ` [PATCH] sata_sil: disable hotplug interrupts on two ATI IXPs Tejun Heo @ 2006-06-26 16:33 ` Andi Kleen 2006-06-27 1:02 ` Jeff Garzik 1 sibling, 0 replies; 13+ messages in thread From: Andi Kleen @ 2006-06-26 16:33 UTC (permalink / raw) To: Tejun Heo; +Cc: Jeff Garzik, linux-ide On Monday 26 June 2006 14:23, Tejun Heo wrote: > Some SATA controllers embedded in ATI IXPs seem to have broken > SATA_IRQ bit in their bmdma2 registers which is always stuck at 1. > This makes the driver believe that there has been a hotplug event and > freeze the port whenever there's an interrupt thus failing all > commands. > > This patch disables SATA_IRQ for those controllers. > > Signed-off-by: Tejun Heo <htejun@gmail.com> > --- > > Andi, can you please verify this patch works? Jeff, if Andi confirms > it, please push this to Andrew & Linus. I'll contact SIMG and try to > find another way around this. Works thanks. -Andi libata version 1.30 loaded. sata_sil 0000:00:11.0: version 1.0 GSI 19 sharing vector 0xC9 and IRQ 19 ACPI: PCI Interrupt 0000:00:11.0[A] -> GSI 23 (level, low) -> IRQ 201 ata1: SATA max UDMA/100 cmd 0xFFFFC2001008E080 ctl 0xFFFFC2001008E08A bmdma 0xFF FFC2001008E000 irq 201 ata2: SATA max UDMA/100 cmd 0xFFFFC2001008E0C0 ctl 0xFFFFC2001008E0CA bmdma 0xFF FFC2001008E008 irq 201 scsi0 : sata_sil ata1: SATA link down (SStatus 0 SControl 300) scsi1 : sata_sil ata2: SATA link down (SStatus 0 SControl 300) ACPI: PCI Interrupt 0000:00:12.0[A] -> GSI 22 (level, low) -> IRQ 177 ata3: SATA max UDMA/100 cmd 0xFFFFC20010090080 ctl 0xFFFFC2001009008A bmdma 0xFF FFC20010090000 irq 177 ata4: SATA max UDMA/100 cmd 0xFFFFC200100900C0 ctl 0xFFFFC200100900CA bmdma 0xFF FFC20010090008 irq 177 scsi2 : sata_sil ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300) ata3.00: configured for UDMA/100 scsi3 : sata_sil ata4: SATA link down (SStatus 0 SControl 300) Vendor: ATA Model: SAMSUNG SP2504C Rev: VT10 Type: Direct-Access ANSI SCSI revision: 05 SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB) sda: Write Protect is off sda: Mode Sense: 00 3a 00 00 SCSI device sda: drive cache: write back SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB) sda: Write Protect is off sda: Mode Sense: 00 3a 00 00 SCSI device sda: drive cache: write back sda: sda1 sda2 sda3 sd 2:0:0:0: Attached scsi disk sda ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] sata_sil: disable hotplug interrupts on two ATI IXPs 2006-06-26 12:23 ` [PATCH] sata_sil: disable hotplug interrupts on two ATI IXPs Tejun Heo 2006-06-26 16:33 ` Andi Kleen @ 2006-06-27 1:02 ` Jeff Garzik 1 sibling, 0 replies; 13+ messages in thread From: Jeff Garzik @ 2006-06-27 1:02 UTC (permalink / raw) To: Tejun Heo; +Cc: Andi Kleen, linux-ide applied ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2006-06-27 1:02 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-06-25 21:59 More information on ATI IXP failure in git9 Andi Kleen 2006-06-25 22:19 ` Jeff Garzik 2006-06-26 5:24 ` Andi Kleen 2006-06-25 23:23 ` Jeff Garzik 2006-06-26 2:10 ` Tejun Heo 2006-06-26 6:18 ` Andi Kleen 2006-06-26 8:40 ` Tejun Heo 2006-06-26 8:57 ` Tejun Heo 2006-06-26 9:22 ` Andi Kleen 2006-06-26 9:13 ` Andi Kleen 2006-06-26 12:23 ` [PATCH] sata_sil: disable hotplug interrupts on two ATI IXPs Tejun Heo 2006-06-26 16:33 ` Andi Kleen 2006-06-27 1:02 ` Jeff Garzik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).