sata_sil24: don't use NCQ if marvell 4140 PMP is attached
authorTejun Heo <htejun@gmail.com>
Sun, 18 May 2008 16:15:13 +0000 (01:15 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 19 May 2008 21:51:48 +0000 (17:51 -0400)
When 4140 PMP is attached to sil24, NCQ commands to fan out port 1 and
2 (0 based) often stall if commands are in progress to other ports.
I've tried a number of things but can't tell what's going on.  It
never happens w/ ahci and reportedly sata_mv which can issue NCQ
commands to multiple devices simultaneously like sil24 does.

Disable NCQ for devices behind 4140 PMP for the time being.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/sata_sil24.c

index 27a110110077847b65e630cd11896b2e6195f75b..8ee6b5b4ede7bca0940783b37756b8b5f4aba158 100644 (file)
@@ -899,14 +899,25 @@ static bool sil24_qc_fill_rtf(struct ata_queued_cmd *qc)
 
 static void sil24_pmp_attach(struct ata_port *ap)
 {
+       u32 *gscr = ap->link.device->gscr;
+
        sil24_config_pmp(ap, 1);
        sil24_init_port(ap);
+
+       if (sata_pmp_gscr_vendor(gscr) == 0x11ab &&
+           sata_pmp_gscr_devid(gscr) == 0x4140) {
+               ata_port_printk(ap, KERN_INFO,
+                       "disabling NCQ support due to sil24-mv4140 quirk\n");
+               ap->flags &= ~ATA_FLAG_NCQ;
+       }
 }
 
 static void sil24_pmp_detach(struct ata_port *ap)
 {
        sil24_init_port(ap);
        sil24_config_pmp(ap, 0);
+
+       ap->flags |= ATA_FLAG_NCQ;
 }
 
 static int sil24_pmp_hardreset(struct ata_link *link, unsigned int *class,