diff options
| -rw-r--r-- | drivers/ata/pata_via.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 78eac276effb..0d97890af681 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
| @@ -303,14 +303,21 @@ static void via_do_set_mode(struct ata_port *ap, struct ata_device *adev, int mo | |||
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | /* Set UDMA unless device is not UDMA capable */ | 305 | /* Set UDMA unless device is not UDMA capable */ |
| 306 | if (udma_type && t.udma) { | 306 | if (udma_type) { |
| 307 | u8 cable80_status; | 307 | u8 udma_etc; |
| 308 | 308 | ||
| 309 | /* Get 80-wire cable detection bit */ | 309 | pci_read_config_byte(pdev, 0x50 + offset, &udma_etc); |
| 310 | pci_read_config_byte(pdev, 0x50 + offset, &cable80_status); | ||
| 311 | cable80_status &= 0x10; | ||
| 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 | ||
