Reinhard Brandstädter wrote: > On Friday 21 April 2006 09:24, Albert Lee wrote: > >>From the dmesg, PX-712SA looks like a PATA drive bridged to SATA. >>Could you try the atapi_dmadir=1 module parameter and check if it helps? >>(For older kernels, please #define ATAPI_ENABLE_DMADIR >>in include/linux/libata.h and recompile the kernel.) > > > Indeed the PX-712SA is a bridged PATA drive. In the POST message it's even > reported as PX-712A (the ATAPI model). > I've tried to pass libata.atapi_dmadir=1 to the kernel but looking at dmesg > nothing changed (using kernel 2.6.16). I even changed libata.h and defined > ATAPI_ENABLE_DMADIR - same result. > > What else could I try? > So, it is not the DMADIR problem... According to the Plextor website (http://www.plextor.com/English/support/media_712SA.htm), the PX-712SA works with VIA SATA only in PIO mode. (The website doesn't say why.) Maybe updating the firmware of PX-712SA can help? Otherwise, please try the attached patch to blacklist PX-712SX DMA for sata_via. -- albert --- upstream0/drivers/scsi/sata_via.c 2006-04-24 17:36:23.000000000 +0800 +++ upstream1/drivers/scsi/sata_via.c 2006-04-24 17:37:06.000000000 +0800 @@ -72,6 +72,7 @@ enum { }; static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); +static void svia_dev_config(struct ata_port *ap, struct ata_device *dev); static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg); static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); @@ -82,6 +83,14 @@ static const struct pci_device_id svia_p { } /* terminate list */ }; +static const struct svia_drivelist { + const char *product; + const char *revision; +} svia_blacklist [] = { + { "DVDR PX-712A", NULL }, + { } +}; + static struct pci_driver svia_pci_driver = { .name = DRV_NAME, .id_table = svia_pci_tbl, @@ -108,6 +117,7 @@ static struct scsi_host_template svia_sh static const struct ata_port_operations svia_sata_ops = { .port_disable = ata_port_disable, + .dev_config = svia_dev_config, .tf_load = ata_tf_load, .tf_read = ata_tf_read, @@ -153,6 +163,50 @@ MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(pci, svia_pci_tbl); MODULE_VERSION(DRV_VERSION); +/** + * svia_dev_config - Apply device/host-specific errata fixups + * @ap: Port containing device to be examined + * @dev: Device to be examined + * + * After the IDENTIFY [PACKET] DEVICE step is complete, and a + * device is known to be present, this function is called. + * + * According to + * http://www.plextor.com/English/support/media_712SA.htm, + * the Plextor PX-712SA drive works with VIA SATA + * in PIO mode only. Root cause unknown yet. + * The bad thing is, PX-712SA is actually a PX-712A bridged + * to SATA and it report itself as PX-712A. Maybe PX-712A + * works ok with VIA SATA + external (non-on-device) bridges? + */ +static void svia_dev_config(struct ata_port *ap, struct ata_device *dev) +{ + unsigned char model_num[41]; + unsigned char model_rev[9]; + int i, blacklisted = 0; + + ata_id_c_string(dev->id, model_num, ATA_ID_PROD_OFS, sizeof(model_num)); + ata_id_c_string(dev->id, model_rev, ATA_ID_FW_REV_OFS, sizeof(model_rev)); + + /* check whether the drive is blacklisted */ + for (i = 0; svia_blacklist[i].product; i++) + if (!strcmp(svia_blacklist[i].product, model_num)) + if (svia_blacklist[i].revision == NULL || + !strcmp(svia_blacklist[i].revision, model_rev)) { + blacklisted = 1; + break; + } + + if (blacklisted) { + /* limit to PIO */ + printk(KERN_INFO "ata%u(%u): applying PIO limit to %s\n", + ap->id, dev->devno, model_num); + dev->mwdma_mask = 0; + dev->udma_mask = 0; + return; + } +} + static u32 svia_scr_read (struct ata_port *ap, unsigned int sc_reg) { if (sc_reg > SCR_CONTROL) - : send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html