mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Albert Lee <trisk@jhu.edu>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] hpt366: HPT372N rev 2 controller fix
Date: Thu, 21 Apr 2005 01:54:15 -0400	[thread overview]
Message-ID: <200504210154.20031.trisk@jhu.edu> (raw)


[-- 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 --]

             reply	other threads:[~2005-04-21  5:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-21  5:54 Albert Lee [this message]
2005-04-21  9:47 ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504210154.20031.trisk@jhu.edu \
    --to=trisk@jhu.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®