Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4d8a200 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Jeff Garzik
Browse files

pata_via: clear UDMA transfer mode bit for PIO and MWDMA



Fix register naming while at it.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 750c7136
Loading
Loading
Loading
Loading
+13 −6
Original line number Original line Diff line number Diff line
@@ -303,14 +303,21 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo
	}
	}


	/* Set UDMA unless device is not UDMA capable */
	/* Set UDMA unless device is not UDMA capable */
	if (udma_type && t.udma) {
	if (udma_type) {
		u8 cable80_status;
		u8 udma_etc;


		/* Get 80-wire cable detection bit */
		pci_read_config_byte(pdev, 0x50 + offset, &udma_etc);
		pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
		cable80_status &= 0x10;


		pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
		/* clear transfer mode bit */
		udma_etc &= ~0x20;

		if (t.udma) {
			/* preserve 80-wire cable detection bit */
			udma_etc &= 0x10;
			udma_etc |= ut;
		}

		pci_write_config_byte(pdev, 0x50 + offset, udma_etc);
	}
	}
}
}