2001-03-13 22:33:41

by rct

[permalink] [raw]
Subject: another Cyrix/mtrr problem?

Since I've seen a few other posts on the subject, I might as well
poke my head out of the foxhole long enough to get shot at :-).

System is a Tyan S1590S motherboard (Apollo MVP3 chipset) with
Cyrix MII 300 processor, NVIDIA GeForce2 MX AGP video card, 2.4.2
kernel, XFree86-4.0.2, and the NVIDIA 0.9-6 driver. Everything worked
great with the 2.4.1 kernel, XFree86-4.0.1, and the NVIDIA 0.9-5 driver
(patched to compile with 2.4.X kernels). With the current setup, the
NVIDIA driver fails to set up a desired write-combining memory range and
disables AGP support. If I try to force the issue by configuring
the NVIDIA driver to use the kernel's AGPGART support, the console
switches to graphics mode and then becomes completely unresponsive
to input other than tracking mouse cursor movement. The only safe
way I've found to restore console functionality is to login remotely
and reboot the machine: killing the X server and associated apps won't
do the trick.

If anyone is interested in working this issue, I can/will forward a
copy of a representative /var/log/XFree86.0.log file showing what
happens for the case of using the NVIDIA driver's internal AGP support.
Within the log file are the following two lines that pretty much sum
it up:

(WW) NVIDIA(0): Failed to set up write-combining range (0xd8000000,0x2000000)
(II) NVIDIA(0): AGP is disabled

Jeff Hartmann (AGPGART support) thinks this is probably a MTRR issue.
I'm leaning that way, given a recent posting by someone else having
MTRR problems with his Cyrix 6x86.

Anyone that can help troubleshoot this and/or provide a fix would be
greatly appreciated. Thanks in advance!

Sincerely,
--Bob Tracy
[email protected]


2001-03-14 00:31:53

by Dave Jones

[permalink] [raw]
Subject: Re: another Cyrix/mtrr problem?

On Tue, 13 Mar 2001, Bob_Tracy wrote:

> System is a Tyan S1590S motherboard (Apollo MVP3 chipset) with
> Cyrix MII 300 processor, NVIDIA GeForce2 MX AGP video card, 2.4.2
> kernel, XFree86-4.0.2, and the NVIDIA 0.9-6 driver.

Normally the answer would be "Closed driver, complain to nVidia",
but just in case..
First I suggest you try the new drivers that came out for it today
first though, to see if that fixes your problem.

> Jeff Hartmann (AGPGART support) thinks this is probably a MTRR issue.
> I'm leaning that way, given a recent posting by someone else having
> MTRR problems with his Cyrix 6x86.

The recent problems were only in Alans 2.4.2-ac tree, not in the
main Linus branch. They should also have only happened on Athlons
that was introduced by the addition Cyrix III support.
2.4.2-ac20 fixes this.

As no-one else afaik has complained about Cyrix MII MTRR support,
I think this is an isolated incident, which is why I'm pointing a
finger at the binary drivers, but...

There is the possibility that you're the first MII owner to notice
that this is broken. Can you verify that..

a. You have MTRR support compiled into the kernel.
b. You have a /proc/mtrr file
c. You can add/delete ranges using /proc/mtrr
(See Documentation/mtrr.txt for info on how to do this)

If yes,yes,yes, it is a broken driver, and you should complain
to nVidia, not linux-kernel.

regards,

Dave.

--
| Dave Jones. http://www.suse.de/~davej
| SuSE Labs

2001-03-14 02:49:17

by rct

[permalink] [raw]
Subject: Re: another Cyrix/mtrr problem?

[email protected] wrote:
> Normally the answer would be "Closed driver, complain to nVidia",
> but just in case..

Glad you were open-minded enough to consider that it *might* be
"our" code.

> Can you verify that..
>
> a. You have MTRR support compiled into the kernel.

yes

> b. You have a /proc/mtrr file

yes

> c. You can add/delete ranges using /proc/mtrr
> (See Documentation/mtrr.txt for info on how to do this)

yes, BUT...

