* [PATCH] ahci: ignore PORT_IRQ_IF_ERR on JMB controllers
@ 2006-11-21 1:48 Tejun Heo
2006-11-28 8:49 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2006-11-21 1:48 UTC (permalink / raw)
To: Jeff Garzik, linux-ide; +Cc: justin, andrew.lyon, fredrik
JMicron AHCI controllers set PORT_IRQ_IF_ERR on device errors. The
IRQ status bit indicates interface error or protocol mismatch and ahci
driver interprets it into AC_ERR_ATA_BUS. So, whenever an ATAPI
device raises check condition, ahci interprets it as ATA bus error and
thus resets it which, in turn, raises check condition thus creating a
reset loop and rendering the device unuseable.
This patch makes JMB controllers ignore PORT_IRQ_IF_ERR when
interpreting error condition.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Justin Tsai <justin@jmicron.com>
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -80,6 +80,7 @@ enum {
board_ahci = 0,
board_ahci_pi = 1,
board_ahci_vt8251 = 2,
+ board_ahci_ign_iferr = 3,
/* global controller registers */
HOST_CAP = 0x00, /* host capabilities */
@@ -170,6 +171,7 @@ enum {
/* ap->flags bits */
AHCI_FLAG_NO_NCQ = (1 << 24),
AHCI_FLAG_HONOR_PI = (1 << 25), /* honor PORTS_IMPL */
+ AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 26), /* ignore IRQ_IF_ERR */
};
struct ahci_cmd_hdr {
@@ -339,6 +341,17 @@ static const struct ata_port_info ahci_p
.udma_mask = 0x7f, /* udma0-6 ; FIXME */
.port_ops = &ahci_vt8251_ops,
},
+ /* board_ahci_ign_iferr */
+ {
+ .sht = &ahci_sht,
+ .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
+ ATA_FLAG_SKIP_D2H_BSY |
+ AHCI_FLAG_IGN_IRQ_IF_ERR,
+ .pio_mask = 0x1f, /* pio0-4 */
+ .udma_mask = 0x7f, /* udma0-6 ; FIXME */
+ .port_ops = &ahci_vt8251_ops,
+ },
};
static const struct pci_device_id ahci_pci_tbl[] = {
@@ -360,11 +373,11 @@ static const struct pci_device_id ahci_p
{ PCI_VDEVICE(INTEL, 0x282a), board_ahci_pi }, /* ICH8M */
/* JMicron */
- { PCI_VDEVICE(JMICRON, 0x2360), board_ahci }, /* JMicron JMB360 */
- { PCI_VDEVICE(JMICRON, 0x2361), board_ahci }, /* JMicron JMB361 */
- { PCI_VDEVICE(JMICRON, 0x2363), board_ahci }, /* JMicron JMB363 */
- { PCI_VDEVICE(JMICRON, 0x2365), board_ahci }, /* JMicron JMB365 */
- { PCI_VDEVICE(JMICRON, 0x2366), board_ahci }, /* JMicron JMB366 */
+ { PCI_VDEVICE(JMICRON, 0x2360), board_ahci_ign_iferr }, /* JMB360 */
+ { PCI_VDEVICE(JMICRON, 0x2361), board_ahci_ign_iferr }, /* JMB361 */
+ { PCI_VDEVICE(JMICRON, 0x2363), board_ahci_ign_iferr }, /* JMB363 */
+ { PCI_VDEVICE(JMICRON, 0x2365), board_ahci_ign_iferr }, /* JMB365 */
+ { PCI_VDEVICE(JMICRON, 0x2366), board_ahci_ign_iferr }, /* JMB366 */
/* ATI */
{ PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
@@ -1042,6 +1055,10 @@ static void ahci_error_intr(struct ata_p
/* analyze @irq_stat */
ata_ehi_push_desc(ehi, "irq_stat 0x%08x", irq_stat);
+ /* some controllers set IRQ_IF_ERR on device errors, ignore it */
+ if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR)
+ irq_stat &= ~PORT_IRQ_IF_ERR;
+
if (irq_stat & PORT_IRQ_TF_ERR)
err_mask |= AC_ERR_DEV;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ahci: ignore PORT_IRQ_IF_ERR on JMB controllers
2006-11-21 1:48 [PATCH] ahci: ignore PORT_IRQ_IF_ERR on JMB controllers Tejun Heo
@ 2006-11-28 8:49 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2006-11-28 8:49 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-ide, justin, andrew.lyon, fredrik
Tejun Heo wrote:
> JMicron AHCI controllers set PORT_IRQ_IF_ERR on device errors. The
> IRQ status bit indicates interface error or protocol mismatch and ahci
> driver interprets it into AC_ERR_ATA_BUS. So, whenever an ATAPI
> device raises check condition, ahci interprets it as ATA bus error and
> thus resets it which, in turn, raises check condition thus creating a
> reset loop and rendering the device unuseable.
>
> This patch makes JMB controllers ignore PORT_IRQ_IF_ERR when
> interpreting error condition.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> Cc: Justin Tsai <justin@jmicron.com>
ACK, but please resend against latest #upstream-fixes (which includes
Intel ahci ICH9 PCI IDs)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-11-28 8:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-21 1:48 [PATCH] ahci: ignore PORT_IRQ_IF_ERR on JMB controllers Tejun Heo
2006-11-28 8:49 ` 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).