From patchwork Tue Apr 4 15:27:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 96737 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp248209qgd; Tue, 4 Apr 2017 08:28:19 -0700 (PDT) X-Received: by 10.84.211.97 with SMTP id b88mr30173835pli.113.1491319699888; Tue, 04 Apr 2017 08:28:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h7si17824184pgn.97.2017.04.04.08.28.19; Tue, 04 Apr 2017 08:28:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754425AbdDDP2I (ORCPT + 25 others); Tue, 4 Apr 2017 11:28:08 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38325 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753804AbdDDP17 (ORCPT ); Tue, 4 Apr 2017 11:27:59 -0400 Received: by mail-wm0-f46.google.com with SMTP id t189so31285206wmt.1 for ; Tue, 04 Apr 2017 08:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e6M+xugzcovcCd7APfm4cWPF+lU826rBLm5qBqVxvYs=; b=dXk2+36SeZ3DiMzDJmZpc4HMid/c0mWu0RkcGPtx6Mm7PVoOCs8u+5qc9H50Vu6UJ5 xjSeZejzR1YTDfJhooyLqFgB85Lq2ZiJwoJIypsmuEsSvcZxbzFkadAf9CwKdm6NHPPK 0JCRuMgdbo5kVVZAQV2K6heFahP0AUey6id/0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e6M+xugzcovcCd7APfm4cWPF+lU826rBLm5qBqVxvYs=; b=OBdOqfDILp7wZv10F/nZ856lVei5n6n008mbERcRqrGuhXNMNhPmMYFVNoupc34rAS PdBMsMNvLTrQorLi2l0HWMFO7EQ74jrGL013H2NZpazxYcScL5Md7YqNXyKnuyZXGNQ4 S9CkYfFBrGuJk1oLux2pqLf0XBDh/hzMkhleghpfxNsArVaHqW+aoQIJDhWY6+cbNYj8 n8dPM5AP1WGJQXpZJK5ANzWrHkEaLUrYvh6/JNb2ES71ufLSELqTqEHuI99GLKRQgnnv JUMwpZPg/slXKAChUsCHFvWQW9iz9bgqckkKbIOJ6lcmExHNc4kZ9GLJ+Y0jAddfBHAS vxnA== X-Gm-Message-State: AFeK/H0B9tZFkxwydl1ZezTcuynh5gw2U7JBPpTMctkYIEKBMvvPQsoR la+eLWp4eV1o54Ge X-Received: by 10.28.12.147 with SMTP id 141mr15437543wmm.8.1491319677648; Tue, 04 Apr 2017 08:27:57 -0700 (PDT) Received: from localhost.localdomain ([160.163.145.113]) by smtp.gmail.com with ESMTPSA id n53sm4421205wrn.28.2017.04.04.08.27.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 08:27:56 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: leif.lindholm@linaro.org, lorenzo.pieralisi@arm.com, Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] efifb: Avoid reconfiguration of BAR that covers the framebuffer Date: Tue, 4 Apr 2017 16:27:44 +0100 Message-Id: <20170404152744.26687-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170404152744.26687-1-ard.biesheuvel@linaro.org> References: <20170404152744.26687-1-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On UEFI systems, the PCI subsystem is enumerated by the firmware, and if a graphical framebuffer is exposed by a PCI device, its base address and size are exposed to the OS via the Graphics Output Protocol (GOP). On arm64 PCI systems, the entire PCI hierarchy is reconfigured from scratch at boot. This may result in the GOP framebuffer address to become stale, if the BAR covering the framebuffer is modified. This will cause the framebuffer to become unresponsive, and may in some cases result in unpredictable behavior if the range is reassigned to another device. So add a non-x86 quirk to the EFI fb driver to find the BAR associated with the GOP base address, and claim the BAR resource so that the PCI core will not move it. Fixes: 9822504c1fa5 ("efifb: Enable the efi-framebuffer platform driver ...") Cc: # v4.7+ Cc: Matt Fleming Cc: Peter Jones Signed-off-by: Ard Biesheuvel --- drivers/video/fbdev/efifb.c | 66 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) -- 2.9.3 diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 8c4dc1e1f94f..758960b6aec9 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include