* [PATCH] hpt366: HPT372N rev 2 controller fix
@ 2005-04-21 5:54 Albert Lee
2005-04-21 9:47 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Albert Lee @ 2005-04-21 5:54 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 598 bytes --]
A particular revision of the HPT372N oopses hpt366 consistently. It's a
regression caused by Alan's changes in 2.6.9 to support the HPT372N using
only PLL timings. The driver works correctly in prior versions, where the the
PCI clock is used instead. This patch restores that behaviour for this
particular revision.
More info:
http://www.ussg.iu.edu/hypermail/linux/kernel/0410.0/0958.html
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=135515
Please CC replies to me.
-Albert
--
Prediction is very difficult, especially of the future.
-- Niels Bohr
[-- Attachment #1.2: hpt366-hpt372rev2-fix.patch --]
[-- Type: text/x-diff, Size: 1242 bytes --]
--- hpt366.c.orig 2004-11-20 17:13:52.280360000 -0500
+++ hpt366.c 2005-04-21 00:40:38.686009488 -0400
@@ -802,6 +802,9 @@
if((did == 4 && rid == 6) || (did == 5 && rid > 1))
is_372n = 1;
+ /* Check for a HPT372 rev 2, which is a special 372N */
+ if(did == 5 && rid == 2)
+ is_372n = 2;
}
/*
@@ -845,7 +848,25 @@
printk(KERN_INFO "FREQ: %d PLL: %d\n", freq, pll);
- /* We always use the pll not the PCI clock on 372N */
+ /* We always use the pll not the PCI clock on 372N,
+ * except for the 372 rev 2, which works fine with 372A
+ * timings, and needs pci_set_drvdata().
+ */
+ if(is_372n == 2)
+ {
+ if (pll == F_LOW_PCI_33) {
+ pci_set_drvdata(dev, (void *) thirty_three_base_hpt372);
+ printk("HPT37X: HPT372 rev 2 detected, using 33MHz PCI clock\n");
+ } else if (pll == F_LOW_PCI_40) {
+ /* Unsupported */
+ } else if (pll == F_LOW_PCI_50) {
+ pci_set_drvdata(dev, (void *) fifty_base_hpt372);
+ printk("HPT37X: HPT372 rev 2 detected, using 50MHz PCI clock\n");
+ } else {
+ pci_set_drvdata(dev, (void *) sixty_six_base_hpt372);
+ printk("HPT37X: HPT372 rev 2 detected, using 66MHz PCI clock\n");
+ }
+ }
}
else
{
[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] hpt366: HPT372N rev 2 controller fix
2005-04-21 5:54 [PATCH] hpt366: HPT372N rev 2 controller fix Albert Lee
@ 2005-04-21 9:47 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2005-04-21 9:47 UTC (permalink / raw)
To: Albert Lee; +Cc: Linux Kernel Mailing List
On Iau, 2005-04-21 at 06:54, Albert Lee wrote:
> A particular revision of the HPT372N oopses hpt366 consistently. It's a
> regression caused by Alan's changes in 2.6.9 to support the HPT372N using
> only PLL timings. The driver works correctly in prior versions, where the the
> PCI clock is used instead. This patch restores that behaviour for this
> particular revision.
For some drives, if you are lucky. The problem is that the PLL code in
the hpt366 driver is simply wrong. The -ac tree has some cleanup work in
this area but hasn't fixed the PLL code yet. The vendor driver does
handle this chip correctly.
Linus please avoid this patch - better an oops than disk corruption.
Alan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-04-21 10:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-21 5:54 [PATCH] hpt366: HPT372N rev 2 controller fix Albert Lee
2005-04-21 9:47 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®