Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Kirkwood: Update PCI-E fixup
@ 2012-11-21  7:19 Jason Gunthorpe
  2012-11-21 15:05 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2012-11-21  7:19 UTC (permalink / raw)
  To: linux-arm-kernel

- The code relies on rc_pci_fixup being called, which only happens
  when CONFIG_PCI_QUIRKS is enabled, so add that to Kconfig. Omitting
  this causes a booting failure with a non-obvious cause.
- Update rc_pci_fixup to set the class properly, copying the
  more modern style from other places
- Correct the rc_pci_fixup comment

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 arch/arm/Kconfig              |    1 +
 arch/arm/mach-kirkwood/pcie.c |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

Another cleanup.. It took a fair while to figure out that things
were not working properly because PCI_QUIRKS was not set :|

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ade7e92..9759fec 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -547,6 +547,7 @@ config ARCH_KIRKWOOD
 	select CPU_FEROCEON
 	select GENERIC_CLOCKEVENTS
 	select PCI
+	select PCI_QUIRKS
 	select PLAT_ORION_LEGACY
 	help
 	  Support for the following Marvell Kirkwood series SoCs:
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index d5aedf6..59c97fe 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -207,14 +207,17 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
 	return 1;
 }
 
+/* The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
+   is operating as a root complex this needs to be switched to
+   PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
+   the device. Decoding setup is handled by the orion code. */
 static void __devinit rc_pci_fixup(struct pci_dev *dev)
 {
-	/*
-	 * Prevent enumeration of root complex.
-	 */
 	if (dev->bus->parent == NULL && dev->devfn == 0) {
 		int i;
 
+		dev->class &= 0xff;
+		dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
 		for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
 			dev->resource[i].start = 0;
 			dev->resource[i].end   = 0;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ARM: Kirkwood: Update PCI-E fixup
  2012-11-21  7:19 [PATCH] ARM: Kirkwood: Update PCI-E fixup Jason Gunthorpe
@ 2012-11-21 15:05 ` Thomas Petazzoni
  2012-11-21 17:33   ` Jason Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2012-11-21 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Jason Gunthorpe,

On Wed, 21 Nov 2012 00:19:06 -0700, Jason Gunthorpe wrote:

> +/* The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
> +   is operating as a root complex this needs to be switched to
> +   PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
> +   the device. Decoding setup is handled by the orion code. */

Sorry for this unique silly review comment, but this comment does not
comply with the kernel CodingStyle for multicomments. It should be:

/*
 * Blabla.
 * Blibli.
 */

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: Kirkwood: Update PCI-E fixup
  2012-11-21 15:05 ` Thomas Petazzoni
@ 2012-11-21 17:33   ` Jason Gunthorpe
  2012-11-21 17:44     ` Jason Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Gunthorpe @ 2012-11-21 17:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 21, 2012 at 04:05:55PM +0100, Thomas Petazzoni wrote:
> Dear Jason Gunthorpe,
> 
> On Wed, 21 Nov 2012 00:19:06 -0700, Jason Gunthorpe wrote:
> 
> > +/* The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
> > +   is operating as a root complex this needs to be switched to
> > +   PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
> > +   the device. Decoding setup is handled by the orion code. */
> 
> Sorry for this unique silly review comment, but this comment does not
> comply with the kernel CodingStyle for multicomments. It should be:

Ok! Though I'm surprised checkpatch didn't complain?

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ARM: Kirkwood: Update PCI-E fixup
  2012-11-21 17:33   ` Jason Gunthorpe
@ 2012-11-21 17:44     ` Jason Cooper
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Cooper @ 2012-11-21 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 21, 2012 at 10:33:57AM -0700, Jason Gunthorpe wrote:
> On Wed, Nov 21, 2012 at 04:05:55PM +0100, Thomas Petazzoni wrote:
> > Dear Jason Gunthorpe,
> > 
> > On Wed, 21 Nov 2012 00:19:06 -0700, Jason Gunthorpe wrote:
> > 
> > > +/* The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
> > > +   is operating as a root complex this needs to be switched to
> > > +   PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
> > > +   the device. Decoding setup is handled by the orion code. */
> > 
> > Sorry for this unique silly review comment, but this comment does not
> > comply with the kernel CodingStyle for multicomments. It should be:
> 
> Ok! Though I'm surprised checkpatch didn't complain?

I'll fix this up as I'm merging it in the next few minutes.

thx,

Jason.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-21 17:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-21  7:19 [PATCH] ARM: Kirkwood: Update PCI-E fixup Jason Gunthorpe
2012-11-21 15:05 ` Thomas Petazzoni
2012-11-21 17:33   ` Jason Gunthorpe
2012-11-21 17:44     ` Jason Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox