diff options
author | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2019-06-15 13:01:32 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-16 23:03:25 +0200 |
commit | 871e846585919adf727f21398f433fd424b6f0e1 (patch) | |
tree | 19da3891f6595a817ddb9f1c8895a1f71aa83ec7 /drivers/net/ethernet/ti/cpsw.c | |
parent | Merge branch 'stmmac-cleanups-for-stmmac_mdio_reset' (diff) | |
download | linux-871e846585919adf727f21398f433fd424b6f0e1.tar.xz linux-871e846585919adf727f21398f433fd424b6f0e1.zip |
net: ethernet: ti: davinci_cpdma: use idled submit
While data pass suspend, reuse of rx descriptors can be disabled using
channel state & lock from cpdma layer. For this, submit to a channel
has to be disabled using state != "not active" under lock, what is done
with this patch. The same submit is used to fill rx channel while
ndo_open, when channel is idled, so add idled submit routine that
allows to prepare descs for the channel. All this simplifies code and
helps to avoid dormant mode usage and send packets only to active
channels, avoiding potential race in later on changes. Also add missed
sync barrier analogically like in other places after stopping tx
queues.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw.c')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 3430503e1053..7bdd287074fc 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -457,16 +457,13 @@ static void cpsw_rx_handler(void *token, int len, int status) } requeue: - if (netif_dormant(ndev)) { - dev_kfree_skb_any(new_skb); - return; - } - ch = cpsw->rxv[skb_get_queue_mapping(new_skb)].ch; ret = cpdma_chan_submit(ch, new_skb, new_skb->data, skb_tailroom(new_skb), 0); - if (WARN_ON(ret < 0)) + if (ret < 0) { + WARN_ON(ret == -ENOMEM); dev_kfree_skb_any(new_skb); + } } void cpsw_split_res(struct cpsw_common *cpsw) @@ -1051,9 +1048,9 @@ int cpsw_fill_rx_channels(struct cpsw_priv *priv) } skb_set_queue_mapping(skb, ch); - ret = cpdma_chan_submit(cpsw->rxv[ch].ch, skb, - skb->data, skb_tailroom(skb), - 0); + ret = cpdma_chan_idle_submit(cpsw->rxv[ch].ch, skb, + skb->data, + skb_tailroom(skb), 0); if (ret < 0) { cpsw_err(priv, ifup, "cannot submit skb to channel %d rx, error %d\n", |