From patchwork Wed Mar 22 15:30:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 95783 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp299825qgd; Wed, 22 Mar 2017 08:39:19 -0700 (PDT) X-Received: by 10.84.224.69 with SMTP id a5mr37049936plt.28.1490197159105; Wed, 22 Mar 2017 08:39:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p37si2232516plb.96.2017.03.22.08.39.19; Wed, 22 Mar 2017 08:39:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935423AbdCVPjP (ORCPT + 2 others); Wed, 22 Mar 2017 11:39:15 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35506 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934969AbdCVPjF (ORCPT ); Wed, 22 Mar 2017 11:39:05 -0400 Received: by mail-wm0-f51.google.com with SMTP id u132so40393911wmg.0 for ; Wed, 22 Mar 2017 08:39:04 -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; bh=9t7hhMaq9w85IC+QZ14yld40xDpNuiIcg9zwwqLT99Q=; b=I6qoNLQWUQSQKRYuTWLh2oO2NEo8pI0HFz9/ZzgVW7jnhuUowZWixkew5FYuKYGEf6 D4TUn/RRrN8gjn7q/2RQsHQAb6QUH8WZrHREKLJqKqspGu74v1fCVvfGe/ZxATweIqr6 sHeG+mVKAAv8uwQgCEfYB4hOV6sxjq1UUL+Iw= 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; bh=9t7hhMaq9w85IC+QZ14yld40xDpNuiIcg9zwwqLT99Q=; b=qj//BvwjkU6SLY5G6mBHd59GObNsjGMz2pykE/mAHuQrpEJpMWbnNnJ+YwF5F2PH2U JL9z84IMyf+lVz7llQfFlTQbO4S0CVOHCG2WuJh1MvFFKbsxNvOJxgIs9tel6UGVEO15 2ev5nbnUliGWxl7/NdpNPWNmIVhqkGEgLLqdqR38SyHkWMZLExW+UeyjAtyv4/xWvpFf WDG+vMjlpwVNW7WAzAvqzhfWjGaov7IJr66+4R+Vpx5wBjRB8TaVVwvtpKw30bnsjOxb /YlR/9lbRbjVsdU5+ZT1JAStbct4y59KPNy1vx89uLnAoIqsYqLFqDKXUG5lBYUcmAW4 o/GA== X-Gm-Message-State: AFeK/H1RmotNBkZDb+PqUNEomzZlNwglPzqOgeVgzjpHKUrmPPrJzU0oLTDSQdpqkR2h+V9P X-Received: by 10.28.232.138 with SMTP id f10mr8771711wmi.59.1490196636481; Wed, 22 Mar 2017 08:30:36 -0700 (PDT) Received: from localhost.localdomain ([160.172.77.216]) by smtp.gmail.com with ESMTPSA id t21sm762349wmd.19.2017.03.22.08.30.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Mar 2017 08:30:35 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk, pjones@redhat.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com, hanjun.guo@linaro.org, heyi.guo@linaro.org, linux-pci@vger.kernel.org, yinghai@kernel.org, Ard Biesheuvel Subject: [PATCH v3] efifb: avoid reconfiguration of BAR that covers the framebuffer Date: Wed, 22 Mar 2017 15:30:29 +0000 Message-Id: <1490196629-28088-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@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 quirk to the EFI fb driver to find the BAR associated with the GOP base address, and set the IORESOURCE_PCI_FIXED attribute so that the PCI core will leave it alone. Cc: Matt Fleming Cc: Peter Jones Signed-off-by: Ard Biesheuvel --- v3: check device is enabled before attempting to claim the resource drivers/video/fbdev/efifb.c | 60 +++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index 8c4dc1e1f94f..88f653864a01 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include