aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_serverworks.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_serverworks.c')
-rw-r--r--drivers/ata/pata_serverworks.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index df68806df4be..8bed88873720 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -274,28 +274,27 @@ static void serverworks_set_dmamode(struct ata_port *ap, struct ata_device *adev
274{ 274{
275 static const u8 dma_mode[] = { 0x77, 0x21, 0x20 }; 275 static const u8 dma_mode[] = { 0x77, 0x21, 0x20 };
276 int offset = 1 + 2 * ap->port_no - adev->devno; 276 int offset = 1 + 2 * ap->port_no - adev->devno;
277 int devbits = (2 * ap->port_no + adev->devno); 277 int devbits = 2 * ap->port_no + adev->devno;
278 u8 ultra; 278 u8 ultra;
279 u8 ultra_cfg; 279 u8 ultra_cfg;
280 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 280 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
281 281
282 pci_read_config_byte(pdev, 0x54, &ultra_cfg); 282 pci_read_config_byte(pdev, 0x54, &ultra_cfg);
283 pci_read_config_byte(pdev, 0x56 + ap->port_no, &ultra);
284 ultra &= ~(0x0F << (adev->devno * 4));
283 285
284 if (adev->dma_mode >= XFER_UDMA_0) { 286 if (adev->dma_mode >= XFER_UDMA_0) {
285 pci_write_config_byte(pdev, 0x44 + offset, 0x20); 287 pci_write_config_byte(pdev, 0x44 + offset, 0x20);
286 288
287 pci_read_config_byte(pdev, 0x56 + ap->port_no, &ultra);
288 ultra &= ~(0x0F << (ap->port_no * 4));
289 ultra |= (adev->dma_mode - XFER_UDMA_0) 289 ultra |= (adev->dma_mode - XFER_UDMA_0)
290 << (ap->port_no * 4); 290 << (adev->devno * 4);
291 pci_write_config_byte(pdev, 0x56 + ap->port_no, ultra);
292
293 ultra_cfg |= (1 << devbits); 291 ultra_cfg |= (1 << devbits);
294 } else { 292 } else {
295 pci_write_config_byte(pdev, 0x44 + offset, 293 pci_write_config_byte(pdev, 0x44 + offset,
296 dma_mode[adev->dma_mode - XFER_MW_DMA_0]); 294 dma_mode[adev->dma_mode - XFER_MW_DMA_0]);
297 ultra_cfg &= ~(1 << devbits); 295 ultra_cfg &= ~(1 << devbits);
298 } 296 }
297 pci_write_config_byte(pdev, 0x56 + ap->port_no, ultra);
299 pci_write_config_byte(pdev, 0x54, ultra_cfg); 298 pci_write_config_byte(pdev, 0x54, ultra_cfg);
300} 299}
301 300