* [PATCH (net-next.git)] STMMAC: fix TX Normal descriptor
@ 2016-03-16 10:21 Giuseppe Cavallaro
2016-03-16 10:21 ` [PATCH (net-next.git)] stmmac: fix TX normal DESC Giuseppe Cavallaro
0 siblings, 1 reply; 3+ messages in thread
From: Giuseppe Cavallaro @ 2016-03-16 10:21 UTC (permalink / raw)
To: netdev
Cc: gabriel.fernandez, afaerber, fschaefer.oss, dinh.linux, davem,
preid, tomeu, fabrice.gasnier, alexandre.torgue,
Giuseppe Cavallaro
On top of the Oct_2015 driver version committed into net-next, this patch
fixes a problem for the HW where the normal descriptor are used at runtime
instead of the Enhanced/Alternate descriptors.
In the beginning, it was suggested to revert the patch:
"stmmac: first frame prep at the end of xmit routine"
and it has been noticed that w/o it the normal TDES 0 and 1 were good filled.
Then has been proposed this new fix (w/o reverting the patch above).
Giuseppe Cavallaro (1):
stmmac: fix TX normal DESC
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
--
1.7.4.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH (net-next.git)] stmmac: fix TX normal DESC
2016-03-16 10:21 [PATCH (net-next.git)] STMMAC: fix TX Normal descriptor Giuseppe Cavallaro
@ 2016-03-16 10:21 ` Giuseppe Cavallaro
2016-03-18 14:07 ` Tomeu Vizoso
0 siblings, 1 reply; 3+ messages in thread
From: Giuseppe Cavallaro @ 2016-03-16 10:21 UTC (permalink / raw)
To: netdev
Cc: gabriel.fernandez, afaerber, fschaefer.oss, dinh.linux, davem,
preid, tomeu, fabrice.gasnier, alexandre.torgue,
Giuseppe Cavallaro
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>
---
drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index e13228f..011386f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -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
@@ -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)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH (net-next.git)] stmmac: fix TX normal DESC
2016-03-16 10:21 ` [PATCH (net-next.git)] stmmac: fix TX normal DESC Giuseppe Cavallaro
@ 2016-03-18 14:07 ` Tomeu Vizoso
0 siblings, 0 replies; 3+ messages in thread
From: Tomeu Vizoso @ 2016-03-18 14:07 UTC (permalink / raw)
To: Giuseppe Cavallaro
Cc: netdev, Gabriel Fernandez, Andreas Färber,
Frank Schäfer, Dinh Nguyen, David S. Miller, preid,
Fabrice GASNIER, Alexandre TORGUE
On 16 March 2016 at 11:21, Giuseppe Cavallaro <peppe.cavallaro@st.com> wrote:
> 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>
Hi,
with this patch, I have eth working reliably on the Rock2 again.
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Thanks,
Tomeu
> ---
> drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 16 ++++++++--------
> 1 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
> index e13228f..011386f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
> @@ -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
> @@ -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)
> --
> 1.7.4.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-18 14:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 10:21 [PATCH (net-next.git)] STMMAC: fix TX Normal descriptor Giuseppe Cavallaro
2016-03-16 10:21 ` [PATCH (net-next.git)] stmmac: fix TX normal DESC Giuseppe Cavallaro
2016-03-18 14:07 ` Tomeu Vizoso
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.