mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Torben Mathiasen <torben.mathiasen@hp.com>,
	Tomas Szepe <szepe@pinerecords.com>
Cc: linux-kernel@vger.kernel.org
Subject: [RFT][PATCH] fix ServerWorks PIO auto-tuning
Date: Thu, 16 Oct 2003 23:44:09 +0200	[thread overview]
Message-ID: <200310162344.09021.bzolnier@elka.pw.edu.pl> (raw)


Hi,

I wonder if this patch fixes problems (reported back in 2.4.21 days)
with CSB5 IDE and Compaq Proliant machines.  Please test it if you can.

thanks,
--bartlomiej

[IDE] fix ServerWorks PIO auto-tuning

If PIO mode should be auto-tuned xferspeed argument for svwks_tune_chipset()
is equal to 255 (0xFF).  It is then passed to ide_rate_filter() which matches
desired mode with chipset capabilities.  Since 255 is greater than any of the
values used for transfer modes, ide_rate_filter() will always return the
highest mode supported by both device/chipset (which sometimes should not be
used ie. when host is a simplex one) and the wrong mode will be set.

 drivers/ide/pci/serverworks.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -puN drivers/ide/pci/serverworks.c~ide-serverworks-fix drivers/ide/pci/serverworks.c
--- linux-2.6.0-test7/drivers/ide/pci/serverworks.c~ide-serverworks-fix	2003-10-16 23:03:11.844836632 +0200
+++ linux-2.6.0-test7-root/drivers/ide/pci/serverworks.c	2003-10-16 23:36:01.068469136 +0200
@@ -272,7 +272,7 @@ static int svwks_tune_chipset (ide_drive
 
 	ide_hwif_t *hwif	= HWIF(drive);
 	struct pci_dev *dev	= hwif->pci_dev;
-	u8 speed		= ide_rate_filter(svwks_ratemask(drive), xferspeed);
+	u8 speed;
 	u8 pio			= ide_get_best_pio_mode(drive, 255, 5, NULL);
 	u8 unit			= (drive->select.b.unit & 0x01);
 	u8 csb5			= svwks_csb_check(dev);
@@ -280,6 +280,11 @@ static int svwks_tune_chipset (ide_drive
 	u8 dma_timing		= 0, pio_timing = 0;
 	u16 csb5_pio		= 0;
 
+	if (xferspeed == 255)	/* PIO auto-tuning */
+		speed = XFER_PIO_0 + pio;
+	else
+		speed = ide_rate_filter(svwks_ratemask(drive), xferspeed);
+
 	/* If we are about to put a disk into UDMA mode we screwed up.
 	   Our code assumes we never _ever_ do this on an OSB4 */
 	   

_


             reply	other threads:[~2003-10-16 21:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-16 21:44 Bartlomiej Zolnierkiewicz [this message]
2003-10-17  7:37 ` Tomas Szepe
2003-10-17  9:30   ` Bartlomiej Zolnierkiewicz
2003-10-17  9:51 ` Torben Mathiasen
2003-10-17 10:22   ` Bartlomiej Zolnierkiewicz
2003-10-17 10:20     ` Torben Mathiasen
2003-10-17 10:23   ` Tomas Szepe
2003-10-18 13:02 ` Tomas Szepe
2003-10-18 15:45   ` Bartlomiej Zolnierkiewicz
2003-10-20  9:24     ` Torben Mathiasen
2003-10-20 10:44       ` Tomas Szepe

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=200310162344.09021.bzolnier@elka.pw.edu.pl \
    --to=b.zolnierkiewicz@elka.pw.edu.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=szepe@pinerecords.com \
    --cc=torben.mathiasen@hp.com \
    /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®