From patchwork Fri Mar 20 23:18:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 6062351 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C837B9F399 for ; Sat, 21 Mar 2015 00:18:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E0FBB2049D for ; Sat, 21 Mar 2015 00:18:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1E3C20444 for ; Sat, 21 Mar 2015 00:18:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751475AbbCUASM (ORCPT ); Fri, 20 Mar 2015 20:18:12 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:35156 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202AbbCUASL (ORCPT ); Fri, 20 Mar 2015 20:18:11 -0400 Received: by pagj4 with SMTP id j4so32786606pag.2; Fri, 20 Mar 2015 17:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=YqNcT7umf82QIE5B/5jcp7i6nzhZZuNkXRLWRxsL+Ns=; b=KNgmpKnwKbF1B7ikuMEPLkZNNjp3kWp0l2QTcyFpIxhETEwcxfTS6ET/kpqPibAH0G c4bpWey2qx49q/50heMgyYdXS7PbmcPkCI8oPm8UE1IS5isQxpjNxbDm4dwYyF8Szlxv ScF7vZVoZqNJPXHgTBswAzntjnNYoZk/DYO/eISVWbrmPcdhTewh9tC0ftX5t4LrtKDq FXqe8676kPpuE7qr46WwOe7MZBNt+FCOgp5eSP4x2T2WhE5+3i6JC+VRQhlssnPBkK0W a/dnLGeSbPC0BIHhNkaRiD+zdUsEMOVKBDgXHjii+jdr1s2NoLptSs2DZpys0PdHPExR +UIA== X-Received: by 10.68.98.226 with SMTP id el2mr880556pbb.165.1426897091129; Fri, 20 Mar 2015 17:18:11 -0700 (PDT) Received: from mcgrof@gmail.com (c-98-234-145-61.hsd1.ca.comcast.net. [98.234.145.61]) by mx.google.com with ESMTPSA id y14sm9901842pdl.3.2015.03.20.17.18.07 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 20 Mar 2015 17:18:09 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Fri, 20 Mar 2015 17:15:59 -0700 From: "Luis R. Rodriguez" To: luto@amacapital.net, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, jgross@suse.com, JBeulich@suse.com, bp@suse.de, suresh.b.siddha@intel.com, venkatesh.pallipadi@intel.com, airlied@redhat.com Cc: linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, x86@kernel.org, xen-devel@lists.xenproject.org, "Luis R. Rodriguez" , Ingo Molnar , Daniel Vetter , Antonino Daplas , Jean-Christophe Plagniol-Villard , Tomi Valkeinen Subject: [PATCH v1 26/47] video: fbdev: gbefb: add missing mtrr_del() calls Date: Fri, 20 Mar 2015 16:18:16 -0700 Message-Id: <1426893517-2511-27-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426893517-2511-1-git-send-email-mcgrof@do-not-panic.com> References: <1426893517-2511-1-git-send-email-mcgrof@do-not-panic.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Luis R. Rodriguez" This driver never removed the MTRRs. Fix that. Cc: Suresh Siddha Cc: Venkatesh Pallipadi Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Juergen Gross Cc: Daniel Vetter Cc: Andy Lutomirski Cc: Dave Airlie Cc: Antonino Daplas Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez --- drivers/video/fbdev/gbefb.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c index 6d9ef39..f48ea7e 100644 --- a/drivers/video/fbdev/gbefb.c +++ b/drivers/video/fbdev/gbefb.c @@ -38,6 +38,7 @@ static struct sgi_gbe *gbe; struct gbefb_par { struct fb_var_screeninfo var; struct gbe_timing_info timing; + int wc_cookie; int valid; }; @@ -1199,7 +1200,8 @@ static int gbefb_probe(struct platform_device *p_dev) } #ifdef CONFIG_X86 - mtrr_add(gbe_mem_phys, gbe_mem_size, MTRR_TYPE_WRCOMB, 1); + info->wc_cookie = mtrr_add(gbe_mem_phys, gbe_mem_size, + MTRR_TYPE_WRCOMB, 1); #endif /* map framebuffer memory into tiles table */ @@ -1240,6 +1242,10 @@ static int gbefb_probe(struct platform_device *p_dev) return 0; out_gbe_unmap: +#ifdef CONFIG_MTRR + if (info->wc_cookie >= 0) + mtrr_del(info->wc_cookie, 0, 0); +#endif if (gbe_dma_addr) dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys); out_tiles_free: @@ -1259,6 +1265,10 @@ static int gbefb_remove(struct platform_device* p_dev) unregister_framebuffer(info); gbe_turn_off(); +#ifdef CONFIG_MTRR + if (info->wc_cookie >= 0) + mtrr_del(info->wc_cookie, 0, 0); +#endif if (gbe_dma_addr) dma_free_coherent(NULL, gbe_mem_size, gbe_mem, gbe_mem_phys); dma_free_coherent(NULL, GBE_TLB_SIZE * sizeof(uint16_t),