Skip to content

Commit

Permalink
Merge branch 'DPAA-Ethernet-fixes'
Browse files Browse the repository at this point in the history
Madalin Bucur says:

====================
DPAA Ethernet fixes

This patch set is addressing several issues in the DPAA Ethernet
driver suite:

 - module unload crash caused by wrong reference to device being left
   in the cleanup code after the DSA related changes
 - scheduling wile atomic bug in QMan code revealed during dpaa_eth
   module unload
 - a couple of error counter fixes, a duplicated init in dpaa_eth.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 14, 2018
2 parents 4dcb31d + 82d141c commit 16c2e4d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,6 @@ static inline int dpaa_xmit(struct dpaa_priv *priv,
}

if (unlikely(err < 0)) {
percpu_stats->tx_errors++;
percpu_stats->tx_fifo_errors++;
return err;
}
Expand Down Expand Up @@ -2278,7 +2277,6 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct qman_portal *portal,
vaddr = phys_to_virt(addr);
prefetch(vaddr + qm_fd_get_offset(fd));

fd_format = qm_fd_get_format(fd);
/* The only FD types that we may receive are contig and S/G */
WARN_ON((fd_format != qm_fd_contig) && (fd_format != qm_fd_sg));

Expand Down Expand Up @@ -2311,8 +2309,10 @@ static enum qman_cb_dqrr_result rx_default_dqrr(struct qman_portal *portal,

skb_len = skb->len;

if (unlikely(netif_receive_skb(skb) == NET_RX_DROP))
if (unlikely(netif_receive_skb(skb) == NET_RX_DROP)) {
percpu_stats->rx_dropped++;
return qman_cb_dqrr_consume;
}

percpu_stats->rx_packets++;
percpu_stats->rx_bytes += skb_len;
Expand Down Expand Up @@ -2860,7 +2860,7 @@ static int dpaa_remove(struct platform_device *pdev)
struct device *dev;
int err;

dev = &pdev->dev;
dev = pdev->dev.parent;
net_dev = dev_get_drvdata(dev);

priv = netdev_priv(net_dev);
Expand Down
28 changes: 5 additions & 23 deletions drivers/soc/fsl/qbman/qman.c
Original file line number Diff line number Diff line change
Expand Up @@ -2443,39 +2443,21 @@ struct cgr_comp {
struct completion completion;
};

static int qman_delete_cgr_thread(void *p)
static void qman_delete_cgr_smp_call(void *p)
{
struct cgr_comp *cgr_comp = (struct cgr_comp *)p;
int ret;

ret = qman_delete_cgr(cgr_comp->cgr);
complete(&cgr_comp->completion);

return ret;
qman_delete_cgr((struct qman_cgr *)p);
}

void qman_delete_cgr_safe(struct qman_cgr *cgr)
{
struct task_struct *thread;
struct cgr_comp cgr_comp;

preempt_disable();
if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id()) {
init_completion(&cgr_comp.completion);
cgr_comp.cgr = cgr;
thread = kthread_create(qman_delete_cgr_thread, &cgr_comp,
"cgr_del");

if (IS_ERR(thread))
goto out;

kthread_bind(thread, qman_cgr_cpus[cgr->cgrid]);
wake_up_process(thread);
wait_for_completion(&cgr_comp.completion);
smp_call_function_single(qman_cgr_cpus[cgr->cgrid],
qman_delete_cgr_smp_call, cgr, true);
preempt_enable();
return;
}
out:

qman_delete_cgr(cgr);
preempt_enable();
}
Expand Down

0 comments on commit 16c2e4d

Please sign in to comment.