Skip to content

Commit a00e3ab

Browse files
cavagiudavem330
authored andcommitted
stmmac: fix TX normal DESC
This patch fixs a regression raised when test on chips that use the normal descriptor layout. In fact, no len bits were set for the TDES1 and no OWN bit inside the TDES0. Signed-off-by: Giuseppe CAVALLARO <peppe.cavallaro@st.com> Tested-by: Andreas Färber <afaerber@suse.de> Cc: Fabrice Gasnier <fabrice.gasnier@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c66e98c commit a00e3ab

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/net/ethernet/stmicro/stmmac/norm_desc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
199199
{
200200
unsigned int tdes1 = p->des1;
201201

202-
if (mode == STMMAC_CHAIN_MODE)
203-
norm_set_tx_desc_len_on_chain(p, len);
204-
else
205-
norm_set_tx_desc_len_on_ring(p, len);
206-
207202
if (is_fs)
208203
tdes1 |= TDES1_FIRST_SEGMENT;
209204
else
@@ -217,10 +212,15 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
217212
if (ls)
218213
tdes1 |= TDES1_LAST_SEGMENT;
219214

220-
if (tx_own)
221-
tdes1 |= TDES0_OWN;
222-
223215
p->des1 = tdes1;
216+
217+
if (mode == STMMAC_CHAIN_MODE)
218+
norm_set_tx_desc_len_on_chain(p, len);
219+
else
220+
norm_set_tx_desc_len_on_ring(p, len);
221+
222+
if (tx_own)
223+
p->des0 |= TDES0_OWN;
224224
}
225225

226226
static void ndesc_set_tx_ic(struct dma_desc *p)

0 commit comments

Comments
 (0)