* [PATCH] ahci.c: walkaround for SB600 SATA internal error issue
@ 2007-03-27 10:33 Conke Hu
2007-03-27 10:48 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Conke Hu @ 2007-03-27 10:33 UTC (permalink / raw)
To: Jeff Garzik, Alan, Tejun Heo; +Cc: Linux Kernel Mailing List, linux-ide
There is a HW issue in ATI SB600 SATA that PxSERR.E should not be
set on some conditions, for example, when there is no media in SATA
CD/DVD drive or media is not ready, AHCI controller fails to execute
ATAPI commands and reports PORT_IRQ_TF_ERR, but ATI SB600 SATA
controller sets PxSERR.E at the
same time, which is not necessary.
This patch is just to ignore the INTERNAL ERROR in such case.
Without this patch, ahci error handler will report many errors as
below:
----------- cut from dmesg -----------
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x40000001)
ata9.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
res 51/24:03:00:00:20/00:00:00:00:00/a0 Emask 0x40 (internal error)
ata9: soft resetting port
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata9.00: configured for UDMA/33
ata9: EH complete
ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
ata9.00: (irq_stat 0x40000001)
ata9.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x43 data 12 in
res 51/24:03:00:00:00/00:00:00:00:00/a0 Emask 0x40 (internal error)
-------- end cut ---------
Signed-off-by: Conke Hu <conke.hu@amd.com>
--- 2.6.21-rc5-git1/drivers/ata/ahci.c.orig 2007-04-07 22:36:51.000000000 +0800
+++ 2.6.21-rc5-git1/drivers/ata/ahci.c 2007-04-07 22:44:42.000000000 +0800
@@ -80,6 +80,7 @@ enum {
board_ahci_pi = 1,
board_ahci_vt8251 = 2,
board_ahci_ign_iferr = 3,
+ board_ahci_sb600 = 4,
/* global controller registers */
HOST_CAP = 0x00, /* host capabilities */
@@ -168,6 +169,7 @@ enum {
AHCI_FLAG_NO_NCQ = (1 << 24),
AHCI_FLAG_IGN_IRQ_IF_ERR = (1 << 25), /* ignore IRQ_IF_ERR */
AHCI_FLAG_HONOR_PI = (1 << 26), /* honor PORTS_IMPL */
+ AHCI_FLAG_IGN_SERR_INTERNAL = (1 << 27), /* ignore SERR_INTERNAL */
};
struct ahci_cmd_hdr {
@@ -362,6 +364,18 @@ static const struct ata_port_info ahci_p
.udma_mask = 0x7f, /* udma0-6 ; FIXME */
.port_ops = &ahci_ops,
},
+ /* board_ahci_sb600 */
+ {
+ .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_SERR_INTERNAL,
+ .pio_mask = 0x1f, /* pio0-4 */
+ .udma_mask = 0x7f, /* udma0-6 ; FIXME */
+ .port_ops = &ahci_ops,
+ },
+
};
static const struct pci_device_id ahci_pci_tbl[] = {
@@ -399,7 +413,7 @@ static const struct pci_device_id ahci_p
PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci_ign_iferr },
/* ATI */
- { PCI_VDEVICE(ATI, 0x4380), board_ahci }, /* ATI SB600 non-raid */
+ { PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 non-raid */
{ PCI_VDEVICE(ATI, 0x4381), board_ahci }, /* ATI SB600 raid */
/* VIA */
@@ -1067,8 +1081,11 @@ static void ahci_error_intr(struct ata_p
if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR)
irq_stat &= ~PORT_IRQ_IF_ERR;
- if (irq_stat & PORT_IRQ_TF_ERR)
+ if (irq_stat & PORT_IRQ_TF_ERR) {
err_mask |= AC_ERR_DEV;
+ if (ap->flags & AHCI_FLAG_IGN_SERR_INTERNAL)
+ serror &= ~SERR_INTERNAL;
+ }
if (irq_stat & (PORT_IRQ_HBUS_ERR | PORT_IRQ_HBUS_DATA_ERR)) {
err_mask |= AC_ERR_HOST_BUS;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ahci.c: walkaround for SB600 SATA internal error issue
2007-03-27 10:33 [PATCH] ahci.c: walkaround for SB600 SATA internal error issue Conke Hu
@ 2007-03-27 10:48 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2007-03-27 10:48 UTC (permalink / raw)
To: Conke Hu; +Cc: Jeff Garzik, Alan, Linux Kernel Mailing List, linux-ide
Conke Hu wrote:
> There is a HW issue in ATI SB600 SATA that PxSERR.E should not be
> set on some conditions, for example, when there is no media in SATA
> CD/DVD drive or media is not ready, AHCI controller fails to execute
> ATAPI commands and reports PORT_IRQ_TF_ERR, but ATI SB600 SATA
> controller sets PxSERR.E at the
> same time, which is not necessary.
> This patch is just to ignore the INTERNAL ERROR in such case.
> Without this patch, ahci error handler will report many errors as
> below:
> ----------- cut from dmesg -----------
> ata9: soft resetting port
> ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> ata9.00: configured for UDMA/33
> ata9: EH complete
> ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
> ata9.00: (irq_stat 0x40000001)
> ata9.00: cmd a0/00:00:00:00:20/00:00:00:00:00/a0 tag 0 cdb 0x0 data 0
> res 51/24:03:00:00:20/00:00:00:00:00/a0 Emask 0x40 (internal error)
> ata9: soft resetting port
> ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> ata9.00: configured for UDMA/33
> ata9: EH complete
> ata9.00: exception Emask 0x40 SAct 0x0 SErr 0x800 action 0x2
> ata9.00: (irq_stat 0x40000001)
> ata9.00: cmd a0/01:00:00:00:00/00:00:00:00:00/a0 tag 0 cdb 0x43 data 12 in
> res 51/24:03:00:00:00/00:00:00:00:00/a0 Emask 0x40 (internal error)
> -------- end cut ---------
>
> Signed-off-by: Conke Hu <conke.hu@amd.com>
Acked-by: Tejun Heo <htejun@gmail.com>
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-27 10:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-27 10:33 [PATCH] ahci.c: walkaround for SB600 SATA internal error issue Conke Hu
2007-03-27 10:48 ` Tejun Heo
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).