sh_eth: handle only enabled E-MAC interrupts
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Wed, 4 Jan 2017 12:10:21 +0000 (15:10 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jan 2017 18:47:54 +0000 (13:47 -0500)
The driver should only handle the enabled E-MAC interrupts, like it does
for the E-DMAC interrupts since commit 3893b27345ac ("sh_eth: workaround
for spurious ECI interrupt"),  so mask ECSR with  ECSIPR when reading it
in sh_eth_error().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c

index f341c1bc7001678326985746bd0ce65d1572994a..c89569509a473badf335fe563699543d3282aad1 100644 (file)
@@ -1535,7 +1535,8 @@ static void sh_eth_error(struct net_device *ndev, u32 intr_status)
        u32 mask;
 
        if (intr_status & EESR_ECI) {
-               felic_stat = sh_eth_read(ndev, ECSR);
+               felic_stat = sh_eth_read(ndev, ECSR) &
+                            sh_eth_read(ndev, ECSIPR);
                sh_eth_write(ndev, felic_stat, ECSR);   /* clear int */
                if (felic_stat & ECSR_ICD)
                        ndev->stats.tx_carrier_errors++;