The "Documentation/mtrr.txt" file says "... 4 megabytes, which is
0x400000 bytes (in hexadecimal)." The math is correct: 1MB == 2**20
== 0x100000 the last time I checked. Unfortunately, when I execute

echo "base=0xd8000000 size=0x100000 type=write-combining" >| /proc/mtrr

I get a 2MB region instead of the 1MB region I expected...

reg00: base=0xd8000000 (3456MB), size= 2MB: write-combining, count=1
reg01: base=0x000c0000 ( 0MB), size= 512KB: uncachable, count=1
reg07: base=0x00000000 ( 0MB), size= 256MB: write-through, count=1

Similarly, the NVIDIA driver attempts to create a 32MB write-combining
region by passing a size argument of 0x2000000, and fails because the
underlying mtrr code tries to carve out a 64MB region whereas my video
card has only 32MB of RAM.

Looks like an off-by-one (bit) error to me. So... Is this a legitimate
bug sighting, or is my analysis faulty?

--Bob Tracy
[email protected]

2001-03-14 22:58:35

by David Wragg

[permalink] [raw]
Subject: Re: another Cyrix/mtrr problem?

[email protected] (Bob_Tracy) writes:
> Unfortunately, when I execute
>
> echo "base=0xd8000000 size=0x100000 type=write-combining" >| /proc/mtrr
>
> I get a 2MB region instead of the 1MB region I expected...

Oops, it got broken by the MTRR >32-bit support in 2.4.0-testX. The
patch below should fix it.

Joerg, I think this might well fix your Cyrix mtrr problem also.

Let me know how it goes,
Dave Wragg


diff -uar linux-2.4.2/arch/i386/kernel/mtrr.c linux-2.4.2.cyrix/arch/i386/kernel/mtrr.c
--- linux-2.4.2/arch/i386/kernel/mtrr.c Thu Feb 22 15:24:53 2001
+++ linux-2.4.2.cyrix/arch/i386/kernel/mtrr.c Wed Mar 14 22:28:02 2001
@@ -538,7 +538,7 @@
* Note: shift==0xf means 4G, this is unsupported.
*/
if (shift)
- *size = (reg < 7 ? 0x1UL : 0x40UL) << shift;
+ *size = (reg < 7 ? 0x1UL : 0x40UL) << (shift - 1);
else
*size = 0;

2001-03-15 13:37:05

by rct

[permalink] [raw]
Subject: Re: another Cyrix/mtrr problem?

David Wragg wrote:
> [email protected] (Bob_Tracy) writes:
> > echo "base=0xd8000000 size=0x100000 type=write-combining" >| /proc/mtrr
> >
> > I get a 2MB region instead of the 1MB region I expected...
>
> Oops, it got broken by the MTRR >32-bit support in 2.4.0-testX. The
> patch below should fix it.
>
> Joerg, I think this might well fix your Cyrix mtrr problem also.
>
> Let me know how it goes,

That fixed the "wrong size" problem nicely. Thanks!

AGP support on this beast (Tyan S1590S / Apollo MVP3) is still broken,
however. I'll try the new NVIDIA driver (as someone suggested -- thanks
for the steer!) and see if that helps. If there's an NVIDIA person
reading this that would like to work this issue off-line, your help
would be appreciated. Thanks!

-- Bob Tracy
[email protected]

2001-03-16 07:16:25

by Joerg Diederich

[permalink] [raw]
Subject: Re: another Cyrix/mtrr problem?

Hi David,

David Wragg writes:

+> [email protected] (Bob_Tracy) writes:
+>> Unfortunately, when I execute
+>>
+>> echo "base=0xd8000000 size=0x100000 type=write-combining" >|
+>> /proc/mtrr
+>>
+>> I get a 2MB region instead of the 1MB region I expected...

+> Oops, it got broken by the MTRR >32-bit support in 2.4.0-testX.
+> The patch below should fix it.

+> Joerg, I think this might well fix your Cyrix mtrr problem also.

Indeed, it does. XFree 4 does create a region with the right size and
even setting the mtrr manually works perfectly. Although only tested
one evening, there were no 'no mtrr found for...' messages in the
syslog anymore.


Thankx a lot,

/J"org