From patchwork Fri May 3 23:00:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 2519911 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8881B4020B for ; Fri, 3 May 2013 23:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934439Ab3ECXBS (ORCPT ); Fri, 3 May 2013 19:01:18 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:59316 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934420Ab3ECXBN (ORCPT ); Fri, 3 May 2013 19:01:13 -0400 Received: by mail-pb0-f42.google.com with SMTP id up7so1121628pbc.29 for ; Fri, 03 May 2013 16:01:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:x-gm-message-state; bh=avJ0g27hOLkr8R5NAZqkdQJNZcSmctA7ydeoke784kA=; b=WktR0jY0BnckN6csCZDstKIUPj/4ff1nmmZ/tIkrL2UVWJtxAQFkifIM33W6e2bXjU iXpiQ3hRjSkoe65FBWybvZVlI6qyUkYjeriXYi8yFdFwKDf43aNUbTaK21Q9MPTn1WGF /stm/0W0PQfdQO4xhToLNc+hV7i305d5FF9vXBmNLThUN4mB1vHpewDdWLhrBTTTevIx WZQgoOM/FXmr3AxZq0LHg3dqo/NAggsP9p0PqXMmYHhHOp2fspGkbW7/4N70uNe2+d6b xIIYys5kvfeEAx4FA7szKxe6vxEMJrLNq3Iqy0yEV22+t7hyjzgW0YfCFfteVk7U1PZT cprQ== X-Received: by 10.66.163.229 with SMTP id yl5mr16693191pab.104.1367622072946; Fri, 03 May 2013 16:01:12 -0700 (PDT) Received: from localhost (50-76-60-73-ip-static.hfc.comcastbusiness.net. [50.76.60.73]) by mx.google.com with ESMTPSA id to7sm14561877pab.0.2013.05.03.16.01.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 03 May 2013 16:01:12 -0700 (PDT) From: Andy Lutomirski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Cc: Andy Lutomirski , Michal Januszewski Subject: [PATCH 7/7] uvesafb: Clean up MTRR code Date: Fri, 3 May 2013 16:00:35 -0700 Message-Id: <1692ae3da2fd85aaa267d7d38954bc701f9f7bfd.1367621039.git.luto@amacapital.net> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQk3dQ4UQeY2HI5cOMTovKqjgj2akPyZfVpZDLK2X+zWJ23jpbJiGZtW8Jd4Aj/eUwvVhIXq Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org The old code allowed very strange memory types. Now it works like all the other video drivers: ioremap_wc is used unconditionally, and MTRRs are set if PAT is unavailable (unless MTRR is disabled by a module parameter). UC, WB, and WT support is gone. If there are MTRR conflicts that prevent addition of a WC MTRR, adding a non-conflicting MTRR is pointless; it's better to just turn off MTRR support entirely. As an added bonus, any MTRR added is freed on unload. Signed-off-by: Andy Lutomirski --- I can't test this -- the link to v86d in Documentation/fb/uvesafb.txt seems to be broken, and Fedora doesn't seem to package it. Documentation/fb/uvesafb.txt | 16 ++++------ drivers/video/uvesafb.c | 70 ++++++++++++-------------------------------- include/video/uvesafb.h | 1 + 3 files changed, 24 insertions(+), 63 deletions(-) diff --git a/Documentation/fb/uvesafb.txt b/Documentation/fb/uvesafb.txt index eefdd91..f6362d8 100644 --- a/Documentation/fb/uvesafb.txt +++ b/Documentation/fb/uvesafb.txt @@ -81,17 +81,11 @@ pmipal Use the protected mode interface for palette changes. mtrr:n Setup memory type range registers for the framebuffer where n: - 0 - disabled (equivalent to nomtrr) (default) - 1 - uncachable - 2 - write-back - 3 - write-combining - 4 - write-through - - If you see the following in dmesg, choose the type that matches - the old one. In this example, use "mtrr:2". -... -mtrr: type mismatch for e0000000,8000000 old: write-back new: write-combining -... + 0 - disabled (equivalent to nomtrr) + 3 - write-combining (default) + + Values other than 0 and 3 will result in a warning and will be + treated just like 3. nomtrr Do not use memory type range registers. diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index d428445..4f447ad 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -24,9 +24,7 @@ #ifdef CONFIG_X86 #include