mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Wragg <dpw@doc.ic.ac.uk>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	bmayland@leoninedev.com (Bryan Mayland)
Cc: kraxel@goldbach.in-berlin.de, linux-kernel@vger.kernel.org,
	torvalds@transmeta.com
Subject: Re: [PATCH] VESA framebuffer w/MTRR locks 2.4.0 on init
Date: 06 Jan 2001 01:20:15 +0000	[thread overview]
Message-ID: <y7rk889wk6o.fsf@sytry.doc.ic.ac.uk> (raw)
In-Reply-To: <E14EZMf-0007vp-00@the-village.bc.nu>

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > loop with no exit, as each size mtrr fails.
> >                  while (mtrr_add(video_base, temp_size, MTRR_TYPE_WRCOMB,
> > 1)==-EINVAL) {
> >                          temp_size >>= 1;
> >                  }
> 
> Ok that one is the bug.

Even with the obvious bug fixed, that code is strange.  "temp_size >>=
1" does little to improve the chances of the mtrr_add succeeding.
Something like this would be better:

if (mtrr_add(video_base, temp_size, MTRR_TYPE_WRCOMB, 1) == -EINVAL) {
        /* Find the largest power-of-two */
        while (temp_size & (temp_size - 1))
                temp_sze &= (temp_size - 1);

        mtrr_add(video_base, temp_size, MTRR_TYPE_WRCOMB, 1);
}


(But this is just a very crude way to work around the inflexibility of
the MTRRs.  Rather than cluttering up calls to mtrr_add, it would be
better to fix this properly, either by implementing PAT support
(Zoltán Böszörményi said he was working on that), or by having a
user-space helper program to make more intelligent MTRR allocations,
or both.)


David Wragg
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-06  1:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-05 15:54 [PATCH] VESA framebuffer w/ MTRR " Bryan Mayland
2001-01-05 16:05 ` Alan Cox
2001-01-05 16:31   ` Chris Kloiber
2001-01-05 21:16     ` Steven Walter
2001-01-06  1:12     ` David Wragg
2001-01-06  9:47     ` Gerd Knorr
2001-01-05 16:48   ` Bryan Mayland
2001-01-05 16:54     ` Alan Cox
2001-01-05 17:33       ` Gerd Knorr
2001-01-05 21:40         ` Bryan Mayland
2001-01-05 21:48           ` Alan Cox
2001-01-05 22:01             ` Bryan Mayland
2001-01-06  1:20   ` David Wragg [this message]
2001-01-06 17:08     ` [PATCH] VESA framebuffer w/MTRR " Bryan Mayland
2001-01-06 19:23       ` Alan Cox
2001-01-06 17:28     ` Framebuffer as a module Bryan Mayland
     [not found]       ` <002501c07819$21343900$fd1942c3@bluescreen>
2001-01-06 20:04         ` Bryan Mayland

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=y7rk889wk6o.fsf@sytry.doc.ic.ac.uk \
    --to=dpw@doc.ic.ac.uk \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=bmayland@leoninedev.com \
    --cc=kraxel@goldbach.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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®