linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppc: detect sbc610 boards and only fixup nec usb on them
@ 2009-03-04  1:22 Kyle McMartin
  2009-03-04  3:59 ` Tony Breeds
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle McMartin @ 2009-03-04  1:22 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-kernel

From: Kyle McMartin <kyle@redhat.com>

Bug #486511 in Fedora, this is getting applied to any machine with a NEC
USB pci device if this CONFIG_GEF_SBC610 is on (as it was in Fedora.)
Obviously this isn't appropriate to do in any more than the SBC610
case..., so flag that we're a sbc610 board, and skip the fixup if we're
not.

(Fedora: Should fix USB on Mac G4/G5...)

Signed-off-by: Kyle McMartin <kyle@redhat.com>

---
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index fb371f5..54afda2 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -51,6 +51,8 @@
 
 void __iomem *sbc610_regs;
 
+static int is_sbc610;
+
 static void __init gef_sbc610_init_irq(void)
 {
 	struct device_node *cascade_node = NULL;
@@ -142,6 +144,9 @@ static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
+	if (!is_sbc610)
+		return;
+
 	printk(KERN_INFO "Running NEC uPD720101 Fixup\n");
 
 	/* Ensure ports 1, 2, 3, 4 & 5 are enabled */
@@ -166,8 +171,10 @@ static int __init gef_sbc610_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
 
-	if (of_flat_dt_is_compatible(root, "gef,sbc610"))
+	if (of_flat_dt_is_compatible(root, "gef,sbc610")) {
+		is_sbc610 = 1;
 		return 1;
+	}
 
 	return 0;
 }

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

* Re: [PATCH] ppc: detect sbc610 boards and only fixup nec usb on them
  2009-03-04  1:22 [PATCH] ppc: detect sbc610 boards and only fixup nec usb on them Kyle McMartin
@ 2009-03-04  3:59 ` Tony Breeds
  2009-03-04  6:42   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Breeds @ 2009-03-04  3:59 UTC (permalink / raw)
  To: Kyle McMartin, Kumar Gala, Benjamin Herrenschmidt
  Cc: linuxppc-dev, linux-kernel

On Tue, Mar 03, 2009 at 08:22:29PM -0500, Kyle McMartin wrote:
> From: Kyle McMartin <kyle@redhat.com>
> 
> Bug #486511 in Fedora, this is getting applied to any machine with a NEC
> USB pci device if this CONFIG_GEF_SBC610 is on (as it was in Fedora.)
> Obviously this isn't appropriate to do in any more than the SBC610
> case..., so flag that we're a sbc610 board, and skip the fixup if we're
> not.
> 
> (Fedora: Should fix USB on Mac G4/G5...)
> 
> Signed-off-by: Kyle McMartin <kyle@redhat.com>
> 
> ---
> diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
> index fb371f5..54afda2 100644
> --- a/arch/powerpc/platforms/86xx/gef_sbc610.c
> +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
> @@ -51,6 +51,8 @@
>  
>  void __iomem *sbc610_regs;
>  
> +static int is_sbc610;

I came up with this as well, but used the machine_is() infrasturcture.

Subject: [PATCH] Run fixup code only on the appropriate platform.

commit a969e76a7101bf5f3d369563df1ca1253dd6131b (powerpc: Correct USB
support for GE Fanuc SBC610) introduced a fixup for NEC usb controllers.
This fixup should only run on GEF SBC610 boards.

