Skip to content

Commit 870915f

Browse files
mugunthanvnmdavem330
authored andcommitted
drivers: net: cpsw: remove disable_irq/enable_irq as irq can be masked from cpsw itself
CPSW interrupts can be disabled by masking CPSW interrupts and clearing interrupt by writing appropriate EOI. So removing all disable_irq/enable_irq as discussed in [1] [1] http://patchwork.ozlabs.org/patch/492741/ Signed-off-by: Mugunthan V N <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5a9348b commit 870915f

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

drivers/net/ethernet/ti/cpsw.c

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ struct cpsw_priv {
389389
/* snapshot of IRQ numbers */
390390
u32 irqs_table[4];
391391
u32 num_irqs;
392-
bool irq_enabled;
393392
struct cpts *cpts;
394393
u32 emac_port;
395394
};
@@ -767,12 +766,7 @@ static irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id)
767766
struct cpsw_priv *priv = dev_id;
768767

769768
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
770-
771-
cpsw_intr_disable(priv);
772-
if (priv->irq_enabled == true) {
773-
disable_irq_nosync(priv->irqs_table[0]);
774-
priv->irq_enabled = false;
775-
}
769+
writel(0, &priv->wr_regs->rx_en);
776770

777771
if (netif_running(priv->ndev)) {
778772
napi_schedule(&priv->napi);
@@ -797,15 +791,8 @@ static int cpsw_poll(struct napi_struct *napi, int budget)
797791

798792
num_rx = cpdma_chan_process(priv->rxch, budget);
799793
if (num_rx < budget) {
800-
struct cpsw_priv *prim_cpsw;
801-
802794
napi_complete(napi);
803-
cpsw_intr_enable(priv);
804-
prim_cpsw = cpsw_get_slave_priv(priv, 0);
805-
if (prim_cpsw->irq_enabled == false) {
806-
prim_cpsw->irq_enabled = true;
807-
enable_irq(priv->irqs_table[0]);
808-
}
795+
writel(0xff, &priv->wr_regs->rx_en);
809796
}
810797

811798
if (num_rx)
@@ -1230,7 +1217,6 @@ static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
12301217
static int cpsw_ndo_open(struct net_device *ndev)
12311218
{
12321219
struct cpsw_priv *priv = netdev_priv(ndev);
1233-
struct cpsw_priv *prim_cpsw;
12341220
int i, ret;
12351221
u32 reg;
12361222

@@ -1315,14 +1301,6 @@ static int cpsw_ndo_open(struct net_device *ndev)
13151301
cpdma_ctlr_start(priv->dma);
13161302
cpsw_intr_enable(priv);
13171303

1318-
prim_cpsw = cpsw_get_slave_priv(priv, 0);
1319-
if (prim_cpsw->irq_enabled == false) {
1320-
if ((priv == prim_cpsw) || !netif_running(prim_cpsw->ndev)) {
1321-
prim_cpsw->irq_enabled = true;
1322-
enable_irq(prim_cpsw->irqs_table[0]);
1323-
}
1324-
}
1325-
13261304
if (priv->data.dual_emac)
13271305
priv->slaves[priv->emac_port].open_stat = true;
13281306
return 0;
@@ -2169,7 +2147,6 @@ static int cpsw_probe(struct platform_device *pdev)
21692147
priv->msg_enable = netif_msg_init(debug_level, CPSW_DEBUG);
21702148
priv->rx_packet_max = max(rx_packet_max, 128);
21712149
priv->cpts = devm_kzalloc(&pdev->dev, sizeof(struct cpts), GFP_KERNEL);
2172-
priv->irq_enabled = true;
21732150
if (!priv->cpts) {
21742151
dev_err(&pdev->dev, "error allocating cpts\n");
21752152
ret = -ENOMEM;

0 commit comments

Comments
 (0)