All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ravb: Add missing free_irq() calls to ravb_close()
@ 2016-05-07 11:17 Geert Uytterhoeven
  2016-05-07 11:17 ` [PATCH v2 1/2 -net] ravb: Add missing free_irq() call " Geert Uytterhoeven
  2016-05-07 11:17 ` [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls " Geert Uytterhoeven
  0 siblings, 2 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-05-07 11:17 UTC (permalink / raw)
  To: David S. Miller, Sergei Shtylyov
  Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc,
	Geert Uytterhoeven

	Hi Dave,

When reopening the network device on ra7795/salvator-x, e.g. after a
DHCP timeout:

    IP-Config: Reopening network devices...
    genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (
    ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
    IP-Config: Failed to open eth0
    IP-Config: No network devices available

The "mismatch" is due to requesting an IRQ that is already in use,
while IRQF_PROBE_SHARED wasn't set.

However, the real cause is that ravb_close() doesn't release any of the
R-Car Gen3-specific secondary IRQs. Hence the following two patches add
the missing free_irq() calls to fix this.

As the code has been changed in net-next.git to support more interrupts,
and these weren't freed neither, I'm sending two patches:
  1. The first patch applies to net.git,
  2. The second patch applies to net-next.git.

If you prefer the second patch to be replaced by a version that applies
to net-next.git after you will have applied the first patch to net.git,
and merged net.git into net-next.git, just let me know.

Chances compared to the previous version:
  - Add version against net.git,
  - Clearly state which version the second patch is against,
  - Add Fixes tags.

Thanks!

Geert Uytterhoeven (1):
  ravb: Add missing free_irq() call to ravb_close()
  ravb: Add missing free_irq() calls to ravb_close()

 drivers/net/ethernet/renesas/ravb_main.c       | 9 +++++++
 1 files changed, 9 insertions(+)

-- 
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH v2 1/2 -net] ravb: Add missing free_irq() call to ravb_close()
  2016-05-07 11:17 [PATCH v2 0/2] ravb: Add missing free_irq() calls to ravb_close() Geert Uytterhoeven
@ 2016-05-07 11:17 ` Geert Uytterhoeven
  2016-05-07 18:39   ` Sergei Shtylyov
  2016-05-07 11:17 ` [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls " Geert Uytterhoeven
  1 sibling, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-05-07 11:17 UTC (permalink / raw)
  To: David S. Miller, Sergei Shtylyov
  Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc,
	Geert Uytterhoeven

When reopening the network device on ra7795/salvator-x, e.g. after a
DHCP timeout:

    IP-Config: Reopening network devices...
    genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (eth0:ch24:emac)
    ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
    IP-Config: Failed to open eth0
    IP-Config: No network devices available

The "mismatch" is due to requesting an IRQ that is already in use,
while IRQF_PROBE_SHARED wasn't set.

However, the real cause is that ravb_close() doesn't release the R-Car
Gen3-specific secondary IRQ.

Add the missing free_irq() call to fix this.

Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This version is against net.git.

v2:
  - New.
---
 drivers/net/ethernet/renesas/ravb_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 9e2a0bd8f5a88803..4277d0c12101fef7 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1506,6 +1506,8 @@ static int ravb_close(struct net_device *ndev)
 		priv->phydev = NULL;
 	}
 
+	if (priv->chip_id == RCAR_GEN3)
+		free_irq(priv->emac_irq, ndev);
 	free_irq(ndev->irq, ndev);
 
 	napi_disable(&priv->napi[RAVB_NC]);
-- 
1.9.1

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

* [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls to ravb_close()
  2016-05-07 11:17 [PATCH v2 0/2] ravb: Add missing free_irq() calls to ravb_close() Geert Uytterhoeven
  2016-05-07 11:17 ` [PATCH v2 1/2 -net] ravb: Add missing free_irq() call " Geert Uytterhoeven
@ 2016-05-07 11:17 ` Geert Uytterhoeven
  2016-05-07 18:45   ` Sergei Shtylyov
  1 sibling, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-05-07 11:17 UTC (permalink / raw)
  To: David S. Miller, Sergei Shtylyov
  Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc,
	Geert Uytterhoeven

When reopening the network device on ra7795/salvator-x, e.g. after a
DHCP timeout:

    IP-Config: Reopening network devices...
    genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (
    ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
    IP-Config: Failed to open eth0
    IP-Config: No network devices available

The "mismatch" is due to requesting an IRQ that is already in use,
while IRQF_PROBE_SHARED wasn't set.

However, the real cause is that ravb_close() doesn't release any of the
R-Car Gen3-specific secondary IRQs.

Add the missing free_irq() calls to fix this.

Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
Fixes: f51bdc236b6c5835 ("ravb: Add dma queue interrupt support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This version is against net-next.git.

v2:
  - Clearly state which version this patch is against,
  - Add Fixes tags.
---
 drivers/net/ethernet/renesas/ravb_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 34066e0649f5c673..867caf6e7a5a65ad 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1667,6 +1667,13 @@ static int ravb_close(struct net_device *ndev)
 		priv->phydev = NULL;
 	}
 
+	if (priv->chip_id != RCAR_GEN2) {
+		free_irq(priv->tx_irqs[RAVB_NC], ndev);
+		free_irq(priv->rx_irqs[RAVB_NC], ndev);
+		free_irq(priv->tx_irqs[RAVB_BE], ndev);
+		free_irq(priv->rx_irqs[RAVB_BE], ndev);
+		free_irq(priv->emac_irq, ndev);
+	}
 	free_irq(ndev->irq, ndev);
 
 	napi_disable(&priv->napi[RAVB_NC]);
-- 
1.9.1

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

* Re: [PATCH v2 1/2 -net] ravb: Add missing free_irq() call to ravb_close()
  2016-05-07 11:17 ` [PATCH v2 1/2 -net] ravb: Add missing free_irq() call " Geert Uytterhoeven
@ 2016-05-07 18:39   ` Sergei Shtylyov
  2016-05-07 19:42       ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Sergei Shtylyov @ 2016-05-07 18:39 UTC (permalink / raw)
  To: Geert Uytterhoeven, David S. Miller
  Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc

Hello.

On 05/07/2016 02:17 PM, Geert Uytterhoeven wrote:

> When reopening the network device on ra7795/salvator-x, e.g. after a
> DHCP timeout:
>
>      IP-Config: Reopening network devices...
>      genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (eth0:ch24:emac)
>      ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac

    Er, this can't be a message from the kernel built from net.git. That 
driver used 'ndev->name'
to request both IRQs...

>      IP-Config: Failed to open eth0
>      IP-Config: No network devices available
>
> The "mismatch" is due to requesting an IRQ that is already in use,
> while IRQF_PROBE_SHARED wasn't set.
>
> However, the real cause is that ravb_close() doesn't release the R-Car
> Gen3-specific secondary IRQ.
>
> Add the missing free_irq() call to fix this.
>
> Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

MBR, Sergei

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

* Re: [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls to ravb_close()
  2016-05-07 11:17 ` [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls " Geert Uytterhoeven
@ 2016-05-07 18:45   ` Sergei Shtylyov
  0 siblings, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2016-05-07 18:45 UTC (permalink / raw)
  To: Geert Uytterhoeven, David S. Miller
  Cc: Yoshihiro Kaneko, Simon Horman, netdev, linux-renesas-soc

Hello.

On 05/07/2016 02:17 PM, Geert Uytterhoeven wrote:

> When reopening the network device on ra7795/salvator-x, e.g. after a
> DHCP timeout:
>
>      IP-Config: Reopening network devices...
>      genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs. 00000000 (

    Unwrapped line this time? :-)

>      ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
>      IP-Config: Failed to open eth0
>      IP-Config: No network devices available
>
> The "mismatch" is due to requesting an IRQ that is already in use,
> while IRQF_PROBE_SHARED wasn't set.
>
> However, the real cause is that ravb_close() doesn't release any of the
> R-Car Gen3-specific secondary IRQs.
>
> Add the missing free_irq() calls to fix this.
>
> Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
> Fixes: f51bdc236b6c5835 ("ravb: Add dma queue interrupt support")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

MBR, Sergei

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

* Re: [PATCH v2 1/2 -net] ravb: Add missing free_irq() call to ravb_close()
  2016-05-07 18:39   ` Sergei Shtylyov
@ 2016-05-07 19:42       ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-05-07 19:42 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Geert Uytterhoeven, David S. Miller, Yoshihiro Kaneko,
	Simon Horman, netdev, linux-renesas-soc

On Sat, May 7, 2016 at 8:39 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 05/07/2016 02:17 PM, Geert Uytterhoeven wrote:
>
>> When reopening the network device on ra7795/salvator-x, e.g. after a
>> DHCP timeout:
>>
>>      IP-Config: Reopening network devices...
>>      genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs.
>> 00000000 (eth0:ch24:emac)
>>      ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
>
>    Er, this can't be a message from the kernel built from net.git. That
> driver used 'ndev->name'
> to request both IRQs...

Oops, I copied the error message from the second patch.
I don't think it matters that much, though...

>>      IP-Config: Failed to open eth0
>>      IP-Config: No network devices available
>>
>> The "mismatch" is due to requesting an IRQ that is already in use,
>> while IRQF_PROBE_SHARED wasn't set.
>>
>> However, the real cause is that ravb_close() doesn't release the R-Car
>> Gen3-specific secondary IRQ.
>>
>> Add the missing free_irq() call to fix this.
>>
>> Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Thanks!

Gr{oetje,eeting}s,

                        Geert

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

* Re: [PATCH v2 1/2 -net] ravb: Add missing free_irq() call to ravb_close()
@ 2016-05-07 19:42       ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2016-05-07 19:42 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Geert Uytterhoeven, David S. Miller, Yoshihiro Kaneko,
	Simon Horman, netdev, linux-renesas-soc

On Sat, May 7, 2016 at 8:39 PM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 05/07/2016 02:17 PM, Geert Uytterhoeven wrote:
>
>> When reopening the network device on ra7795/salvator-x, e.g. after a
>> DHCP timeout:
>>
>>      IP-Config: Reopening network devices...
>>      genirq: Flags mismatch irq 139. 00000000 (eth0:ch24:emac) vs.
>> 00000000 (eth0:ch24:emac)
>>      ravb e6800000.ethernet eth0: cannot request IRQ eth0:ch24:emac
>
>    Er, this can't be a message from the kernel built from net.git. That
> driver used 'ndev->name'
> to request both IRQs...

Oops, I copied the error message from the second patch.
I don't think it matters that much, though...

>>      IP-Config: Failed to open eth0
>>      IP-Config: No network devices available
>>
>> The "mismatch" is due to requesting an IRQ that is already in use,
>> while IRQF_PROBE_SHARED wasn't set.
>>
>> However, the real cause is that ravb_close() doesn't release the R-Car
>> Gen3-specific secondary IRQ.
>>
>> Add the missing free_irq() call to fix this.
>>
>> Fixes: 22d4df8ff3a3cc72 ("ravb: Add support for r8a7795 SoC")
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2016-05-07 19:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-07 11:17 [PATCH v2 0/2] ravb: Add missing free_irq() calls to ravb_close() Geert Uytterhoeven
2016-05-07 11:17 ` [PATCH v2 1/2 -net] ravb: Add missing free_irq() call " Geert Uytterhoeven
2016-05-07 18:39   ` Sergei Shtylyov
2016-05-07 19:42     ` Geert Uytterhoeven
2016-05-07 19:42       ` Geert Uytterhoeven
2016-05-07 11:17 ` [PATCH v2 2/2 -net-next] ravb: Add missing free_irq() calls " Geert Uytterhoeven
2016-05-07 18:45   ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.