Skip to content

Commit

Permalink
stmmac: fix TX normal DESC
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Andreas Färber <[email protected]>
Cc: Fabrice Gasnier <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Giuseppe CAVALLARO authored and davem330 committed Apr 1, 2016
1 parent c66e98c commit a00e3ab
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/net/ethernet/stmicro/stmmac/norm_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
{
unsigned int tdes1 = p->des1;

if (mode == STMMAC_CHAIN_MODE)
norm_set_tx_desc_len_on_chain(p, len);
else
norm_set_tx_desc_len_on_ring(p, len);

if (is_fs)
tdes1 |= TDES1_FIRST_SEGMENT;
else
Expand All @@ -217,10 +212,15 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
if (ls)
tdes1 |= TDES1_LAST_SEGMENT;

if (tx_own)
tdes1 |= TDES0_OWN;

p->des1 = tdes1;

if (mode == STMMAC_CHAIN_MODE)
norm_set_tx_desc_len_on_chain(p, len);
else
norm_set_tx_desc_len_on_ring(p, len);

if (tx_own)
p->des0 |= TDES0_OWN;
}

static void ndesc_set_tx_ic(struct dma_desc *p)
Expand Down

0 comments on commit a00e3ab

Please sign in to comment.