summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlexandre TORGUE <alexandre.torgue@st.com>2016-04-08 11:18:03 +0200
committerDavid S. Miller <davem@davemloft.net>2016-04-13 22:35:17 -0400
commit18b46810eb61f1d1a66c5511d12e84ea8cb7f35c (patch)
tree9118e219d45137a2ea07a32f4476f0d3d8fca25b /drivers
parentfbf405e80c8af9ba0a9eb6f52d3bb8cddacd6036 (diff)
downloadlinux-rpi-18b46810eb61f1d1a66c5511d12e84ea8cb7f35c.tar.gz
linux-rpi-18b46810eb61f1d1a66c5511d12e84ea8cb7f35c.tar.bz2
linux-rpi-18b46810eb61f1d1a66c5511d12e84ea8cb7f35c.zip
net: ethernet: stmmac: GMAC4.xx: Fix TX descriptor preparation
On GMAC4.xx each descriptor contains 2 buffers of 16KB (each). Initially, those 2 buffers was filled in dwmac4_rd_prepare_tx_desc but it is actually not needed. Indeed, stmmac driver supports frame up to 9000 bytes (jumbo). So only one buffer is needed. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
index d4952c7a836d..4ec7397e7fb3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
@@ -254,14 +254,7 @@ static void dwmac4_rd_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
{
unsigned int tdes3 = p->des3;
- if (unlikely(len > BUF_SIZE_16KiB)) {
- p->des2 |= (((len - BUF_SIZE_16KiB) <<
- TDES2_BUFFER2_SIZE_MASK_SHIFT)
- & TDES2_BUFFER2_SIZE_MASK)
- | (BUF_SIZE_16KiB & TDES2_BUFFER1_SIZE_MASK);
- } else {
- p->des2 |= (len & TDES2_BUFFER1_SIZE_MASK);
- }
+ p->des2 |= (len & TDES2_BUFFER1_SIZE_MASK);
if (is_fs)
tdes3 |= TDES3_FIRST_DESCRIPTOR;