All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christer Weinigel <christer@weinigel.se>
To: Robert Schwebel <robert@schwebel.de>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: MediaGX/Geode performance fix, Was: Which processor/board for embedded NTP
Date: 19 Sep 2002 21:39:04 +0200	[thread overview]
Message-ID: <873cs5vkfb.fsf_-_@zoo.weinigel.se> (raw)
In-Reply-To: <20020919060218.GD10773@pengutronix.de>

This mail contains a patch to fix a performance problem with many
Cyrix MediaGX/NatSemi Geode platforms.  The register settings have
been officially recommended by NatSemi themselves.  The patch is
against linux-2.4.20-pre7.  Should this be merged into the mainsteam
linux kernel?

Robert Schwebel <robert@schwebel.de> writes:

> Hi Christer, 
> 
> On Wed, Sep 18, 2002 at 09:37:02PM +0200, Christer Weinigel wrote:
> > On the newer "IA on a chip" geodes (SC1200, SC2200 and SC3200) there
> > is also a high speed timer in the chipset that seems to be quite
> > stable.
> 
> Did the realtime behaviour of the newer Geodes also change to the
> better? Last time we tested them with RTAI there have been Buslocks
> which prevented them from being usefull...

Speaking about this, there is a bug in many BIOS:es for the Cyrix
MediaGX and Natsemi Geode that according to the BIOS errata will lower
the performance of master PCI transfers from 70MB/s to 25MB/s.

What happens is that the bit SDBE is set to 1 when it should be set to
0, causing PCI disconnects every 16 bytes which is slow.

    Index 41h PCI Control Function 2 Register (R/W)

    3:2 SDB Slave Disconnect Boundary: PCI slave issues a disconnect with
    data when it crosses line boundary:
        00 = 128 bytes
        01 = 256 bytes
        10 = 512 bytes
        11 = 1024 bytes
    Works in conjunction with bit 1.

    1 SDBE Slave Disconnect Boundary Enable:
        0 = PCI slave disconnects on boundaries set by bits [3:2].
        1 = PCI disconnects on cache line boundary which is 16 bytes.

So, this patch just sets the SDBE bit to 0 and prints a message to
that effect.

  /Christer

diff -ur linux/drivers/pci/quirks.c.orig linux/drivers/pci/quirks.c
--- linux/drivers/pci/quirks.c.orig	Thu Sep 19 21:34:21 2002
+++ linux/drivers/pci/quirks.c	Thu Sep 19 21:35:07 2002
@@ -477,6 +477,24 @@
 }
 
 /*
+ * Common misconfiguration of the MediaGX/Geode PCI master that will
+ * reduce PCI bandwidth from 70MB/s to 25MB/s.  See the GXM/GXLV/GX1
+ * datasheets found at http://www.national.com/ds/GX for info on what
+ * these bits do.  <christer@weinigel.se>
+ */
+ 
+static void __init quirk_mediagx_master(struct pci_dev *dev)
+{
+	u8 reg;
+	pci_read_config_byte(dev, 0x41, &reg);
+	if (reg & 2) {
+		reg &= ~2;
+		printk(KERN_INFO "PCI: Fixup for MediaGX/Geode Slave Disconnect Boundary (0x41=0x%02x)\n", reg);
+                pci_write_config_byte(dev, 0x41, reg);
+	}
+}
+
+/*
  *  The main table of quirks.
  */
 
@@ -538,6 +556,8 @@
 	 */
 	{ PCI_FIXUP_HEADER,	PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82380FB,	quirk_transparent_bridge },
 
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_CYRIX,	PCI_DEVICE_ID_CYRIX_PCI_MASTER, quirk_mediagx_master },
+
 	{ 0 }
 };
 
-- 
"Just how much can I get away with and still go to heaven?"

Freelance consultant specializing in device driver programming for Linux 
Christer Weinigel <christer@weinigel.se>  http://www.weinigel.se

  reply	other threads:[~2002-09-19 19:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-18 13:10 Which processor/board for embedded NTP Olaf Frączyk
2002-09-18 13:58 ` Alan Cox
2002-09-18 14:24 ` Athlon/via problems continued Kirk Reiser
2002-09-18 19:37 ` Which processor/board for embedded NTP Christer Weinigel
2002-09-19  6:02   ` Robert Schwebel
2002-09-19 19:39     ` Christer Weinigel [this message]
2002-09-19 23:11       ` MediaGX/Geode performance fix, Was: " Alan Cox
2002-09-20  9:59         ` Christer Weinigel

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=873cs5vkfb.fsf_-_@zoo.weinigel.se \
    --to=christer@weinigel.se \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert@schwebel.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.