[PATCH 2/2 v1] pata_via.c: Patch the behavior of via chipsets.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch is to patch the behavior of via chipsets, which will reset the DEV 
register to be reset value after changing the IEN bit on CTL register to cause
channel reset. For some controllers, the pata_via default processing flow will
work OK, because the controller will cache the value of the registers until it
receives a set device operation (write the device register). By following the
ATA/ATAPI protocol, DEV bit should be set before issuing ATA/ATAPI commands to
device. And this patch is to set DEV bit after IEN bit is set of VIA chipset
VX700/CX700, VX800/V820 and VX855 series.


Signed-off-by: Joseph Chan <josephchan@xxxxxxxxxx>

--- a/drivers/ata/pata_via.c	2009-01-16 02:36:58.000000000 +0800
+++ a/drivers/ata/pata_via.c	2009-01-16 02:39:04.000000000 +0800
@@ -347,12 +347,11 @@
  */
 static void via_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
 {
-	struct ata_taskfile tmp_tf;
+	struct ata_ioports *ioaddr = &ap->ioaddr;
 
-	if (ap->ctl != ap->last_ctl && !(tf->flags & ATA_TFLAG_DEVICE)) {
-		tmp_tf = *tf;
-		tmp_tf.flags |= ATA_TFLAG_DEVICE;
-		tf = &tmp_tf;
+	if (tf->ctl != ap->last_ctl) {
+		iowrite8(tf->ctl, ioaddr->ctl_addr);
+		iowrite8(tf->device, ioaddr->device_addr);
 	}
 	ata_sff_tf_load(ap, tf);
 } 
��.n��������+%������w��{.n�����{��'^�)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux