* [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it f [not found] <20140130000831.GJ16825@google.com> @ 2014-01-31 9:28 ` Sander Eikelenboom 2014-01-31 9:28 ` Sander Eikelenboom 2014-02-03 14:52 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents Konrad Rzeszutek Wilk 0 siblings, 2 replies; 6+ messages in thread From: Sander Eikelenboom @ 2014-01-31 9:28 UTC (permalink / raw) To: Bjorn Helgaas, Tony Luck, Dave Airlie, Eiichiro Oiwa, Greg Kroah-Hartman Cc: Sander Eikelenboom, Konrad Rzeszutek Wilk, linux-kernel @ vger . kernel . org, linux-pci @ vger . kernel . org, linux-ia64 Hi Bjorn / Tony, I fixed up ia64 as well and brought it inline again with the x86 code, but i don't have a ia64 machine, so that part is untested. Perhaps Tony is able to review/test it ? Sander Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it from reading it's own rom. It will get the content of the shadowrom at C000 instead, which is of the primary VGA card and the driver of the secondary card will bail out. Fix this by checking if the arch code or vga-arbitration has already determined the vga_default_device, if so only apply the fix to this primary video device and let the comment reflect this. v2: - Fix pci_fixup_video both in x86 and ia64 Sander Eikelenboom (1): Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it from reading it's own rom. It will get the content of the shadowrom at C000 instead, which is of the primary VGA card and the driver of the secondary card will bail out. arch/ia64/pci/fixup.c | 24 +++++++++++++----------- arch/x86/pci/fixup.c | 18 ++++++++++-------- 2 files changed, 23 insertions(+), 19 deletions(-) -- 1.7.10.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it f 2014-01-31 9:28 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it f Sander Eikelenboom @ 2014-01-31 9:28 ` Sander Eikelenboom 2014-02-03 14:52 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents Konrad Rzeszutek Wilk 1 sibling, 0 replies; 6+ messages in thread From: Sander Eikelenboom @ 2014-01-31 9:28 UTC (permalink / raw) To: Bjorn Helgaas, Tony Luck, Dave Airlie, Eiichiro Oiwa, Greg Kroah-Hartman Cc: Sander Eikelenboom, Konrad Rzeszutek Wilk, linux-kernel @ vger . kernel . org, linux-pci @ vger . kernel . org, linux-ia64 Fix this by checking if the arch code or vga-arbitration has already determined the vga_default_device, if so only apply the fix to this primary video device and let the comment reflect this. Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it> --- arch/ia64/pci/fixup.c | 24 +++++++++++++----------- arch/x86/pci/fixup.c | 18 ++++++++++-------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index 5dc969d..7762255 100644 --- a/arch/ia64/pci/fixup.c +++ b/arch/ia64/pci/fixup.c @@ -19,9 +19,10 @@ * IORESOURCE_ROM_SHADOW is used to associate the boot video * card with this copy. On laptops this copy has to be used since * the main ROM may be compressed or combined with another image. - * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW - * is marked here since the boot video device will be the only enabled - * video device at this point. + * See pci_map_rom() for use of this flag. Before marking the device + * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set + * by either arch cde or vga-arbitration, if so only apply the fixup to this + * already determined primary video card. */ static void pci_fixup_video(struct pci_dev *pdev) @@ -35,9 +36,6 @@ static void pci_fixup_video(struct pci_dev *pdev) return; /* Maybe, this machine supports legacy memory map. */ - if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) - return; - /* Is VGA routed to us? */ bus = pdev->bus; while (bus) { @@ -60,10 +58,14 @@ static void pci_fixup_video(struct pci_dev *pdev) } bus = bus->parent; } - pci_read_config_word(pdev, PCI_COMMAND, &config); - if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { - pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; - dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); + if (!vga_default_device() || pdev = vga_default_device()) { + pci_read_config_word(pdev, PCI_COMMAND, &config); + if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { + pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; + dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); + vga_set_default_device(pdev); + } } } -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video); diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index b046e07..34528a7 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -314,9 +314,10 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_r * IORESOURCE_ROM_SHADOW is used to associate the boot video * card with this copy. On laptops this copy has to be used since * the main ROM may be compressed or combined with another image. - * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW - * is marked here since the boot video device will be the only enabled - * video device at this point. + * See pci_map_rom() for use of this flag. Before marking the device + * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set + * by either arch cde or vga-arbitration, if so only apply the fixup to this + * already determined primary video card. */ static void pci_fixup_video(struct pci_dev *pdev) @@ -347,12 +348,13 @@ static void pci_fixup_video(struct pci_dev *pdev) } bus = bus->parent; } - pci_read_config_word(pdev, PCI_COMMAND, &config); - if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { - pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; - dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); - if (!vga_default_device()) + if (!vga_default_device() || pdev = vga_default_device()) { + pci_read_config_word(pdev, PCI_COMMAND, &config); + if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { + pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; + dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); vga_set_default_device(pdev); + } } } DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents 2014-01-31 9:28 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it f Sander Eikelenboom 2014-01-31 9:28 ` Sander Eikelenboom @ 2014-02-03 14:52 ` Konrad Rzeszutek Wilk 2014-02-07 11:03 ` Sander Eikelenboom 2014-02-13 9:48 ` Sander Eikelenboom 1 sibling, 2 replies; 6+ messages in thread From: Konrad Rzeszutek Wilk @ 2014-02-03 14:52 UTC (permalink / raw) To: Sander Eikelenboom Cc: Bjorn Helgaas, Tony Luck, Dave Airlie, Eiichiro Oiwa, Greg Kroah-Hartman, linux-kernel @ vger . kernel . org, linux-pci @ vger . kernel . org, linux-ia64 On Fri, Jan 31, 2014 at 10:28:22AM +0100, Sander Eikelenboom wrote: > Hi Bjorn / Tony, > > I fixed up ia64 as well and brought it inline again with the x86 code, > but i don't have a ia64 machine, so that part is untested. > Perhaps Tony is able to review/test it ? > > Sander > > > > Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary > prevents it from reading it's own rom. It will get the content of the shadowrom > at C000 instead, which is of the primary VGA card and the driver of the > secondary card will bail out. > > Fix this by checking if the arch code or vga-arbitration has already > determined the vga_default_device, if so only apply the fix to this > primary video device and let the comment reflect this. > > v2: > - Fix pci_fixup_video both in x86 and ia64 > > > Sander Eikelenboom (1): > Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the > primary prevents it from reading it's own rom. It will get the > content of the shadowrom at C000 instead, which is of the > primary VGA card and the driver of the secondary card will bail > out. Your editor mutilated your subject line. It ought to have been just one line. Anyhow, you can also add 'Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com' on the patch for the x86 part. The ia64 "looks" OK to me, but my ia64 box won't boot v3.11 or later so I can't give it a 'Tested-by' yet. > > arch/ia64/pci/fixup.c | 24 +++++++++++++----------- > arch/x86/pci/fixup.c | 18 ++++++++++-------- > 2 files changed, 23 insertions(+), 19 deletions(-) > > -- > 1.7.10.4 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents 2014-02-03 14:52 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents Konrad Rzeszutek Wilk @ 2014-02-07 11:03 ` Sander Eikelenboom 2014-02-13 9:48 ` Sander Eikelenboom 1 sibling, 0 replies; 6+ messages in thread From: Sander Eikelenboom @ 2014-02-07 11:03 UTC (permalink / raw) To: Konrad Rzeszutek Wilk, Tony Luck, Dave Airlie, Eiichiro Oiwa Cc: Bjorn Helgaas, Greg Kroah-Hartman, linux-kernel @ vger . kernel . org, linux-pci @ vger . kernel . org, linux-ia64 Hi All, Still trying to collect tested and acked-by's .. Dave, In commit 6cf20beec4b91c240cf759b4db72669e251f1fc4 you changed pci_fixup_video saying: "This fixes the switcheroo on my T410s." Do you still have the machine and could you verify if it still works with this patch applied ? Eiichiro, Most of last major overhaul of pci_fixup_video was in commit 6b5c76b8e2ff204fa8d7201acce461188873bf2b saying: "PCI: fix pci_fixup_video as it blows up on sparc64" Is it possible for you to verify you can still boot on sparc64 with this patch applied ? Tony, Since ia64's pci_fixup_video is also changed to be inline with x86, could you verify it still compiles and boots for you ? Konrad, Thanks for reviewing and testing ! -- Sander Monday, February 3, 2014, 3:52:05 PM, you wrote: > On Fri, Jan 31, 2014 at 10:28:22AM +0100, Sander Eikelenboom wrote: >> Hi Bjorn / Tony, >> >> I fixed up ia64 as well and brought it inline again with the x86 code, >> but i don't have a ia64 machine, so that part is untested. >> Perhaps Tony is able to review/test it ? >> >> Sander >> >> >> >> Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary >> prevents it from reading it's own rom. It will get the content of the shadowrom >> at C000 instead, which is of the primary VGA card and the driver of the >> secondary card will bail out. >> >> Fix this by checking if the arch code or vga-arbitration has already >> determined the vga_default_device, if so only apply the fix to this >> primary video device and let the comment reflect this. >> >> v2: >> - Fix pci_fixup_video both in x86 and ia64 >> >> >> Sander Eikelenboom (1): >> Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the >> primary prevents it from reading it's own rom. It will get the >> content of the shadowrom at C000 instead, which is of the >> primary VGA card and the driver of the secondary card will bail >> out. > Your editor mutilated your subject line. It ought to have been just > one line. > Anyhow, you can also add 'Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com' > on the patch for the x86 part. > The ia64 "looks" OK to me, but my ia64 box won't boot v3.11 or later > so I can't give it a 'Tested-by' yet. >> >> arch/ia64/pci/fixup.c | 24 +++++++++++++----------- >> arch/x86/pci/fixup.c | 18 ++++++++++-------- >> 2 files changed, 23 insertions(+), 19 deletions(-) >> >> -- >> 1.7.10.4 >> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents 2014-02-03 14:52 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents Konrad Rzeszutek Wilk 2014-02-07 11:03 ` Sander Eikelenboom @ 2014-02-13 9:48 ` Sander Eikelenboom 2014-02-14 20:26 ` Bjorn Helgaas 1 sibling, 1 reply; 6+ messages in thread From: Sander Eikelenboom @ 2014-02-13 9:48 UTC (permalink / raw) To: Bjorn Helgaas Cc: Konrad Rzeszutek Wilk, Tony Luck, Dave Airlie, Eiichiro Oiwa, Greg Kroah-Hartman, linux-kernel @ vger . kernel . org, linux-pci @ vger . kernel . org, linux-ia64 Hi Bjorn, I have given it another email and another week, but without gaining any reviewed or acked-by's. It seems the only way forward is to shovel it in linux-next earlier, give it a good soak and see if anyone starts to squeal .. or that everything seems to be ok :-) Would you need a v3 with the acked and reviewed-by from Konrad for x86 in it ? -- Sander Monday, February 3, 2014, 3:52:05 PM, you wrote: > On Fri, Jan 31, 2014 at 10:28:22AM +0100, Sander Eikelenboom wrote: >> Hi Bjorn / Tony, >> >> I fixed up ia64 as well and brought it inline again with the x86 code, >> but i don't have a ia64 machine, so that part is untested. >> Perhaps Tony is able to review/test it ? >> >> Sander >> >> >> >> Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary >> prevents it from reading it's own rom. It will get the content of the shadowrom >> at C000 instead, which is of the primary VGA card and the driver of the >> secondary card will bail out. >> >> Fix this by checking if the arch code or vga-arbitration has already >> determined the vga_default_device, if so only apply the fix to this >> primary video device and let the comment reflect this. >> >> v2: >> - Fix pci_fixup_video both in x86 and ia64 >> >> >> Sander Eikelenboom (1): >> Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the >> primary prevents it from reading it's own rom. It will get the >> content of the shadowrom at C000 instead, which is of the >> primary VGA card and the driver of the secondary card will bail >> out. > Your editor mutilated your subject line. It ought to have been just > one line. > Anyhow, you can also add 'Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com' > on the patch for the x86 part. > The ia64 "looks" OK to me, but my ia64 box won't boot v3.11 or later > so I can't give it a 'Tested-by' yet. >> >> arch/ia64/pci/fixup.c | 24 +++++++++++++----------- >> arch/x86/pci/fixup.c | 18 ++++++++++-------- >> 2 files changed, 23 insertions(+), 19 deletions(-) >> >> -- >> 1.7.10.4 >> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents 2014-02-13 9:48 ` Sander Eikelenboom @ 2014-02-14 20:26 ` Bjorn Helgaas 0 siblings, 0 replies; 6+ messages in thread From: Bjorn Helgaas @ 2014-02-14 20:26 UTC (permalink / raw) To: Sander Eikelenboom Cc: Konrad Rzeszutek Wilk, Tony Luck, Dave Airlie, Eiichiro Oiwa, Greg Kroah-Hartman, linux-kernel @ vger . kernel . org, linux-pci @ vger . kernel . org, linux-ia64 On Thu, Feb 13, 2014 at 10:48:24AM +0100, Sander Eikelenboom wrote: > Hi Bjorn, > > I have given it another email and another week, but without gaining any reviewed or acked-by's. > It seems the only way forward is to shovel it in linux-next earlier, give it a good soak and see if > anyone starts to squeal .. or that everything seems to be ok :-) > > Would you need a v3 with the acked and reviewed-by from Konrad for x86 in it ? No need, I applied this to my pci/misc branch for v3.15. Tony, let me know if you have any issues with this. Bjorn > Monday, February 3, 2014, 3:52:05 PM, you wrote: > > > On Fri, Jan 31, 2014 at 10:28:22AM +0100, Sander Eikelenboom wrote: > >> Hi Bjorn / Tony, > >> > >> I fixed up ia64 as well and brought it inline again with the x86 code, > >> but i don't have a ia64 machine, so that part is untested. > >> Perhaps Tony is able to review/test it ? > >> > >> Sander > >> > >> > >> > >> Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary > >> prevents it from reading it's own rom. It will get the content of the shadowrom > >> at C000 instead, which is of the primary VGA card and the driver of the > >> secondary card will bail out. > >> > >> Fix this by checking if the arch code or vga-arbitration has already > >> determined the vga_default_device, if so only apply the fix to this > >> primary video device and let the comment reflect this. > >> > >> v2: > >> - Fix pci_fixup_video both in x86 and ia64 > >> > >> > >> Sander Eikelenboom (1): > >> Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the > >> primary prevents it from reading it's own rom. It will get the > >> content of the shadowrom at C000 instead, which is of the > >> primary VGA card and the driver of the secondary card will bail > >> out. > > > Your editor mutilated your subject line. It ought to have been just > > one line. > > > Anyhow, you can also add 'Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com' > > on the patch for the x86 part. > > > The ia64 "looks" OK to me, but my ia64 box won't boot v3.11 or later > > so I can't give it a 'Tested-by' yet. > > >> > >> arch/ia64/pci/fixup.c | 24 +++++++++++++----------- > >> arch/x86/pci/fixup.c | 18 ++++++++++-------- > >> 2 files changed, 23 insertions(+), 19 deletions(-) > >> > >> -- > >> 1.7.10.4 > >> > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-02-14 20:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20140130000831.GJ16825@google.com>
2014-01-31 9:28 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents it f Sander Eikelenboom
2014-01-31 9:28 ` Sander Eikelenboom
2014-02-03 14:52 ` [PATCH v2] Setting the IORESOURCE_ROM_SHADOW flag on a VGA card other than the primary prevents Konrad Rzeszutek Wilk
2014-02-07 11:03 ` Sander Eikelenboom
2014-02-13 9:48 ` Sander Eikelenboom
2014-02-14 20:26 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox