aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r--drivers/ide/pci/hpt366.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 9fce25bdec8a..edb267c78afc 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/hpt366.c Version 1.22 Dec 4, 2007 2 * linux/drivers/ide/pci/hpt366.c Version 1.23 Dec 7, 2007
3 * 3 *
4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -689,19 +689,17 @@ static void hpt36x_set_mode(ide_drive_t *drive, const u8 speed)
689 struct hpt_info *info = pci_get_drvdata(dev); 689 struct hpt_info *info = pci_get_drvdata(dev);
690 u8 itr_addr = drive->dn ? 0x44 : 0x40; 690 u8 itr_addr = drive->dn ? 0x44 : 0x40;
691 u32 old_itr = 0; 691 u32 old_itr = 0;
692 u32 itr_mask, new_itr; 692 u32 new_itr = get_speed_setting(speed, info);
693 693 u32 itr_mask = speed < XFER_MW_DMA_0 ? 0xc1f8ffff :
694 itr_mask = speed < XFER_MW_DMA_0 ? 0x30070000 : 694 (speed < XFER_UDMA_0 ? 0x303800ff :
695 (speed < XFER_UDMA_0 ? 0xc0070000 : 0xc03800ff); 695 0x30070000);
696
697 new_itr = get_speed_setting(speed, info);
698 696
697 pci_read_config_dword(dev, itr_addr, &old_itr);
698 new_itr = (old_itr & ~itr_mask) | (new_itr & itr_mask);
699 /* 699 /*
700 * Disable on-chip PIO FIFO/buffer (and PIO MST mode as well) 700 * Disable on-chip PIO FIFO/buffer (and PIO MST mode as well)
701 * to avoid problems handling I/O errors later 701 * to avoid problems handling I/O errors later
702 */ 702 */
703 pci_read_config_dword(dev, itr_addr, &old_itr);
704 new_itr = (new_itr & ~itr_mask) | (old_itr & itr_mask);
705 new_itr &= ~0xc0000000; 703 new_itr &= ~0xc0000000;
706 704
707 pci_write_config_dword(dev, itr_addr, new_itr); 705 pci_write_config_dword(dev, itr_addr, new_itr);
@@ -714,16 +712,14 @@ static void hpt37x_set_mode(ide_drive_t *drive, const u8 speed)
714 struct hpt_info *info = pci_get_drvdata(dev); 712 struct hpt_info *info = pci_get_drvdata(dev);
715 u8 itr_addr = 0x40 + (drive->dn * 4); 713 u8 itr_addr = 0x40 + (drive->dn * 4);
716 u32 old_itr = 0; 714 u32 old_itr = 0;
717 u32 itr_mask, new_itr; 715 u32 new_itr = get_speed_setting(speed, info);
718 716 u32 itr_mask = speed < XFER_MW_DMA_0 ? 0xcfc3ffff :
719 itr_mask = speed < XFER_MW_DMA_0 ? 0x303c0000 : 717 (speed < XFER_UDMA_0 ? 0x31c001ff :
720 (speed < XFER_UDMA_0 ? 0xc03c0000 : 0xc1c001ff); 718 0x303c0000);
721
722 new_itr = get_speed_setting(speed, info);
723 719
724 pci_read_config_dword(dev, itr_addr, &old_itr); 720 pci_read_config_dword(dev, itr_addr, &old_itr);
725 new_itr = (new_itr & ~itr_mask) | (old_itr & itr_mask); 721 new_itr = (old_itr & ~itr_mask) | (new_itr & itr_mask);
726 722
727 if (speed < XFER_MW_DMA_0) 723 if (speed < XFER_MW_DMA_0)
728 new_itr &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */ 724 new_itr &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */
729 pci_write_config_dword(dev, itr_addr, new_itr); 725 pci_write_config_dword(dev, itr_addr, new_itr);