From patchwork Sun Mar 15 16:36:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 12190 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2FGaSXB021856 for ; Sun, 15 Mar 2009 16:36:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752431AbZCOQg2 (ORCPT ); Sun, 15 Mar 2009 12:36:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752408AbZCOQg2 (ORCPT ); Sun, 15 Mar 2009 12:36:28 -0400 Received: from wf-out-1314.google.com ([209.85.200.168]:25461 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbZCOQg1 convert rfc822-to-8bit (ORCPT ); Sun, 15 Mar 2009 12:36:27 -0400 Received: by wf-out-1314.google.com with SMTP id 28so1451142wfa.4 for ; Sun, 15 Mar 2009 09:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JT3HN5MFwd2Y3kEX4FTM8Tbio5+pUihFv73cASx2QII=; b=IsPqH5bHOB0HB74Pj5hZShv8oWP/oyw8UNV8yNcMPsrIYQKrSc6ackn8+dpMWyWQbD +NT48TVbU1eoxqPqQHlUAXhVIH2GKd1w16DUCaQUSmJL8IoC2GxYnszgy8ZaFvxUYARX Jy+VtG7MyVKAA67qC2BS1hXgjTCycj3bvWPOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Q3pOnEsuh68EaaUbzgyiupCOqgyMEJi8MsOxUjci8LHiUByxCw3hSXqQsE3+2ZF5e8 Cs3Oc4WG8Oc5HH7+3h84EFcAoQz9U9X/crVwfoC8Mlm1maOFS+Cio2MZwj9YPB0YK+Ji aOEogwiJrixYup9vHUoDFA9zYyT0L93fvYZwE= MIME-Version: 1.0 Received: by 10.143.5.20 with SMTP id h20mr1683436wfi.167.1237134985589; Sun, 15 Mar 2009 09:36:25 -0700 (PDT) In-Reply-To: <20090315153827.GA10541@n2100.arm.linux.org.uk> References: <20090313224259.8810.3283.stgit@localhost> <20090313224453.8810.41743.stgit@localhost> <20090315153827.GA10541@n2100.arm.linux.org.uk> Date: Sun, 15 Mar 2009 09:36:25 -0700 Message-ID: <5e088bd90903150936w45e68b63k1252cea38b48a5fc@mail.gmail.com> Subject: Re: [PATCH 1/4] ARM: OMAP3: Add SMSC911X support to Overo platform (V2) From: Steve Sakoman To: Russell King - ARM Linux Cc: Tony Lindgren , linux-arm-kernel@lists.arm.linux.org.uk, linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On Sun, Mar 15, 2009 at 8:38 AM, Russell King - ARM Linux wrote: > On Fri, Mar 13, 2009 at 03:44:53PM -0700, Tony Lindgren wrote: >> Gumstix will soon be shipping a variant of their Summit board that >> includes an SMSC LAN9221 ethernet interface.  This patch provides >> support via the smsc911x driver when enabled in kernel config. > > Does this actually work with the smsc911x driver which is in mainline, > or is it dependent on the smsc911x patches from Steve Glendinning? For the shipping Overo kernel, I build with 2 of Steve's patches, copied below. Steve "Unable to claim requested irq: %d", dev->irq); ====================================================== From: Steve Glendinning This patch adds support for the platform_device's resources to indicate additional flags to use when registering the irq, for example IORESOURCE_IRQ_LOWLEVEL (which corresponds to IRQF_TRIGGER_LOW). These should be set in the irq resource flags field. Signed-off-by: Steve Glendinning --- drivers/net/smsc911x.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index f513bdf..3565df1 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -1892,9 +1892,9 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) struct net_device *dev; struct smsc911x_data *pdata; struct smsc911x_platform_config *config = pdev->dev.platform_data; - struct resource *res; + struct resource *res, *irq_res; unsigned int intcfg = 0; - int res_size; + int res_size, irq_flags; int retval; DECLARE_MAC_BUF(mac); @@ -1919,6 +1919,14 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) } res_size = res->end - res->start; + irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (!irq_res) { + pr_warning("%s: Could not allocate irq resource.\n", + SMSC_CHIPNAME); + retval = -ENODEV; + goto out_0; + } + if (!request_mem_region(res->start, res_size, SMSC_CHIPNAME)) { retval = -EBUSY; goto out_0; @@ -1935,7 +1943,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) pdata = netdev_priv(dev); - dev->irq = platform_get_irq(pdev, 0); + dev->irq = irq_res->start; + irq_flags = irq_res->flags & IRQF_TRIGGER_MASK; pdata->ioaddr = ioremap_nocache(res->start, res_size); /* copy config parameters across to pdata */ @@ -1968,8 +1977,8 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) smsc911x_reg_write(pdata, INT_EN, 0); smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF); - retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED, - dev->name, dev); + retval = request_irq(dev->irq, smsc911x_irqhandler, + irq_flags | IRQF_DISABLED, dev->name, dev); if (retval) { SMSC_WARNING(PROBE, "Unable to claim requested irq: %d", dev->irq); ====================================================== From: Steve Glendinning The isr supports shared operation, so register it with the IRQF_SHARED flag to indicate this. This patch also removes the IRQF_DISABLED flag. This driver doesn't need it, and IRQF_DISABLED isn't guaranteed when using shared interrupts. Signed-off-by: Steve Glendinning --- drivers/net/smsc911x.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index 3565df1..f882fd5 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c @@ -1978,7 +1978,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF); retval = request_irq(dev->irq, smsc911x_irqhandler, - irq_flags | IRQF_DISABLED, dev->name, dev); + irq_flags | IRQF_SHARED, dev->name, dev); if (retval) { SMSC_WARNING(PROBE,