From patchwork Tue Mar 19 13:39:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 2300921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 05AF2DFB79 for ; Tue, 19 Mar 2013 13:42:34 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UHwlN-0000dh-0a; Tue, 19 Mar 2013 13:39:37 +0000 Received: from mail.free-electrons.com ([94.23.35.102]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UHwlG-0000bq-Hm for linux-arm-kernel@lists.infradead.org; Tue, 19 Mar 2013 13:39:31 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 742FE224E; Tue, 19 Mar 2013 14:39:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (20.222.3.200.ros.express.com.ar [200.3.222.20]) by mail.free-electrons.com (Postfix) with ESMTPSA id BFB91828; Tue, 19 Mar 2013 14:39:24 +0100 (CET) Date: Tue, 19 Mar 2013 10:39:30 -0300 From: Ezequiel Garcia To: Masami Hiramatsu Subject: Re: [BUG][mvebu] mvneta: cannot request irq 25 on openblocks-ax3 Message-ID: <20130319133928.GE3137@localhost> References: <51486445.8040506@hitachi.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <51486445.8040506@hitachi.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130319_093930_816109_3240DF70 X-CRM114-Status: GOOD ( 20.99 ) X-Spam-Score: -4.4 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -2.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: thomas.petazzoni@free-electrons.com, Jason Cooper , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "yrl.pp-manager.tt@hitachi.com" , Gregory Clement , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi Masami, On Tue, Mar 19, 2013 at 10:12:37PM +0900, Masami Hiramatsu wrote: > > Here I've hit a bug on the recent kernel. As far as I know, this bug > exists on 3.9-rc1 too. > > When I tried the latest mvebu for-next tree > (git://git.infradead.org/users/jcooper/linux.git mvebu/for-next), > I got below warning at bootup time and mvneta didn't work (link was never up). > I ensured that "ifconfig ethX up" always caused that. > > Does anyone succeed to boot openblocks-ax3 recently or hit same > trouble? This is a known bug. Gregory Clement already has a fix and he will submit it soon. In case you need this fixed ASAP, I'm attaching you a patch with a fix. Please note the attached patch is not ready for mainline inclusion, as I said Gregory will submit a cleaner version soon. diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index b6025c3..7f63dd4 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -1800,7 +1800,7 @@ static void mvneta_set_rx_mode(struct net_device *dev) /* Interrupt handling - the callback for request_irq() */ static irqreturn_t mvneta_isr(int irq, void *dev_id) { - struct mvneta_port *pp = (struct mvneta_port *)dev_id; + struct mvneta_port *pp = *(struct mvneta_port **)dev_id; /* Mask all interrupts */ mvreg_write(pp, MVNETA_INTR_NEW_MASK, 0); @@ -2368,6 +2368,7 @@ static void mvneta_mdio_remove(struct mvneta_port *pp) phy_disconnect(pp->phy_dev); pp->phy_dev = NULL; } +static struct mvneta_port __percpu **percpu_pp; static int mvneta_open(struct net_device *dev) { @@ -2386,9 +2387,14 @@ static int mvneta_open(struct net_device *dev) if (ret) goto err_cleanup_rxqs; + percpu_pp = alloc_percpu(struct mvneta_port *); + *__this_cpu_ptr(percpu_pp) = pp; + /* Connect to port interrupt line */ - ret = request_irq(pp->dev->irq, mvneta_isr, 0, - MVNETA_DRIVER_NAME, pp); + ret = request_percpu_irq(pp->dev->irq, mvneta_isr, + MVNETA_DRIVER_NAME, percpu_pp); + enable_percpu_irq(pp->dev->irq, 0); + if (ret) { netdev_err(pp->dev, "cannot request irq %d\n", pp->dev->irq); goto err_cleanup_txqs;