diff mbox

[1/4] ARM: OMAP3: Add SMSC911X support to Overo platform (V2)

Message ID 5e088bd90903150936w45e68b63k1252cea38b48a5fc@mail.gmail.com (mailing list archive)
State Awaiting Upstream, archived
Headers show

Commit Message

Steve Sakoman March 15, 2009, 4:36 p.m. UTC
On Sun, Mar 15, 2009 at 8:38 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> 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);

Comments

Russell King - ARM Linux March 15, 2009, 5 p.m. UTC | #1
On Sun, Mar 15, 2009 at 09:36:25AM -0700, Steve Sakoman wrote:
> On Sun, Mar 15, 2009 at 8:38 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> 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.

That doesn't help answer the question.  What we need to know is whether
this patch works alone?  If not, do we know for sure that Steve's patches
are going in during the next merge window?

If it doesn't work alone _and_ Steve's patches aren't for whatever reason
going in (via the net tree), then this patch should be dropped from the
set.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Sakoman March 15, 2009, 5:13 p.m. UTC | #2
On Sun, Mar 15, 2009 at 10:00 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Sun, Mar 15, 2009 at 09:36:25AM -0700, Steve Sakoman wrote:
>> On Sun, Mar 15, 2009 at 8:38 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> 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.
>
> That doesn't help answer the question.  What we need to know is whether
> this patch works alone?  If not, do we know for sure that Steve's patches
> are going in during the next merge window?

It does not work without the 2 mentioned patches (IRQ's never get handled).

I have no idea on the status of Steve's patches re: next merge window.
 To my eyes, they seem fairly important for a functional driver :-)

Steve

> If it doesn't work alone _and_ Steve's patches aren't for whatever reason
> going in (via the net tree), then this patch should be dropped from the
> set.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Russell King - ARM Linux March 15, 2009, 5:37 p.m. UTC | #3
On Sun, Mar 15, 2009 at 10:13:47AM -0700, Steve Sakoman wrote:
> On Sun, Mar 15, 2009 at 10:00 AM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
> > On Sun, Mar 15, 2009 at 09:36:25AM -0700, Steve Sakoman wrote:
> >> On Sun, Mar 15, 2009 at 8:38 AM, Russell King - ARM Linux
> >> <linux@arm.linux.org.uk> 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.
> >
> > That doesn't help answer the question.  What we need to know is whether
> > this patch works alone?  If not, do we know for sure that Steve's patches
> > are going in during the next merge window?
> 
> It does not work without the 2 mentioned patches (IRQ's never get handled).

So I suggest that this patch is handed over to Steve to submit with his
set of patches.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren March 16, 2009, 6:08 p.m. UTC | #4
* Russell King - ARM Linux <linux@arm.linux.org.uk> [090315 10:37]:
> On Sun, Mar 15, 2009 at 10:13:47AM -0700, Steve Sakoman wrote:
> > On Sun, Mar 15, 2009 at 10:00 AM, Russell King - ARM Linux
> > <linux@arm.linux.org.uk> wrote:
> > > On Sun, Mar 15, 2009 at 09:36:25AM -0700, Steve Sakoman wrote:
> > >> On Sun, Mar 15, 2009 at 8:38 AM, Russell King - ARM Linux
> > >> <linux@arm.linux.org.uk> 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.
> > >
> > > That doesn't help answer the question.  What we need to know is whether
> > > this patch works alone?  If not, do we know for sure that Steve's patches
> > > are going in during the next merge window?
> > 
> > It does not work without the 2 mentioned patches (IRQ's never get handled).
> 
> So I suggest that this patch is handed over to Steve to submit with his
> set of patches.

I've added Steve Glendinning to the Cc.

I'll drop this from my queue, Steve Sakoman please email this to Steve
Glendinning for inclusion to his queue.

Please also Cc at least linux-omap and netdev lists.

Thanks,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Glendinning March 17, 2009, 8:18 a.m. UTC | #5
Hi Tony,

Tony Lindgren <tony@atomide.com> wrote on 16/03/2009 18:08:01:

> * Russell King - ARM Linux <linux@arm.linux.org.uk> [090315 10:37]:
> > On Sun, Mar 15, 2009 at 10:13:47AM -0700, Steve Sakoman wrote:
> > > On Sun, Mar 15, 2009 at 10:00 AM, Russell King - ARM Linux
> > > <linux@arm.linux.org.uk> wrote:
> > > > On Sun, Mar 15, 2009 at 09:36:25AM -0700, Steve Sakoman wrote:
> > > >> On Sun, Mar 15, 2009 at 8:38 AM, Russell King - ARM Linux
> > > >> <linux@arm.linux.org.uk> 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.
> > > >
> > > > That doesn't help answer the question.  What we need to know is 
whether
> > > > this patch works alone?  If not, do we know for sure that 
> Steve's patches
> > > > are going in during the next merge window?
> > > 
> > > It does not work without the 2 mentioned patches (IRQ's never 
> get handled).
> > 
> > So I suggest that this patch is handed over to Steve to submit with 
his
> > set of patches.
> 
> I've added Steve Glendinning to the Cc.
> 
> I'll drop this from my queue, Steve Sakoman please email this to Steve
> Glendinning for inclusion to his queue.
> 

Yes, David has included all the IRQ patches in net-next-2.6, so they will 
be merged in the next merge window.

Steve
--
Steve Glendinning
SMSC GmbH
m: +44 777 933 9124
e: steve.glendinning@smsc.com

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

======================================================

From: Steve Glendinning <steve.glendinning@smsc.com>

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 <steve.glendinning@smsc.com>
---
 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 <steve.glendinning@smsc.com>

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 <steve.glendinning@smsc.com>
---
 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,