From mboxrd@z Thu Jan 1 00:00:00 1970 From: heyi.guo@linaro.org (Heyi Guo) Date: Sat, 20 May 2017 16:19:31 +0800 Subject: [PATCH v3] efifb: avoid reconfiguration of BAR that covers the framebuffer In-Reply-To: <20170518140154.GA24324@bhelgaas-glaptop.roam.corp.google.com> References: <1490196629-28088-1-git-send-email-ard.biesheuvel@linaro.org> <20170518140154.GA24324@bhelgaas-glaptop.roam.corp.google.com> Message-ID: <76d19384-d915-ef97-9daf-3d3eded2ce47@linaro.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Bjorn, Many thanks for your clear answer. Regards, Gary (Heyi Guo) ? 5/18/2017 10:01 PM, Bjorn Helgaas ??: > Hi Gary, > > Thanks for the question. > > On Wed, May 03, 2017 at 11:09:51AM +0800, Heyi Guo wrote: >> Hi Ard, >> >> I have one comment inclined. >> >> >> ? 3/22/2017 11:30 PM, Ard Biesheuvel ??: >>> 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