Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 717285 Details for
Bug 927451
regression: Invalid ROM contents, signature not found, unable to locate usable image
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed patch from Matthew Garrett
mjg-rom (text/plain), 13.93 KB, created by
Bjorn Helgaas
on 2013-03-27 20:51:14 UTC
(
hide
)
Description:
proposed patch from Matthew Garrett
Filename:
MIME Type:
Creator:
Bjorn Helgaas
Created:
2013-03-27 20:51:14 UTC
Size:
13.93 KB
patch
obsolete
>From matthew.garrett@nebula.com Tue Mar 26 15:26:27 2013 >Delivered-To: bhelgaas@google.com >Received: by 10.182.76.5 with SMTP id g5csp108168obw; > Tue, 26 Mar 2013 14:26:29 -0700 (PDT) >X-Received: by 10.194.122.131 with SMTP id ls3mr27451296wjb.55.1364333187650; > Tue, 26 Mar 2013 14:26:27 -0700 (PDT) >Return-Path: <matthew.garrett@nebula.com> >Received: from cavan.codon.org.uk (cavan.codon.org.uk. [2a00:1098:0:80:1000:c:0:1]) > by mx.google.com with ESMTPS id x17si1488612wiv.114.2013.03.26.14.26.27 > (version=TLSv1 cipher=RC4-SHA bits=128/128); > Tue, 26 Mar 2013 14:26:27 -0700 (PDT) >Received-SPF: softfail (google.com: domain of transitioning matthew.garrett@nebula.com does not designate 2a00:1098:0:80:1000:c:0:1 as permitted sender) client-ip=2a00:1098:0:80:1000:c:0:1; >Authentication-Results: mx.google.com; > spf=softfail (google.com: domain of transitioning matthew.garrett@nebula.com does not designate 2a00:1098:0:80:1000:c:0:1 as permitted sender) smtp.mail=matthew.garrett@nebula.com >Received: from m972436d0.tmodns.net ([208.54.36.151] helo=x230.mview.int.nebula.com) > by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) > (Exim 4.72) > (envelope-from <matthew.garrett@nebula.com>) > id 1UKbNt-0008Dq-QN; Tue, 26 Mar 2013 21:26:22 +0000 >From: Matthew Garrett <matthew.garrett@nebula.com> >To: airlied@gmail.com >Cc: alexander.deucher@amd.com, > skeggsb@gmail.com, > linux-kernel@vger.kernel.org, > seth.forshee@canonical.com, > bhelgaas@google.com, > grawity@gmail.com, > torvalds@linux-foundation.org, > Matthew Garrett <matthew.garrett@nebula.com> >Subject: [PATCH 1/3] pci: Add PCI ROM helper for platform-provided ROM images >Date: Tue, 26 Mar 2013 17:25:54 -0400 >Message-Id: <1364333156-4530-1-git-send-email-matthew.garrett@nebula.com> >X-Mailer: git-send-email 1.8.1.2 >In-Reply-To: <CAPM=9tyYMSsK_2eCNRTx5EsgAQtnvmHxhgPHP3GHPxKUn+wo5w@mail.gmail.com> >References: <CAPM=9tyYMSsK_2eCNRTx5EsgAQtnvmHxhgPHP3GHPxKUn+wo5w@mail.gmail.com> >X-cavan-blacklisted-at: zen.spamhaus.org >X-SA-Do-Not-Run: Yes >X-SA-Exim-Connect-IP: 208.54.36.151 >X-SA-Exim-Mail-From: matthew.garrett@nebula.com >X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false >Status: RO >Content-Length: 4488 >Lines: 140 > >It turns out that some UEFI systems provide apparently an apparently valid >PCI ROM BAR that turns out to contain garbage, so the attempt in f4eb5ff05 >to prefer the ROM from the BAR actually breaks a different set of machines. >As Linus pointed out, the graphics drivers are probably in the best >position to make this judgement, so this basically reverts f4eb5ff05 and >f9a37be0f and adds a new helper function. Followup patches will add support >to nouveau and radeon for probing this ROM source if they can't find a ROM >from some other source. > >Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com> >--- > drivers/pci/rom.c | 67 +++++++++++++++++++++++++---------------------------- > include/linux/pci.h | 1 + > 2 files changed, 32 insertions(+), 36 deletions(-) > >diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c >index b41ac77..c5d0a08 100644 >--- a/drivers/pci/rom.c >+++ b/drivers/pci/rom.c >@@ -100,27 +100,6 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size) > return min((size_t)(image - rom), size); > } > >-static loff_t pci_find_rom(struct pci_dev *pdev, size_t *size) >-{ >- struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; >- loff_t start; >- >- /* assign the ROM an address if it doesn't have one */ >- if (res->parent == NULL && pci_assign_resource(pdev, PCI_ROM_RESOURCE)) >- return 0; >- start = pci_resource_start(pdev, PCI_ROM_RESOURCE); >- *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); >- >- if (*size == 0) >- return 0; >- >- /* Enable ROM space decodes */ >- if (pci_enable_rom(pdev)) >- return 0; >- >- return start; >-} >- > /** > * pci_map_rom - map a PCI ROM to kernel space > * @pdev: pointer to pci device struct >@@ -135,7 +114,7 @@ static loff_t pci_find_rom(struct pci_dev *pdev, size_t *size) > void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) > { > struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; >- loff_t start = 0; >+ loff_t start; > void __iomem *rom; > > /* >@@ -154,21 +133,21 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) > return (void __iomem *)(unsigned long) > pci_resource_start(pdev, PCI_ROM_RESOURCE); > } else { >- start = pci_find_rom(pdev, size); >- } >- } >+ /* assign the ROM an address if it doesn't have one */ >+ if (res->parent == NULL && >+ pci_assign_resource(pdev,PCI_ROM_RESOURCE)) >+ return NULL; >+ start = pci_resource_start(pdev, PCI_ROM_RESOURCE); >+ *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); >+ if (*size == 0) >+ return NULL; > >- /* >- * Some devices may provide ROMs via a source other than the BAR >- */ >- if (!start && pdev->rom && pdev->romlen) { >- *size = pdev->romlen; >- return phys_to_virt(pdev->rom); >+ /* Enable ROM space decodes */ >+ if (pci_enable_rom(pdev)) >+ return NULL; >+ } > } > >- if (!start) >- return NULL; >- > rom = ioremap(start, *size); > if (!rom) { > /* restore enable if ioremap fails */ >@@ -202,8 +181,7 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) > if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) > return; > >- if (!pdev->rom || !pdev->romlen) >- iounmap(rom); >+ iounmap(rom); > > /* Disable again before continuing, leave enabled if pci=rom */ > if (!(res->flags & (IORESOURCE_ROM_ENABLE | IORESOURCE_ROM_SHADOW))) >@@ -227,7 +205,24 @@ void pci_cleanup_rom(struct pci_dev *pdev) > } > } > >+/** >+ * pci_platform_rom - provides a pointer to any ROM image provided by the >+ * platform >+ * @pdev: pointer to pci device struct >+ * @size: pointer to receive size of pci window over ROM >+ */ >+void __iomem *pci_platform_rom(struct pci_dev *pdev, size_t *size) >+{ >+ if (pdev->rom && pdev->romlen) { >+ *size = pdev->romlen; >+ return phys_to_virt((phys_addr_t)pdev->rom); >+ } >+ >+ return NULL; >+} >+ > EXPORT_SYMBOL(pci_map_rom); > EXPORT_SYMBOL(pci_unmap_rom); > EXPORT_SYMBOL_GPL(pci_enable_rom); > EXPORT_SYMBOL_GPL(pci_disable_rom); >+EXPORT_SYMBOL(pci_platform_rom); >diff --git a/include/linux/pci.h b/include/linux/pci.h >index 2461033a..710067f 100644 >--- a/include/linux/pci.h >+++ b/include/linux/pci.h >@@ -916,6 +916,7 @@ void pci_disable_rom(struct pci_dev *pdev); > void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); > void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); > size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); >+void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); > > /* Power management related routines */ > int pci_save_state(struct pci_dev *dev); >-- >1.8.1.2 > > >From matthew.garrett@nebula.com Tue Mar 26 15:26:27 2013 >Delivered-To: bhelgaas@google.com >Received: by 10.182.76.5 with SMTP id g5csp108165obw; > Tue, 26 Mar 2013 14:26:29 -0700 (PDT) >X-Received: by 10.180.12.33 with SMTP id v1mr5775404wib.24.1364333187742; > Tue, 26 Mar 2013 14:26:27 -0700 (PDT) >Return-Path: <matthew.garrett@nebula.com> >Received: from cavan.codon.org.uk (cavan.codon.org.uk. [2a00:1098:0:80:1000:c:0:1]) > by mx.google.com with ESMTPS id fq1si1501379wib.41.2013.03.26.14.26.26 > (version=TLSv1 cipher=RC4-SHA bits=128/128); > Tue, 26 Mar 2013 14:26:27 -0700 (PDT) >Received-SPF: softfail (google.com: domain of transitioning matthew.garrett@nebula.com does not designate 2a00:1098:0:80:1000:c:0:1 as permitted sender) client-ip=2a00:1098:0:80:1000:c:0:1; >Authentication-Results: mx.google.com; > spf=softfail (google.com: domain of transitioning matthew.garrett@nebula.com does not designate 2a00:1098:0:80:1000:c:0:1 as permitted sender) smtp.mail=matthew.garrett@nebula.com >Received: from m972436d0.tmodns.net ([208.54.36.151] helo=x230.mview.int.nebula.com) > by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) > (Exim 4.72) > (envelope-from <matthew.garrett@nebula.com>) > id 1UKbNv-0008Dq-I8; Tue, 26 Mar 2013 21:26:23 +0000 >From: Matthew Garrett <matthew.garrett@nebula.com> >To: airlied@gmail.com >Cc: alexander.deucher@amd.com, > skeggsb@gmail.com, > linux-kernel@vger.kernel.org, > seth.forshee@canonical.com, > bhelgaas@google.com, > grawity@gmail.com, > torvalds@linux-foundation.org, > Matthew Garrett <matthew.garrett@nebula.com> >Subject: [PATCH 2/3] nouveau: Attempt to use platform-provided ROM image >Date: Tue, 26 Mar 2013 17:25:55 -0400 >Message-Id: <1364333156-4530-2-git-send-email-matthew.garrett@nebula.com> >X-Mailer: git-send-email 1.8.1.2 >In-Reply-To: <1364333156-4530-1-git-send-email-matthew.garrett@nebula.com> >References: <CAPM=9tyYMSsK_2eCNRTx5EsgAQtnvmHxhgPHP3GHPxKUn+wo5w@mail.gmail.com> > <1364333156-4530-1-git-send-email-matthew.garrett@nebula.com> >X-cavan-blacklisted-at: zen.spamhaus.org >X-SA-Do-Not-Run: Yes >X-SA-Exim-Connect-IP: 208.54.36.151 >X-SA-Exim-Mail-From: matthew.garrett@nebula.com >X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false >Status: RO >Content-Length: 1442 >Lines: 46 > >Some platforms only provide their PCI ROM via a platform-specific interface. >Fall back to attempting that if all other sources fail. > >Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com> >--- > drivers/gpu/drm/nouveau/core/subdev/bios/base.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c >index e816f06..0e2c1a4 100644 >--- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c >+++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c >@@ -248,6 +248,22 @@ nouveau_bios_shadow_pci(struct nouveau_bios *bios) > } > } > >+static void >+nouveau_bios_shadow_platform(struct nouveau_bios *bios) >+{ >+ struct pci_dev *pdev = nv_device(bios)->pdev; >+ size_t size; >+ >+ void __iomem *rom = pci_platform_rom(pdev, &size); >+ if (rom && size) { >+ bios->data = kmalloc(size, GFP_KERNEL); >+ if (bios->data) { >+ memcpy_fromio(bios->data, rom, size); >+ bios->size = size; >+ } >+ } >+} >+ > static int > nouveau_bios_score(struct nouveau_bios *bios, const bool writeable) > { >@@ -288,6 +304,7 @@ nouveau_bios_shadow(struct nouveau_bios *bios) > { "PROM", nouveau_bios_shadow_prom, false, 0, 0, NULL }, > { "ACPI", nouveau_bios_shadow_acpi, true, 0, 0, NULL }, > { "PCIROM", nouveau_bios_shadow_pci, true, 0, 0, NULL }, >+ { "PLATFORM", nouveau_bios_shadow_platform, true, 0, 0, NULL }, > {} > }; > struct methods *mthd, *best; >-- >1.8.1.2 > > >From matthew.garrett@nebula.com Tue Mar 26 15:26:27 2013 >Delivered-To: bhelgaas@google.com >Received: by 10.182.76.5 with SMTP id g5csp108162obw; > Tue, 26 Mar 2013 14:26:27 -0700 (PDT) >X-Received: by 10.180.105.99 with SMTP id gl3mr5848989wib.22.1364333187416; > Tue, 26 Mar 2013 14:26:27 -0700 (PDT) >Return-Path: <matthew.garrett@nebula.com> >Received: from cavan.codon.org.uk (cavan.codon.org.uk. [2a00:1098:0:80:1000:c:0:1]) > by mx.google.com with ESMTPS id cl1si1507321wib.23.2013.03.26.14.26.26 > (version=TLSv1 cipher=RC4-SHA bits=128/128); > Tue, 26 Mar 2013 14:26:27 -0700 (PDT) >Received-SPF: softfail (google.com: domain of transitioning matthew.garrett@nebula.com does not designate 2a00:1098:0:80:1000:c:0:1 as permitted sender) client-ip=2a00:1098:0:80:1000:c:0:1; >Authentication-Results: mx.google.com; > spf=softfail (google.com: domain of transitioning matthew.garrett@nebula.com does not designate 2a00:1098:0:80:1000:c:0:1 as permitted sender) smtp.mail=matthew.garrett@nebula.com >Received: from m972436d0.tmodns.net ([208.54.36.151] helo=x230.mview.int.nebula.com) > by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) > (Exim 4.72) > (envelope-from <matthew.garrett@nebula.com>) > id 1UKbNx-0008Dq-Ad; Tue, 26 Mar 2013 21:26:25 +0000 >From: Matthew Garrett <matthew.garrett@nebula.com> >To: airlied@gmail.com >Cc: alexander.deucher@amd.com, > skeggsb@gmail.com, > linux-kernel@vger.kernel.org, > seth.forshee@canonical.com, > bhelgaas@google.com, > grawity@gmail.com, > torvalds@linux-foundation.org, > Matthew Garrett <matthew.garrett@nebula.com> >Subject: [PATCH 3/3] radeon: Attempt to use platform-provided ROM image >Date: Tue, 26 Mar 2013 17:25:56 -0400 >Message-Id: <1364333156-4530-3-git-send-email-matthew.garrett@nebula.com> >X-Mailer: git-send-email 1.8.1.2 >In-Reply-To: <1364333156-4530-1-git-send-email-matthew.garrett@nebula.com> >References: <CAPM=9tyYMSsK_2eCNRTx5EsgAQtnvmHxhgPHP3GHPxKUn+wo5w@mail.gmail.com> > <1364333156-4530-1-git-send-email-matthew.garrett@nebula.com> >X-cavan-blacklisted-at: zen.spamhaus.org >X-SA-Do-Not-Run: Yes >X-SA-Exim-Connect-IP: 208.54.36.151 >X-SA-Exim-Mail-From: matthew.garrett@nebula.com >X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false >Status: RO >Content-Length: 1441 >Lines: 55 > >Some platforms only provide their PCI ROM via a platform-specific interface. >Fall back to attempting that if all other sources fail. > >Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com> >--- > drivers/gpu/drm/radeon/radeon_bios.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > >diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c >index b801591..fa3c56f 100644 >--- a/drivers/gpu/drm/radeon/radeon_bios.c >+++ b/drivers/gpu/drm/radeon/radeon_bios.c >@@ -99,6 +99,29 @@ static bool radeon_read_bios(struct radeon_device *rdev) > return true; > } > >+static bool radeon_read_platform_bios(struct radeon_device *rdev) >+{ >+ uint8_t __iomem *bios; >+ size_t size; >+ >+ rdev->bios = NULL; >+ >+ bios = pci_platform_rom(rdev->pdev, &size); >+ if (!bios) { >+ return false; >+ } >+ >+ if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) { >+ return false; >+ } >+ rdev->bios = kmemdup(bios, size, GFP_KERNEL); >+ if (rdev->bios == NULL) { >+ return false; >+ } >+ >+ return true; >+} >+ > #ifdef CONFIG_ACPI > /* ATRM is used to get the BIOS on the discrete cards in > * dual-gpu systems. >@@ -620,6 +643,9 @@ bool radeon_get_bios(struct radeon_device *rdev) > if (r == false) { > r = radeon_read_disabled_bios(rdev); > } >+ if (r == false) { >+ r = radeon_read_platform_bios(rdev); >+ } > if (r == false || rdev->bios == NULL) { > DRM_ERROR("Unable to locate a BIOS ROM\n"); > rdev->bios = NULL; >-- >1.8.1.2 > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 927451
:
716274
|
716275
| 717285 |
717418
|
717807
|
717948
|
844191
|
844236