Fixes Fedora bug #486511.
(https://bugzilla.redhat.com/show_bug.cgi?id=486511)

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
 arch/powerpc/platforms/86xx/gef_sbc610.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index fb371f5..d6b772b 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -142,6 +142,10 @@ static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
 {
 	unsigned int val;
 
+	/* Do not do the fixup on other platforms! */
+	if (!machine_is(gef_sbc610))
+		return;
+
 	printk(KERN_INFO "Running NEC uPD720101 Fixup\n");
 
 	/* Ensure ports 1, 2, 3, 4 & 5 are enabled */
-- 
1.6.0.6


Yours Tony

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

* Re: [PATCH] ppc: detect sbc610 boards and only fixup nec usb on them
  2009-03-04  3:59 ` Tony Breeds
@ 2009-03-04  6:42   ` Benjamin Herrenschmidt
  2009-03-04 14:30     ` Kyle McMartin
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2009-03-04  6:42 UTC (permalink / raw)
  To: Tony Breeds; +Cc: linuxppc-dev, Kyle McMartin, linux-kernel

Thanks, I applied Tony's patch and sent a pull request to Linus.

Cheers,
Ben.

On Wed, 2009-03-04 at 14:59 +1100, Tony Breeds wrote:
> On Tue, Mar 03, 2009 at 08:22:29PM -0500, Kyle McMartin wrote:
> > From: Kyle McMartin <kyle@redhat.com>
> > 
> > Bug #486511 in Fedora, this is getting applied to any machine with a NEC
> > USB pci device if this CONFIG_GEF_SBC610 is on (as it was in Fedora.)
> > Obviously this isn't appropriate to do in any more than the SBC610
> > case..., so flag that we're a sbc610 board, and skip the fixup if we're
> > not.
> > 
> > (Fedora: Should fix USB on Mac G4/G5...)
> > 
> > Signed-off-by: Kyle McMartin <kyle@redhat.com>
> > 
> > ---
> > diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
> > index fb371f5..54afda2 100644
> > --- a/arch/powerpc/platforms/86xx/gef_sbc610.c
> > +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
> > @@ -51,6 +51,8 @@
> >  
> >  void __iomem *sbc610_regs;
> >  
> > +static int is_sbc610;
> 
> I came up with this as well, but used the machine_is() infrasturcture.
> 
> Subject: [PATCH] Run fixup code only on the appropriate platform.
> 
> commit a969e76a7101bf5f3d369563df1ca1253dd6131b (powerpc: Correct USB
> support for GE Fanuc SBC610) introduced a fixup for NEC usb controllers.
> This fixup should only run on GEF SBC610 boards.
> 
> Fixes Fedora bug #486511.
> (https://bugzilla.redhat.com/show_bug.cgi?id=486511)
> 
> Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
> ---
>  arch/powerpc/platforms/86xx/gef_sbc610.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
> index fb371f5..d6b772b 100644
> --- a/arch/powerpc/platforms/86xx/gef_sbc610.c
> +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
> @@ -142,6 +142,10 @@ static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
>  {
>  	unsigned int val;
>  
> +	/* Do not do the fixup on other platforms! */
> +	if (!machine_is(gef_sbc610))
> +		return;
> +
>  	printk(KERN_INFO "Running NEC uPD720101 Fixup\n");
>  
>  	/* Ensure ports 1, 2, 3, 4 & 5 are enabled */

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

* Re: [PATCH] ppc: detect sbc610 boards and only fixup nec usb on them
  2009-03-04  6:42   ` Benjamin Herrenschmidt
@ 2009-03-04 14:30     ` Kyle McMartin
  0 siblings, 0 replies; 4+ messages in thread
From: Kyle McMartin @ 2009-03-04 14:30 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Kyle McMartin, linux-kernel

On Wed, Mar 04, 2009 at 05:42:20PM +1100, Benjamin Herrenschmidt wrote:
> Thanks, I applied Tony's patch and sent a pull request to Linus.
> 

Works for me. Thanks for being so quick, Ben!

cheers, Kyle

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

end of thread, other threads:[~2009-03-04 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-04  1:22 [PATCH] ppc: detect sbc610 boards and only fixup nec usb on them Kyle McMartin
2009-03-04  3:59 ` Tony Breeds
2009-03-04  6:42   ` Benjamin Herrenschmidt
2009-03-04 14:30     ` Kyle McMartin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).