linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan Laurie <duncan@sun.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Olivier Bornet <Olivier.Bornet@puck.ch>
Subject: Re: problem with Serverworks CSB5 IDE
Date: Thu, 24 Apr 2003 14:51:24 -0700	[thread overview]
Message-ID: <3EA85C5C.7060402@sun.com> (raw)
In-Reply-To: <20030424080023.GG21689@puck.ch>

[-- Attachment #1: Type: text/plain, Size: 1401 bytes --]

Olivier Bornet wrote:
> Hi all,
> 
> I reply to myself, after having test this solution.
> 
> 
>>At this time, I have compiled and installed a 2.4.20-ac2 + some cobalt
>>patches. Is the bug also fixed in 2.4.20-ac2, or must I rebuild the
>>2.4.20 with the check commented out ?
> 
> 
> The 2.4.20-ac2 patched kernel help a little : the system don't crash
> anymore. But the disk is marked as defective, and is removed from the
> raid1 metadevice.
> 
> One other problem with the -ac2 is the speed for the rebuild : it seems
> to be 2 times slower than with the Ducan patch. (about 2 hours instead
> of 1 hour).
> 
> So, my solution is to use the patch from Ducan. I hope it (or a
> derivative form of it) will be included in the next kernel releases.
> 
> Good day, and thanks all for the help.
>

Here is a 2.4.21-rc1 version of the patch, with a few modificaions
due to the changes in IDE..

Actually UDMA mode detection is not working at all for CSB5 in
2.4.21-rc1 because svwks_revision variable is set in __init function
so was reading as 0 in svwks_ratemask().  This made it think UDMA
mode 2 was the max supported, when in reality new revisions do UDMA
mode 5 and old revisions are mode 4 max.

The bad_ata100 list has been extended to include the whole family
of Barracuda ATA IV drives; we only shipped the 80gb and 40gb models
from that series so the others were not listed before.

-duncan

[-- Attachment #2: serverworks-2.4.21-rc1.diff --]
[-- Type: text/plain, Size: 2213 bytes --]

diff -ruN linux-2.4.21-rc1.orig/drivers/ide/pci/serverworks.c linux-2.4.21-rc1/drivers/ide/pci/serverworks.c
--- linux-2.4.21-rc1.orig/drivers/ide/pci/serverworks.c	Thu Apr 24 14:16:28 2003
+++ linux-2.4.21-rc1/drivers/ide/pci/serverworks.c	Thu Apr 24 14:41:26 2003
@@ -203,11 +203,22 @@
 }
 #endif  /* defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) */
 
+static int check_in_drive_lists (ide_drive_t *drive, const char **list)
+{
+	while (*list)
+		if (!strcmp(*list++, drive->id->model))
+			return 1;
+	return 0;
+}
+
 static u8 svwks_ratemask (ide_drive_t *drive)
 {
 	struct pci_dev *dev     = HWIF(drive)->pci_dev;
 	u8 mode;
 
+	if (!svwks_revision)
+		pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision);
+
 	if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
 		u32 reg = 0;
 		if (isa_dev)
@@ -221,13 +232,15 @@
 		/* Check the OSB4 DMA33 enable bit */
 		return ((reg & 0x00004000) == 0x00004000) ? 1 : 0;
 	} else if (svwks_revision < SVWKS_CSB5_REVISION_NEW) {
-		return 1;
+		return 2;
 	} else if (svwks_revision >= SVWKS_CSB5_REVISION_NEW) {
 		u8 btr = 0;
 		pci_read_config_byte(dev, 0x5A, &btr);
-		mode = btr;
+		mode = btr & 0x3;
 		if (!eighty_ninty_three(drive))
 			mode = min(mode, (u8)1);
+		if (mode == 3 && check_in_drive_lists(drive, svwks_bad_ata100))
+			mode = 2;
 	}
 	if (((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) ||
 	     (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) &&
diff -ruN linux-2.4.21-rc1.orig/drivers/ide/pci/serverworks.h linux-2.4.21-rc1/drivers/ide/pci/serverworks.h
--- linux-2.4.21-rc1.orig/drivers/ide/pci/serverworks.h	Thu Apr 24 14:16:28 2003
+++ linux-2.4.21-rc1/drivers/ide/pci/serverworks.h	Thu Apr 24 14:41:41 2003
@@ -11,6 +11,16 @@
 #define SVWKS_CSB5_REVISION_NEW	0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */
 #define SVWKS_CSB6_REVISION	0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */
 
+/* Seagate Barracuda ATA IV Family drives in UDMA mode 5
+ * can overrun their FIFOs when used with the CSB5 */
+const char *svwks_bad_ata100[] = {
+	"ST320011A",
+	"ST340016A",
+	"ST360021A",
+	"ST380021A",
+	NULL
+};
+
 #define DISPLAY_SVWKS_TIMINGS	1
 
 #if defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS)

  reply	other threads:[~2003-04-24 21:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-23 21:27 problem with a cobalt RaQ550 system and DMA (Serverworks OSB4 in impossible state) Olivier Bornet
2003-04-23 22:21 ` Alan Cox
2003-04-23 23:29   ` Olivier Bornet
2003-04-24  8:00     ` Olivier Bornet
2003-04-24 21:51       ` Duncan Laurie [this message]
2003-04-24 23:52         ` problem with Serverworks CSB5 IDE Duncan Laurie
2003-04-25 11:00         ` Alan Cox
2003-04-25 16:39           ` Duncan Laurie
2003-04-25 15:42             ` Alan Cox
2003-04-25 18:52               ` Duncan Laurie
2003-04-25 18:02                 ` Alan Cox
2003-04-28 13:03                 ` Alan Cox
2003-04-24  0:02 ` problem with a cobalt RaQ550 system and DMA (Serverworks OSB4 in impossible state) Duncan Laurie
2003-04-24  7:55   ` Olivier Bornet

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=3EA85C5C.7060402@sun.com \
    --to=duncan@sun.com \
    --cc=Olivier.Bornet@puck.ch \
    --cc=alan@lxorguk.ukuu.org.uk \
    --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;
as well as URLs for NNTP newsgroup(s).