diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2007-02-07 12:18:20 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-02-07 12:18:20 -0500 |
commit | 6273d26a5b280cb96b804424de323560b301ca51 (patch) | |
tree | 69c79073c85bab2767db45fe33014fbda8572e7b /drivers | |
parent | 7b73ee05d0acb926923d43d78b61add776ea4bb1 (diff) |
hpt366: HPT36x PCI clock detection fix
Fix minor coding mistake in the HPT36x PCI clock detection code noticed by
Bartlomiej Zolnierkiewicz -- it always reported 33 MHz due to the missing
'break' statements. This, however, most probably never mattered -- in fact, I
was thinking of removing the 25/40 MHz cases completely since HPT36x BIOSes
didn't seem to set any other value than 7 into the 'cmd_high_time' field, i.e.
supported only 33 MHz PCI.
Note that in the original driver there was another bug: 25 and 40 MHz cases
were interchanged. Since the 'cmd_high_time' field is in units of PCI clocks,
a lower clock count just *cannot* correspond to a higher frequency, i. e. it
should be 5 for 25 MHz PCI and 9 for 40 MHz PCI, not the other way around.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/pci/hpt366.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 4350e3371360..05be8fadda7a 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.00 Jun 25, 2006 | 2 | * linux/drivers/ide/pci/hpt366.c Version 1.01 Dec 23, 2006 |
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. |
@@ -107,7 +107,8 @@ | |||
107 | * frequency | 107 | * frequency |
108 | * - switch to using the DPLL clock and enable UltraATA/133 mode by default on | 108 | * - switch to using the DPLL clock and enable UltraATA/133 mode by default on |
109 | * anything newer than HPT370/A | 109 | * anything newer than HPT370/A |
110 | * - fold PCI clock detection and DPLL setup code into init_chipset_hpt366(); | 110 | * - fold PCI clock detection and DPLL setup code into init_chipset_hpt366(), |
111 | * also fixing the interchanged 25/40 MHz PCI clock cases for HPT36x chips; | ||
111 | * unify HPT36x/37x timing setup code and the speedproc handlers by joining | 112 | * unify HPT36x/37x timing setup code and the speedproc handlers by joining |
112 | * the register setting lists into the table indexed by the clock selected | 113 | * the register setting lists into the table indexed by the clock selected |
113 | * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com> | 114 | * Sergei Shtylyov, <sshtylyov@ru.mvista.com> or <source@mvista.com> |
@@ -1125,11 +1126,14 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const cha | |||
1125 | switch((itr1 >> 8) & 0x07) { | 1126 | switch((itr1 >> 8) & 0x07) { |
1126 | case 0x09: | 1127 | case 0x09: |
1127 | pci_clk = 40; | 1128 | pci_clk = 40; |
1129 | break; | ||
1128 | case 0x05: | 1130 | case 0x05: |
1129 | pci_clk = 25; | 1131 | pci_clk = 25; |
1132 | break; | ||
1130 | case 0x07: | 1133 | case 0x07: |
1131 | default: | 1134 | default: |
1132 | pci_clk = 33; | 1135 | pci_clk = 33; |
1136 | break; | ||
1133 | } | 1137 | } |
1134 | } | 1138 | } |
1135 | 1139 | ||