From patchwork Tue Apr 21 20:16:23 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: 6252931 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5AE5FBF4A6 for ; Tue, 21 Apr 2015 20:17:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EB9620340 for ; Tue, 21 Apr 2015 20:17:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CACD20303 for ; Tue, 21 Apr 2015 20:17:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755968AbbDUURC (ORCPT ); Tue, 21 Apr 2015 16:17:02 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:35240 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753526AbbDUUQ5 (ORCPT ); Tue, 21 Apr 2015 16:16:57 -0400 Received: by pabtp1 with SMTP id tp1so251062356pab.2; Tue, 21 Apr 2015 13:16:56 -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=uSxF5hLfbc+yZHFVFf8gw2wO6GmrFusjyNOaM7Tln28=; b=0lyrOg7lDvNy57vVReSMK/kbV8rOACMvxu9yEiPki84GzP68hMx7x5ixEtr6V6EI1U jRIn+i3WeIrSRTykDX9hnwKtEaAWPZIuONYVb2Cyp+eRCneRsMDt7huYd5IjAkXmiWsh 3cbPSBG3jUwZp5sm1gwi8MImQOE1e6IYS/nbPyeJ76gZ+djYFk59Xh9va4miyYljrjfo ahT06/6KlT2osGso46CdQky7PKY75AsiM9ixFRCVESMjF3ZozSmB5keZSestlMEcfrY/ kOYQtrSSgVDF5gpk5t1ov/PdIuKDMKn2fhVqvQY9BdV1N476/Jal7NZQKS/l73P4Kpyb 1EFQ== X-Received: by 10.70.34.193 with SMTP id b1mr40889786pdj.154.1429647416916; Tue, 21 Apr 2015 13:16:56 -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 bn4sm2929957pad.2.2015.04.21.13.16.54 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 21 Apr 2015 13:16:56 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Tue, 21 Apr 2015 13:16:53 -0700 From: "Luis R. Rodriguez" To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: linux-fbdev@vger.kernel.org, luto@amacapital.net, cocci@systeme.lip6.fr, "Luis R. Rodriguez" , Thomas Gleixner , Juergen Gross , Jingoo Han , Daniel Vetter , Masanari Iida , Suresh Siddha , Ingo Molnar , Dave Airlie , Antonino Daplas , linux-kernel@vger.kernel.org Subject: [PATCH v3 02/17] video: fbdev: gbefb: add missing mtrr_del() calls Date: Tue, 21 Apr 2015 13:16:23 -0700 Message-Id: <1429647398-16983-3-git-send-email-mcgrof@do-not-panic.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429647398-16983-1-git-send-email-mcgrof@do-not-panic.com> References: <1429647398-16983-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: Thomas Gleixner Cc: Juergen Gross Cc: Jingoo Han Cc: Daniel Vetter Cc: Masanari Iida Cc: Suresh Siddha Cc: Ingo Molnar 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),