From patchwork Wed Mar 4 03:59:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Breeds X-Patchwork-Id: 24025 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 2753BDE05D for ; Wed, 4 Mar 2009 15:00:11 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 2AA3ADDF05 for ; Wed, 4 Mar 2009 14:59:31 +1100 (EST) Received: by bilbo.ozlabs.org (Postfix, from userid 1026) id 00D92B7068; Wed, 4 Mar 2009 14:59:30 +1100 (EST) Date: Wed, 4 Mar 2009 14:59:30 +1100 From: Tony Breeds To: Kyle McMartin , Kumar Gala , Benjamin Herrenschmidt Subject: Re: [PATCH] ppc: detect sbc610 boards and only fixup nec usb on them Message-ID: <20090304035930.GD24834@bilbo.ozlabs.org> Mail-Followup-To: Kyle McMartin , Kumar Gala , Benjamin Herrenschmidt , linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org References: <20090304012229.GN28503@bombadil.infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090304012229.GN28503@bombadil.infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org On Tue, Mar 03, 2009 at 08:22:29PM -0500, Kyle McMartin wrote: > From: Kyle McMartin > > 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 > > --- > 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 --- 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 */