netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] phy: IRQ cannot be shared
  2013-12-20 19:09 [PATCH] phy: IRQ cannot be shared Sergei Shtylyov
@ 2013-12-20 18:24 ` Florian Fainelli
  2013-12-27 18:43   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2013-12-20 18:24 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: netdev

2013/12/20 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
> With the way PHY IRQ handler is implemented (all real handling being pushed to
> the workqueue and returning IRQ_HANDLED all the time PHY is active), we cannot
> really claim that PHY IRQ can be shared when calling request_irq().

Looks good, in the future we might want to be able to let the Ethernet
MAC driver specify the flags to pass down to request_irq() but this is
good enough for me for the time being.

>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

>
> ---
> The patch is against DaveM's 'net.git' repo.
> I recommend pushing it to the stable kernels as well.
>
>  drivers/net/phy/phy.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> Index: net/drivers/net/phy/phy.c
> ===================================================================
> --- net.orig/drivers/net/phy/phy.c
> +++ net/drivers/net/phy/phy.c
> @@ -565,10 +565,8 @@ int phy_start_interrupts(struct phy_devi
>         int err = 0;
>
>         atomic_set(&phydev->irq_disable, 0);
> -       if (request_irq(phydev->irq, phy_interrupt,
> -                               IRQF_SHARED,
> -                               "phy_interrupt",
> -                               phydev) < 0) {
> +       if (request_irq(phydev->irq, phy_interrupt, 0, "phy_interrupt",
> +                       phydev) < 0) {
>                 pr_warn("%s: Can't get IRQ %d (PHY)\n",
>                         phydev->bus->name, phydev->irq);
>                 phydev->irq = PHY_POLL;
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Florian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] phy: IRQ cannot be shared
@ 2013-12-20 19:09 Sergei Shtylyov
  2013-12-20 18:24 ` Florian Fainelli
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2013-12-20 19:09 UTC (permalink / raw)
  To: netdev

With the way PHY IRQ handler is implemented (all real handling being pushed to
the workqueue and returning IRQ_HANDLED all the time PHY is active), we cannot
really claim that PHY IRQ can be shared when calling request_irq().  

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against DaveM's 'net.git' repo.
I recommend pushing it to the stable kernels as well.

 drivers/net/phy/phy.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: net/drivers/net/phy/phy.c
===================================================================
--- net.orig/drivers/net/phy/phy.c
+++ net/drivers/net/phy/phy.c
@@ -565,10 +565,8 @@ int phy_start_interrupts(struct phy_devi
 	int err = 0;
 
 	atomic_set(&phydev->irq_disable, 0);
-	if (request_irq(phydev->irq, phy_interrupt,
-				IRQF_SHARED,
-				"phy_interrupt",
-				phydev) < 0) {
+	if (request_irq(phydev->irq, phy_interrupt, 0, "phy_interrupt",
+			phydev) < 0) {
 		pr_warn("%s: Can't get IRQ %d (PHY)\n",
 			phydev->bus->name, phydev->irq);
 		phydev->irq = PHY_POLL;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: IRQ cannot be shared
  2013-12-20 18:24 ` Florian Fainelli
@ 2013-12-27 18:43   ` David Miller
  2013-12-27 19:53     ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2013-12-27 18:43 UTC (permalink / raw)
  To: f.fainelli; +Cc: sergei.shtylyov, netdev

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 20 Dec 2013 10:24:05 -0800

> 2013/12/20 Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:
>> With the way PHY IRQ handler is implemented (all real handling being pushed to
>> the workqueue and returning IRQ_HANDLED all the time PHY is active), we cannot
>> really claim that PHY IRQ can be shared when calling request_irq().
> 
> Looks good, in the future we might want to be able to let the Ethernet
> MAC driver specify the flags to pass down to request_irq() but this is
> good enough for me for the time being.
> 
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>

I really worry that putting this new restriction in place is going to
break a bunch of drivers.

Arguably they are broken, but they are least mostly working right now
and probes will completely fail after this change.

Feel free to allay my concerns, but tossing this into 'net' and
-stable with such a possible risk really concerns me.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: IRQ cannot be shared
  2013-12-27 18:43   ` David Miller
@ 2013-12-27 19:53     ` Sergei Shtylyov
  2013-12-30  3:35       ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2013-12-27 19:53 UTC (permalink / raw)
  To: David Miller, f.fainelli; +Cc: netdev

On 12/27/2013 09:43 PM, David Miller wrote:

>>> With the way PHY IRQ handler is implemented (all real handling being pushed to
>>> the workqueue and returning IRQ_HANDLED all the time PHY is active), we cannot
>>> really claim that PHY IRQ can be shared when calling request_irq().

>> Looks good, in the future we might want to be able to let the Ethernet
>> MAC driver specify the flags to pass down to request_irq()

    I don't think this is such a good idea now since the way to pass those 
flags would be quite clumsy (like it is for IRQs, via array of 32 entries).
I'd prefer irq_set_irq_type() if there'd be no objections.

>> but this is
>> good enough for me for the time being.

>>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

>> Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> I really worry that putting this new restriction in place is going to
> break a bunch of drivers.

> Arguably they are broken,

    Yes, they already are.

> but they are least mostly working right now
> and probes will completely fail after this change.

    I don't see how the probes will fail. Have you seen the surrounding code? 
It should just switch to PHY polling if request_irq() fails and return 0. Am I 
missing something?

> Feel free to allay my concerns, but tossing this into 'net' and
> -stable with such a possible risk really concerns me.

    Up to you, of course.

WBR, Sergei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] phy: IRQ cannot be shared
  2013-12-27 19:53     ` Sergei Shtylyov
@ 2013-12-30  3:35       ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-12-30  3:35 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: f.fainelli, netdev

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Fri, 27 Dec 2013 22:53:40 +0300

>> Arguably they are broken,
> 
>    Yes, they already are.
> 
>> but they are least mostly working right now
>> and probes will completely fail after this change.
> 
>    I don't see how the probes will fail. Have you seen the surrounding
>    code? It should just switch to PHY polling if request_irq() fails and
>    return 0. Am I missing something?

Indeed, right you are.

Applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-30  3:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 19:09 [PATCH] phy: IRQ cannot be shared Sergei Shtylyov
2013-12-20 18:24 ` Florian Fainelli
2013-12-27 18:43   ` David Miller
2013-12-27 19:53     ` Sergei Shtylyov
2013-12-30  3:35       ` David Miller

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).