Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369760
b: refs/heads/master
c: a11fbba
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Siewior authored and David S. Miller committed Apr 25, 2013
1 parent 548745c commit 6614afd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e6ceaedb5901c7ebd23e5222726dab5362938bd
refs/heads/master: a11fbba9a7d338c4a4e4be624af0334bbf2c9a5a
25 changes: 22 additions & 3 deletions trunk/drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ struct cpsw_priv {
/* snapshot of IRQ numbers */
u32 irqs_table[4];
u32 num_irqs;
bool irq_enabled;
struct cpts *cpts;
u32 emac_port;
};
Expand Down Expand Up @@ -515,7 +516,10 @@ static irqreturn_t cpsw_interrupt(int irq, void *dev_id)
return IRQ_NONE;

cpsw_intr_disable(priv);
cpsw_disable_irq(priv);
if (priv->irq_enabled == true) {
cpsw_disable_irq(priv);
priv->irq_enabled = false;
}

if (netif_running(priv->ndev)) {
napi_schedule(&priv->napi);
Expand Down Expand Up @@ -544,10 +548,16 @@ static int cpsw_poll(struct napi_struct *napi, int budget)

num_rx = cpdma_chan_process(priv->rxch, budget);
if (num_rx < budget) {
struct cpsw_priv *prim_cpsw;

napi_complete(napi);
cpsw_intr_enable(priv);
cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX);
cpsw_enable_irq(priv);
prim_cpsw = cpsw_get_slave_priv(priv, 0);
if (prim_cpsw->irq_enabled == false) {
cpsw_enable_irq(priv);
prim_cpsw->irq_enabled = true;
}
}

if (num_rx || num_tx)
Expand Down Expand Up @@ -886,6 +896,7 @@ static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
static int cpsw_ndo_open(struct net_device *ndev)
{
struct cpsw_priv *priv = netdev_priv(ndev);
struct cpsw_priv *prim_cpsw;
int i, ret;
u32 reg;

Expand Down Expand Up @@ -953,6 +964,14 @@ static int cpsw_ndo_open(struct net_device *ndev)
cpsw_set_coalesce(ndev, &coal);
}

prim_cpsw = cpsw_get_slave_priv(priv, 0);
if (prim_cpsw->irq_enabled == false) {
if ((priv == prim_cpsw) || !netif_running(prim_cpsw->ndev)) {
prim_cpsw->irq_enabled = true;
cpsw_enable_irq(prim_cpsw);
}
}

cpdma_ctlr_start(priv->dma);
cpsw_intr_enable(priv);
napi_enable(&priv->napi);
Expand Down Expand Up @@ -1614,7 +1633,7 @@ static int cpsw_probe_dual_emac(struct platform_device *pdev,
priv_sl2->irqs_table[i] = priv->irqs_table[i];
priv_sl2->num_irqs = priv->num_irqs;
}

priv->irq_enabled = true;
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;

ndev->netdev_ops = &cpsw_netdev_ops;
Expand Down

0 comments on commit 6614afd

Please sign in to comment.