From: Petri Gynther <pgynther@google.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, f.fainelli@gmail.com, opendmb@gmail.com,
jaedon.shin@gmail.com, Petri Gynther <pgynther@google.com>
Subject: [PATCH net-next v2 3/3] net: bcmgenet: cleanup for dmadesc_set()
Date: Tue, 5 Apr 2016 13:05:11 -0700 [thread overview]
Message-ID: <1459886711-72949-3-git-send-email-pgynther@google.com> (raw)
In-Reply-To: <1459886711-72949-1-git-send-email-pgynther@google.com>
dmadesc_set() is used for setting the Tx buffer DMA address, length,
and status bits on a Tx ring descriptor when a frame is being Tx'ed.
Always set the Tx buffer DMA address first, before updating the length
and status bits, i.e. giving the Tx descriptor to the hardware.
The reason this is a cleanup rather than a fix is that the hardware
won't transmit anything from a Tx ring until the TDMA producer index
has been incremented. As long as the dmadesc_set() writes complete
before the TDMA producer index write, life is good.
Signed-off-by: Petri Gynther <pgynther@google.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index d77cd6d..f7b42b9 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -104,8 +104,8 @@ static inline void dmadesc_set_addr(struct bcmgenet_priv *priv,
static inline void dmadesc_set(struct bcmgenet_priv *priv,
void __iomem *d, dma_addr_t addr, u32 val)
{
- dmadesc_set_length_status(priv, d, val);
dmadesc_set_addr(priv, d, addr);
+ dmadesc_set_length_status(priv, d, val);
}
static inline dma_addr_t dmadesc_get_addr(struct bcmgenet_priv *priv,
--
2.8.0.rc3.226.g39d4020
next prev parent reply other threads:[~2016-04-05 20:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-05 20:05 [PATCH net-next v2 1/3] net: bcmgenet: cleanup for bcmgenet_xmit() Petri Gynther
2016-04-05 20:05 ` [PATCH net-next v2 2/3] net: bcmgenet: cleanup for bcmgenet_xmit_frag() Petri Gynther
2016-04-05 20:05 ` Petri Gynther [this message]
2016-04-05 20:10 ` [PATCH net-next v2 1/3] net: bcmgenet: cleanup for bcmgenet_xmit() 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=1459886711-72949-3-git-send-email-pgynther@google.com \
--to=pgynther@google.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jaedon.shin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox