From patchwork Mon May 13 23:58:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 2561191 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 735F1DFE75 for ; Mon, 13 May 2013 23:59:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755716Ab3EMX7W (ORCPT ); Mon, 13 May 2013 19:59:22 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:64199 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755709Ab3EMX7S (ORCPT ); Mon, 13 May 2013 19:59:18 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb10so5062589pad.37 for ; Mon, 13 May 2013 16:59:18 -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=9mTE+TiSuzlUltwTJ1m/0tl5WyHT5uuAhb/Nlh+tRHs=; b=jHtbhk0YMBIAS58szRPWkpV446UN+jgCUG8Q7372ynVyKFB2vT5IlRg8BPQ58Zsi6X p2HP9WswUv4q8d96BoKIKIZ6+bgXTBUfCYXK2Nk0Jyk3MTNLy+hK/024a/x0eOEiLO5K etrLeEVwd5kGCJrRgvmHx4rB5TL/JxyfYHwT65D+YfANZn+B35Ov0TdkjI2byMQIT9Zo tWSe0Pc6ejzSLB6U6NiXyCzNoFge8ZuzjdIg5X9j6yiyxuuB+a0IUAdhiN95CmBPZM5K f0rg/UvlNC2X8Fz6+wjXLQICZuWrPKuNDWR989B70S78Q78kPp3ZEWOXrRucsWwI6RET hEow== X-Received: by 10.66.253.34 with SMTP id zx2mr32700770pac.35.1368489558013; Mon, 13 May 2013 16:59:18 -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 al2sm15689401pbc.25.2013.05.13.16.59.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 16:59:16 -0700 (PDT) From: Andy Lutomirski To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Cc: Daniel Vetter , Jerome Glisse , Alex Deucher , Dave Airlie , Andy Lutomirski Subject: [PATCH v3 7/9] uvesafb: Clean up MTRR code Date: Mon, 13 May 2013 16:58:46 -0700 Message-Id: X-Mailer: git-send-email 1.8.1.4 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQl4EBJngrl0OIHpow60cyJoESzTkiiegyB4qctqMGKUaqydt7CMKI68JDak8ZpCkZcdv4dw 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. Reviewed-by: Daniel Vetter Signed-off-by: Andy Lutomirski --- Documentation/fb/uvesafb.txt | 16 ++++------ drivers/video/uvesafb.c | 70 +++++++++++--------------------------------- include/video/uvesafb.h | 1 + 3 files changed, 23 insertions(+), 64 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..8701f96 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c @@ -24,9 +24,6 @@ #ifdef CONFIG_X86 #include