From: <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> To: <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>, <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> Cc: nbd-p3rKhJxN3npAfugRpC6u6w@public.gmane.org, keyhaede-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, objelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Subject: [PATCH net v4 1/9] net: ethernet: mediatek: fix fails from TX housekeeping due to incorrect port setup Date: Thu, 1 Sep 2016 10:47:27 +0800 [thread overview] Message-ID: <1472698055-8821-2-git-send-email-sean.wang@mediatek.com> (raw) In-Reply-To: <1472698055-8821-1-git-send-email-sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> which net device the SKB is complete for depends on the forward port on txd4 on the corresponding TX descriptor, but the information isn't set up well in case of SKB fragments that would lead to watchdog timeout from the upper layer, so fix it up. Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> Acked-by: John Crispin <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org> --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index f160954..7fc2ff0 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -588,14 +588,15 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, dma_addr_t mapped_addr; unsigned int nr_frags; int i, n_desc = 1; - u32 txd4 = 0; + u32 txd4 = 0, fport; itxd = ring->next_free; if (itxd == ring->last_free) return -ENOMEM; /* set the forward port */ - txd4 |= (mac->id + 1) << TX_DMA_FPORT_SHIFT; + fport = (mac->id + 1) << TX_DMA_FPORT_SHIFT; + txd4 |= fport; tx_buf = mtk_desc_to_tx_buf(ring, itxd); memset(tx_buf, 0, sizeof(*tx_buf)); @@ -653,7 +654,7 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, WRITE_ONCE(txd->txd3, (TX_DMA_SWC | TX_DMA_PLEN0(frag_map_size) | last_frag * TX_DMA_LS0)); - WRITE_ONCE(txd->txd4, 0); + WRITE_ONCE(txd->txd4, fport); tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC; tx_buf = mtk_desc_to_tx_buf(ring, txd); -- 1.9.1
WARNING: multiple messages have this Message-ID (diff)
From: <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> To: john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org Cc: nbd-p3rKhJxN3npAfugRpC6u6w@public.gmane.org, keyhaede-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, objelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Subject: [PATCH net v4 1/9] net: ethernet: mediatek: fix fails from TX housekeeping due to incorrect port setup Date: Thu, 1 Sep 2016 10:47:27 +0800 [thread overview] Message-ID: <1472698055-8821-2-git-send-email-sean.wang@mediatek.com> (raw) In-Reply-To: <1472698055-8821-1-git-send-email-sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> From: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> which net device the SKB is complete for depends on the forward port on txd4 on the corresponding TX descriptor, but the information isn't set up well in case of SKB fragments that would lead to watchdog timeout from the upper layer, so fix it up. Signed-off-by: Sean Wang <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> Acked-by: John Crispin <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org> --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index f160954..7fc2ff0 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -588,14 +588,15 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, dma_addr_t mapped_addr; unsigned int nr_frags; int i, n_desc = 1; - u32 txd4 = 0; + u32 txd4 = 0, fport; itxd = ring->next_free; if (itxd == ring->last_free) return -ENOMEM; /* set the forward port */ - txd4 |= (mac->id + 1) << TX_DMA_FPORT_SHIFT; + fport = (mac->id + 1) << TX_DMA_FPORT_SHIFT; + txd4 |= fport; tx_buf = mtk_desc_to_tx_buf(ring, itxd); memset(tx_buf, 0, sizeof(*tx_buf)); @@ -653,7 +654,7 @@ static int mtk_tx_map(struct sk_buff *skb, struct net_device *dev, WRITE_ONCE(txd->txd3, (TX_DMA_SWC | TX_DMA_PLEN0(frag_map_size) | last_frag * TX_DMA_LS0)); - WRITE_ONCE(txd->txd4, 0); + WRITE_ONCE(txd->txd4, fport); tx_buf->skb = (struct sk_buff *)MTK_DMA_DUMMY_DESC; tx_buf = mtk_desc_to_tx_buf(ring, txd); -- 1.9.1
next prev parent reply other threads:[~2016-09-01 2:47 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-09-01 2:47 [PATCH net v4 0/9] net: ethernet: mediatek: a couple of fixes sean.wang 2016-09-01 2:47 ` sean.wang [not found] ` <1472698055-8821-1-git-send-email-sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w [this message] 2016-09-01 2:47 ` [PATCH net v4 1/9] net: ethernet: mediatek: fix fails from TX housekeeping due to incorrect port setup sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 2/9] net: ethernet: mediatek: fix incorrect return value of devm_clk_get with EPROBE_DEFER sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 3/9] net: ethernet: mediatek: fix API usage with skb_free_frag sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 4/9] net: ethernet: mediatek: remove redundant free_irq for devm_request_irq allocated irq sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 5/9] net: ethernet: mediatek: fix logic unbalance between probe and remove sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 6/9] net: ethernet: mediatek: fix issue of driver removal with interface is up sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 7/9] net: ethernet: mediatek: fix the missing of_node_put() after node is used done inside mtk_mdio_init sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 9/9] net: ethernet: mediatek: fix error handling " sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` sean.wang-NuS5LvNUpcJWk0Htik3J/w 2016-09-01 2:47 ` [PATCH net v4 8/9] net: ethernet: mediatek: use devm_mdiobus_alloc instead of mdiobus_alloc " sean.wang 2016-09-01 2:47 ` sean.wang 2016-09-01 3:55 ` [PATCH net v4 0/9] net: ethernet: mediatek: a couple of fixes David Miller
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1472698055-8821-2-git-send-email-sean.wang@mediatek.com \ --to=sean.wang-nus5lvnupcjwk0htik3j/w@public.gmane.org \ --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \ --cc=john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org \ --cc=keyhaede-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \ --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \ --cc=nbd-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \ --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \ --cc=objelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.