mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Tomi Orava" <Tomi.Orava@ncircle.nullnet.fi>
To: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, B.Zolnierkiewicz@elka.pw.edu.pl
Subject: hpt366.c-2.4.23.patch fixes HPT374 ide/dma problems!
Date: Thu, 11 Mar 2004 09:39:52 +0200 (EET)	[thread overview]
Message-ID: <40715.194.237.142.24.1078990792.squirrel@ncircle.nullnet.fi> (raw)

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


Hi everybody,

I have been testing the patch below from Andre Hendrick
for a couple of weeks now with two different machines
and it seems that this patch really fixes the DMA problems
some users (including me) have been suffering with kernel
HPT374-driver in the past (2.4.2x & 2.6.x).

The hardware used in the tests are:
Epox 8K9A3+ (integrated HPT374-chip)
and
Epox 4PCA3+ (integrated HPT374-chip)

The machines seem to run without any IDE-related problems
after this patch even with 4-disks & heavy I/O-traffic.
Please, consider migrating this patch into the official kernel.

Regards,
Tomi Orava


---------------------------- Original Message ----------------------------
Subject: hpt366.c-2.4.23.patch
From:    "Andre Hedrick" <andre@linux-ide.org>
Date:    Fri, February 6, 2004 11:24
To:      linux-kernel@vger.kernel.org
--------------------------------------------------------------------------


For those suffering highpoint errors.

Cheers,

Andre Hedrick
LAD Storage Consulting Group


[-- Attachment #2: hpt366.c-2.4.23.patch --]
[-- Type: text/plain, Size: 2044 bytes --]

--- linux-2.4.23.orig/drivers/ide/pci/hpt366.c	Mon Aug 25 04:44:41 2003
+++ linux-2.4.23/drivers/ide/pci/hpt366.c	Fri Jan  9 21:44:48 2004
@@ -1,7 +1,7 @@
 /*
  * linux/drivers/ide/pci/hpt366.c		Version 0.36	April 25, 2003
  *
- * Copyright (C) 1999-2002		Andre Hedrick <andre@linux-ide.org>
+ * Copyright (C) 1999-2003		Andre Hedrick <andre@linux-ide.org>
  * Portions Copyright (C) 2001	        Sun Microsystems, Inc.
  * Portions Copyright (C) 2003		Red Hat Inc
  *
@@ -668,6 +668,35 @@
 	return __ide_dma_lostirq(drive);
 }
 
+/* returns 1 if dma irq issued, 0 otherwise */
+static int hpt374_ide_dma_test_irq (ide_drive_t *drive)
+{
+		        
+	ide_hwif_t *hwif	= HWIF(drive);
+	u16 bfifo		= 0;
+	u8 reginfo		= hwif->channel ? 0x56 : 0x52;
+	u8 dma_stat		= 0;
+
+	pci_read_config_word(hwif->pci_dev, reginfo, &bfifo);
+	if (bfifo & 0x1FF) {
+//		printk("%s: %d bytes in FIFO\n", drive->name, bfifo);
+		return 0;
+	}
+
+	dma_stat = hwif->INB(hwif->dma_status);
+	/* return 1 if INTR asserted */
+	if ((dma_stat & 4) == 4)
+		return 1;
+
+	if (!drive->waiting_for_dma)
+		printk(KERN_WARNING "%s: (%s) called while not waiting\n",
+				drive->name, __FUNCTION__);
+#if 0
+	drive->waiting_for_dma++;
+#endif
+	return 0;
+}
+
 static int hpt374_ide_dma_end (ide_drive_t *drive)
 {
 	struct pci_dev *dev	= HWIF(drive)->pci_dev;
@@ -1245,11 +1274,13 @@
 		hwif->udma_four = ((ata66 & regmask) ? 0 : 1);
 	hwif->ide_dma_check = &hpt366_config_drive_xfer_rate;
 
-	if (hpt_minimum_revision(dev,8))
+	if (hpt_minimum_revision(dev,8)) {
+		hwif->ide_dma_test_irq = &hpt374_ide_dma_test_irq;
 		hwif->ide_dma_end = &hpt374_ide_dma_end;
-	else if (hpt_minimum_revision(dev,5))
+	} else if (hpt_minimum_revision(dev,5)) {
+		hwif->ide_dma_test_irq = &hpt374_ide_dma_test_irq;
 		hwif->ide_dma_end = &hpt374_ide_dma_end;
-	else if (hpt_minimum_revision(dev,3)) {
+	} else if (hpt_minimum_revision(dev,3)) {
 		hwif->ide_dma_begin = &hpt370_ide_dma_begin;
 		hwif->ide_dma_end = &hpt370_ide_dma_end;
 		hwif->ide_dma_timeout = &hpt370_ide_dma_timeout;

                 reply	other threads:[~2004-03-11  7:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=40715.194.237.142.24.1078990792.squirrel@ncircle.nullnet.fi \
    --to=tomi.orava@ncircle.nullnet.fi \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=linux-ide@vger.kernel.org \
    --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®