From patchwork Mon Mar 20 22:13:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 95590 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1157671qgd; Mon, 20 Mar 2017 15:14:21 -0700 (PDT) X-Received: by 10.84.231.207 with SMTP id g15mr43369700pln.2.1490048061787; Mon, 20 Mar 2017 15:14:21 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si18901335pgh.227.2017.03.20.15.14.21; Mon, 20 Mar 2017 15:14:21 -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 S1755753AbdCTWOK (ORCPT + 2 others); Mon, 20 Mar 2017 18:14:10 -0400 Received: from mail-wr0-f171.google.com ([209.85.128.171]:33979 "EHLO mail-wr0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754895AbdCTWOI (ORCPT ); Mon, 20 Mar 2017 18:14:08 -0400 Received: by mail-wr0-f171.google.com with SMTP id l37so101435277wrc.1 for ; Mon, 20 Mar 2017 15:14:07 -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=Tj2fsxWSsDevmzeQbQUVNyOPzfbMz27OLxncOk4KUow=; b=BrkraWDARm5NL5CsKzLuql6/mRINMu4kTQetUmwevdimwBevGCwFiEyjfW8kpiNbEj pyLwvV2he446BuaKVR55CgOr/3WTBAjGqxVosDktZTSJxaqSpr10ZjQfaAjlZo1A+BpZ 9U/yLzc9Au7+WKAHUfgCljDWo8lrYPvSvpLxU= 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=Tj2fsxWSsDevmzeQbQUVNyOPzfbMz27OLxncOk4KUow=; b=IUXq9Io7OW+Fw9jZM6GG135DMKqvLEogQMYwY2vxpaL0NovGNVWjX75jL15mEs6Dcv MtZtC4sg+M1nQhZuJwhSicVLxhOuv0O+3OLuVBtnsDQ0wEa+muF8xWw6cKD2GyxE85q1 vUcWyE9UtFVX6kcfHcrezaRGEw1o9BoPmWravByLVqIUdOqPkJkMOSpdPDMyZX36ZlB6 yXCLomDTPDB1pzS5puRflKpiRbmNdNyd+gKkWJke5QOTAjYu5WjfcxOfrLPh3sErO/P3 o1mSxIAOt9faTDDvGfN1Q+Huys4dMN5wKrd9z2TJuDF6aQaHGqKC1JyMzA61frKlUns/ IDow== X-Gm-Message-State: AFeK/H0ukGVm1UMgl4VE3OM4Vi1cqC3IWhyBH41C1JlsxEvoMOhDOdOlXJ6sqg4sIwOZH3vK X-Received: by 10.223.162.198 with SMTP id t6mr11941231wra.155.1490048046711; Mon, 20 Mar 2017 15:14:06 -0700 (PDT) Received: from localhost.localdomain (189.17.90.92.rev.sfr.net. [92.90.17.189]) by smtp.gmail.com with ESMTPSA id w85sm1930896wmw.1.2017.03.20.15.14.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Mar 2017 15:14:05 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: leif.lindholm@linaro.org, lorenzo.pieralisi@arm.com, heyi.guo@linaro.org, pjones@redhat.com, matt@codeblueprint.co.uk, hanjun.guo@linaro.org, Ard Biesheuvel Subject: [PATCH] efifb: avoid reconfiguration of BAR that covers the framebuffer Date: Mon, 20 Mar 2017 22:13:57 +0000 Message-Id: <1490048037-1850-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. Signed-off-by: Ard Biesheuvel --- drivers/video/fbdev/efifb.c | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 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..97a3b15b6f04 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include