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: 742148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vpDNc2khWz9s0Z for ; Thu, 23 Mar 2017 02:38:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="I6qoNLQW"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934947AbdCVPiX (ORCPT ); Wed, 22 Mar 2017 11:38:23 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:35991 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934411AbdCVPiW (ORCPT ); Wed, 22 Mar 2017 11:38:22 -0400 Received: by mail-wm0-f43.google.com with SMTP id n11so40179862wma.1 for ; Wed, 22 Mar 2017 08:38:21 -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=K71CoByHgfw3No+4R6e87rOFfEdmL4ss/F0ssO22pTok0k8S9vsMiT7yohbjp8yY2+ +KqEhvNdzEul/fX7OzwTBbADz9DHZFMeNCmGbaazUNvHxlxKU0yCMy/xio04WCbAyjxF VbMCFndBvekhwuX6l6pachP1FUdcII8JH1o0r3LUE5QD70mC1ehlh5A63Hp+OX/ZxHBo ZULn7jGdzBPwhpj4ZLjha21IsKzHWfpJiAyhUju8zgnp6aECtRsEJJodGoWC5s1ZWBZQ LBBHnqfkIFn0tSUYi/+FcHhIpgWYgZlZ9ojSJIgIl+ToR8pOhKP7YPhPDcoZ5WIorPbZ DS5A== X-Gm-Message-State: AFeK/H0BKbn9d75jQoUex+TY+MJheT6knf4sqeoOmLbAegqecDJSXcPBUS9w1g+TjOMB0up9 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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(-) 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