From: Robert Jarzmik <robert.jarzmik@free.fr>
To: David Miller <davem@davemloft.net>
Cc: linus.walleij@linaro.org, nico@fluxnic.net,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Revert "smc91x: retrieve IRQ and trigger flags in a modern way"
Date: Mon, 16 Mar 2015 22:06:13 +0100 [thread overview]
Message-ID: <878uew8xfe.fsf@free.fr> (raw)
In-Reply-To: <20150219.162213.557240575455109795.davem@davemloft.net> (David Miller's message of "Thu, 19 Feb 2015 16:22:13 -0500 (EST)")
David Miller <davem@davemloft.net> writes:
> From: Robert Jarzmik <robert.jarzmik@free.fr>
> Date: Thu, 19 Feb 2015 21:48:49 +0100
>
>> Linus has submitted the patch [1]. I'll be watching carefully until -rc4 that
>> this is applied. If it's not, I'll reping you to apply this revert. Until then,
>> you can forget about it, I'll do the follow-up.
>>
>> Does that plan sound good to you ?
>
> It sounds good to me.
Hi David,
Unfortunately Linus's patch didn't make it upstream. Therefore I'll ask you to
apply the revert, which is reminded in [1].
Cheers.
--
Robert
[1] Patch reminder
---<8---
From: Robert Jarzmik <robert.jarzmik@free.fr>
Subject: [PATCH] Revert "smc91x: retrieve IRQ and trigger flags in a modern way"
To: Nicolas Pitre <nico@fluxnic.net>, "David S. Miller" <davem@davemloft.net>, Linus Walleij <linus.walleij@linaro.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Jarzmik <robert.jarzmik@free.fr>
Date: Thu, 12 Feb 2015 17:59:10 +0100 (4 weeks, 4 days, 4 hours ago)
Message-Id: <1423760350-20149-1-git-send-email-robert.jarzmik@free.fr>
X-Mailer: git-send-email 2.1.0
The commit breaks the legacy platforms, ie. these not using device-tree,
and setting up the interrupt resources with a flag to activate edge
detection. The issue was found on the zylonite platform.
The reason is that zylonite uses platform resources to pass the interrupt number
and the irq flags (here IORESOURCE_IRQ_HIGHEDGE). It expects the driver to
request the irq with these flags, which in turn setups the irq as high edge
triggered.
After the patch, this was supposed to be taken care of with :
irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
But irq_resflags is 0 for legacy platforms, while for example in
arch/arm/mach-pxa/zylonite.c, in struct resource smc91x_resources[] the
irq flag is specified. This breaks zylonite because the interrupt is not
setup as triggered, and hardware doesn't provide interrupts.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/net/ethernet/smsc/smc91x.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 88a55f9..5d77e6f 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2243,10 +2243,9 @@ static int smc_drv_probe(struct platform_device *pdev)
const struct of_device_id *match = NULL;
struct smc_local *lp;
struct net_device *ndev;
- struct resource *res;
+ struct resource *res, *ires;
unsigned int __iomem *addr;
unsigned long irq_flags = SMC_IRQ_FLAGS;
- unsigned long irq_resflags;
int ret;
ndev = alloc_etherdev(sizeof(struct smc_local));
@@ -2338,19 +2337,16 @@ static int smc_drv_probe(struct platform_device *pdev)
goto out_free_netdev;
}
- ndev->irq = platform_get_irq(pdev, 0);
- if (ndev->irq <= 0) {
+ ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+ if (!ires) {
ret = -ENODEV;
goto out_release_io;
}
- /*
- * If this platform does not specify any special irqflags, or if
- * the resource supplies a trigger, override the irqflags with
- * the trigger flags from the resource.
- */
- irq_resflags = irqd_get_trigger_type(irq_get_irq_data(ndev->irq));
- if (irq_flags == -1 || irq_resflags & IRQF_TRIGGER_MASK)
- irq_flags = irq_resflags & IRQF_TRIGGER_MASK;
+
+ ndev->irq = ires->start;
+
+ if (irq_flags == -1 || ires->flags & IRQF_TRIGGER_MASK)
+ irq_flags = ires->flags & IRQF_TRIGGER_MASK;
ret = smc_request_attrib(pdev, ndev);
if (ret)
--
2.1.0
next prev parent reply other threads:[~2015-03-16 21:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-12 16:59 [PATCH] Revert "smc91x: retrieve IRQ and trigger flags in a modern way" Robert Jarzmik
2015-02-13 2:16 ` Linus Walleij
2015-02-13 8:12 ` Robert Jarzmik
2015-02-13 16:06 ` Robert Jarzmik
2015-02-19 20:28 ` David Miller
2015-02-19 20:48 ` Robert Jarzmik
2015-02-19 21:22 ` David Miller
2015-03-16 21:06 ` Robert Jarzmik [this message]
2015-03-17 19:05 ` David Miller
2015-05-04 13:18 ` Linus Walleij
2015-05-04 19:13 ` David Miller
2015-02-20 9:37 ` Linus Walleij
2015-02-20 15:33 ` Greg KH
2015-02-23 15:14 ` Linus Walleij
2015-02-13 16:08 ` Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878uew8xfe.fsf@free.fr \
--to=robert.jarzmik@free.fr \
--cc=davem@davemloft.net \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nico@fluxnic.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).