diff mbox

sh_eth: re-enable-E-MAC interrupts in sh_eth_set_ringparam()

Message ID 2542968.R3YjY2kHV4@wasted.cogentembedded.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Sergei Shtylyov April 9, 2016, 11:28 p.m. UTC
The E-MAC interrupts are left disabled when the ring parameters are changed
via 'ethtool'. In order to fix this, it's enough to call sh_eth_dev_init()
with 'true' instead of 'false' for the second argument (which conveniently
allows us to remove the following code re-enabling E-DMAC interrupts and
reception).

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

---
The patch is against DaveM's 'net.git' repo.

 drivers/net/ethernet/renesas/sh_eth.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

David Miller April 10, 2016, 1:27 a.m. UTC | #1
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sun, 10 Apr 2016 02:28:41 +0300

> The E-MAC interrupts are left disabled when the ring parameters are changed
> via 'ethtool'. In order to fix this, it's enough to call sh_eth_dev_init()
> with 'true' instead of 'false' for the second argument (which conveniently
> allows us to remove the following code re-enabling E-DMAC interrupts and
> reception).
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied, thanks.
Sergei Shtylyov April 11, 2016, 5:10 p.m. UTC | #2
Hello.

On 04/10/2016 04:27 AM, David Miller wrote:

>> The E-MAC interrupts are left disabled when the ring parameters are changed
>> via 'ethtool'. In order to fix this, it's enough to call sh_eth_dev_init()
>> with 'true' instead of 'false' for the second argument (which conveniently
>> allows us to remove the following code re-enabling E-DMAC interrupts and
>> reception).
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> Applied, thanks.

    Thanks!
    Unfortunately, this patch isn't fit for the stable kernels because there's 
a prerequisite cleanup (most recent patch merged to this driver). I clearly 
hadn't thought this out well -- should have enabled the E-MAC interrupts 
outside sh_eth_dev_init() and then removed the duplicate code like I did here.

MBR, Sergei
diff mbox

Patch

Index: net/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net/drivers/net/ethernet/renesas/sh_eth.c
@@ -2194,17 +2194,13 @@  static int sh_eth_set_ringparam(struct n
 				   __func__);
 			return ret;
 		}
-		ret = sh_eth_dev_init(ndev, false);
+		ret = sh_eth_dev_init(ndev, true);
 		if (ret < 0) {
 			netdev_err(ndev, "%s: sh_eth_dev_init failed.\n",
 				   __func__);
 			return ret;
 		}
 
-		mdp->irq_enabled = true;
-		sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR);
-		/* Setting the Rx mode will start the Rx process. */
-		sh_eth_write(ndev, EDRRR_R, EDRRR);
 		netif_device_attach(ndev);
 	}