Commit c4d8a20022e617174eb887c82356d3f513e279a7

Authored by Bartlomiej Zolnierkiewicz
Committed by Jeff Garzik
1 parent 750c7136ea

pata_via: clear UDMA transfer mode bit for PIO and MWDMA

Fix register naming while at it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

Showing 1 changed file with 13 additions and 6 deletions Side-by-side Diff

drivers/ata/pata_via.c
... ... @@ -303,14 +303,21 @@
303 303 }
304 304  
305 305 /* Set UDMA unless device is not UDMA capable */
306   - if (udma_type && t.udma) {
307   - u8 cable80_status;
  306 + if (udma_type) {
  307 + u8 udma_etc;
308 308  
309   - /* Get 80-wire cable detection bit */
310   - pci_read_config_byte(pdev, 0x50 + offset, &cable80_status);
311   - cable80_status &= 0x10;
  309 + pci_read_config_byte(pdev, 0x50 + offset, &udma_etc);
312 310  
313   - pci_write_config_byte(pdev, 0x50 + offset, ut | cable80_status);
  311 + /* clear transfer mode bit */
  312 + udma_etc &= ~0x20;
  313 +
  314 + if (t.udma) {
  315 + /* preserve 80-wire cable detection bit */
  316 + udma_etc &= 0x10;
  317 + udma_etc |= ut;
  318 + }
  319 +
  320 + pci_write_config_byte(pdev, 0x50 + offset, udma_etc);
314 321 }
315 322 }
316 323