netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt
@ 2015-01-22  6:55 Sonic Zhang
  2015-01-22  6:55 ` [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set Sonic Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sonic Zhang @ 2015-01-22  6:55 UTC (permalink / raw)
  To: Giuseppe Cavallaro, David S. Miller
  Cc: netdev, adi-buildroot-devel, Sonic Zhang

From: Sonic Zhang <sonic.zhang@analog.com>

Dont' pass SF_DMA_MODE to rxmode in this case.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8c6b7c1..5edfc8a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1446,7 +1446,11 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv)
 		/* Try to bump up the dma threshold on this failure */
 		if (unlikely(tc != SF_DMA_MODE) && (tc <= 256)) {
 			tc += 64;
-			priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE);
+			if (priv->plat->force_thresh_dma_mode)
+				priv->hw->dma->dma_mode(priv->ioaddr, tc, tc);
+			else
+				priv->hw->dma->dma_mode(priv->ioaddr, tc,
+					SF_DMA_MODE);
 			priv->xstats.threshold = tc;
 		}
 	} else if (unlikely(status == tx_hard_error))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
  2015-01-22  6:55 [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt Sonic Zhang
@ 2015-01-22  6:55 ` Sonic Zhang
  2015-01-22  8:18   ` Giuseppe CAVALLARO
  2015-01-26 23:48   ` David Miller
  2015-01-22  6:55 ` [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len" Sonic Zhang
  2015-01-26 23:48 ` [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt David Miller
  2 siblings, 2 replies; 8+ messages in thread
From: Sonic Zhang @ 2015-01-22  6:55 UTC (permalink / raw)
  To: Giuseppe Cavallaro, David S. Miller
  Cc: netdev, adi-buildroot-devel, Sonic Zhang

From: Sonic Zhang <sonic.zhang@analog.com>

Clear the TX COE bit when force_thresh_dma_mode is set even hardware
dma capability says support.

Tested on BF609.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 5edfc8a..7a7385a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2746,7 +2746,11 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
 		priv->plat->enh_desc = priv->dma_cap.enh_desc;
 		priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
 
-		priv->plat->tx_coe = priv->dma_cap.tx_coe;
+		/* TXCOE doesn't work in thresh DMA mode */
+		if (priv->plat->force_thresh_dma_mode)
+			priv->plat->tx_coe = 0;
+		else
+			priv->plat->tx_coe = priv->dma_cap.tx_coe;
 
 		if (priv->dma_cap.rx_coe_type2)
 			priv->plat->rx_coe = STMMAC_RX_COE_TYPE2;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len"
  2015-01-22  6:55 [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt Sonic Zhang
  2015-01-22  6:55 ` [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set Sonic Zhang
@ 2015-01-22  6:55 ` Sonic Zhang
  2015-01-22  8:20   ` Giuseppe CAVALLARO
  2015-01-26 23:48   ` David Miller
  2015-01-26 23:48 ` [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt David Miller
  2 siblings, 2 replies; 8+ messages in thread
From: Sonic Zhang @ 2015-01-22  6:55 UTC (permalink / raw)
  To: Giuseppe Cavallaro, David S. Miller
  Cc: netdev, adi-buildroot-devel, Sonic Zhang

From: Sonic Zhang <sonic.zhang@analog.com>

This property define the AXI bug lenth.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 Documentation/devicetree/bindings/net/stmmac.txt   |    1 +
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |    3 +++
 2 files changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index c41afd9..8ca65ce 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -43,6 +43,7 @@ Optional properties:
   available this clock is used for programming the Timestamp Addend Register.
   If not passed then the system clock will be used and this is fine on some
   platforms.
+- snps,burst_len: The AXI burst lenth value of the AXI BUS MODE register.
 
 Examples:
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 3039de2..a20cf0d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -234,6 +234,9 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
 			of_property_read_bool(np, "snps,fixed-burst");
 		dma_cfg->mixed_burst =
 			of_property_read_bool(np, "snps,mixed-burst");
+		of_property_read_u32(np, "snps,burst_len", &dma_cfg->burst_len);
+		if (dma_cfg->burst_len < 0 || dma_cfg->burst_len > 256)
+			dma_cfg->burst_len = 0;
 	}
 	plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode");
 	if (plat->force_thresh_dma_mode) {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
  2015-01-22  6:55 ` [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set Sonic Zhang
@ 2015-01-22  8:18   ` Giuseppe CAVALLARO
  2015-01-26 23:48   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2015-01-22  8:18 UTC (permalink / raw)
  To: Sonic Zhang, David S. Miller; +Cc: netdev, adi-buildroot-devel, Sonic Zhang

On 1/22/2015 7:55 AM, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> Clear the TX COE bit when force_thresh_dma_mode is set even hardware
> dma capability says support.
>
> Tested on BF609.
>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |    6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 5edfc8a..7a7385a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -2746,7 +2746,11 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
>   		priv->plat->enh_desc = priv->dma_cap.enh_desc;
>   		priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
>
> -		priv->plat->tx_coe = priv->dma_cap.tx_coe;
> +		/* TXCOE doesn't work in thresh DMA mode */
> +		if (priv->plat->force_thresh_dma_mode)
> +			priv->plat->tx_coe = 0;
> +		else
> +			priv->plat->tx_coe = priv->dma_cap.tx_coe;
>
>   		if (priv->dma_cap.rx_coe_type2)
>   			priv->plat->rx_coe = STMMAC_RX_COE_TYPE2;
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len"
  2015-01-22  6:55 ` [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len" Sonic Zhang
@ 2015-01-22  8:20   ` Giuseppe CAVALLARO
  2015-01-26 23:48   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Giuseppe CAVALLARO @ 2015-01-22  8:20 UTC (permalink / raw)
  To: Sonic Zhang, David S. Miller; +Cc: netdev, adi-buildroot-devel, Sonic Zhang

On 1/22/2015 7:55 AM, Sonic Zhang wrote:
> From: Sonic Zhang <sonic.zhang@analog.com>
>
> This property define the AXI bug lenth.

Hello

I can accept this patch for now. So thx :-)

FYI, I will send a set of patches to program the AXI Bus mode
register providing more parameters from DT.

Peppe

>
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
>   Documentation/devicetree/bindings/net/stmmac.txt   |    1 +
>   .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |    3 +++
>   2 files changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
> index c41afd9..8ca65ce 100644
> --- a/Documentation/devicetree/bindings/net/stmmac.txt
> +++ b/Documentation/devicetree/bindings/net/stmmac.txt
> @@ -43,6 +43,7 @@ Optional properties:
>     available this clock is used for programming the Timestamp Addend Register.
>     If not passed then the system clock will be used and this is fine on some
>     platforms.
> +- snps,burst_len: The AXI burst lenth value of the AXI BUS MODE register.
>
>   Examples:
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 3039de2..a20cf0d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -234,6 +234,9 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
>   			of_property_read_bool(np, "snps,fixed-burst");
>   		dma_cfg->mixed_burst =
>   			of_property_read_bool(np, "snps,mixed-burst");
> +		of_property_read_u32(np, "snps,burst_len", &dma_cfg->burst_len);
> +		if (dma_cfg->burst_len < 0 || dma_cfg->burst_len > 256)
> +			dma_cfg->burst_len = 0;
>   	}
>   	plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode");
>   	if (plat->force_thresh_dma_mode) {
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt
  2015-01-22  6:55 [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt Sonic Zhang
  2015-01-22  6:55 ` [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set Sonic Zhang
  2015-01-22  6:55 ` [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len" Sonic Zhang
@ 2015-01-26 23:48 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2015-01-26 23:48 UTC (permalink / raw)
  To: sonic.adi; +Cc: peppe.cavallaro, netdev, adi-buildroot-devel, sonic.zhang

From: Sonic Zhang <sonic.adi@gmail.com>
Date: Thu, 22 Jan 2015 14:55:56 +0800

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> Dont' pass SF_DMA_MODE to rxmode in this case.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

Applied.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
  2015-01-22  6:55 ` [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set Sonic Zhang
  2015-01-22  8:18   ` Giuseppe CAVALLARO
@ 2015-01-26 23:48   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2015-01-26 23:48 UTC (permalink / raw)
  To: sonic.adi; +Cc: peppe.cavallaro, netdev, adi-buildroot-devel, sonic.zhang

From: Sonic Zhang <sonic.adi@gmail.com>
Date: Thu, 22 Jan 2015 14:55:57 +0800

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> Clear the TX COE bit when force_thresh_dma_mode is set even hardware
> dma capability says support.
> 
> Tested on BF609.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

Applied.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len"
  2015-01-22  6:55 ` [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len" Sonic Zhang
  2015-01-22  8:20   ` Giuseppe CAVALLARO
@ 2015-01-26 23:48   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2015-01-26 23:48 UTC (permalink / raw)
  To: sonic.adi; +Cc: peppe.cavallaro, netdev, adi-buildroot-devel, sonic.zhang

From: Sonic Zhang <sonic.adi@gmail.com>
Date: Thu, 22 Jan 2015 14:55:58 +0800

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> This property define the AXI bug lenth.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>

Applied.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-27  0:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22  6:55 [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt Sonic Zhang
2015-01-22  6:55 ` [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set Sonic Zhang
2015-01-22  8:18   ` Giuseppe CAVALLARO
2015-01-26 23:48   ` David Miller
2015-01-22  6:55 ` [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len" Sonic Zhang
2015-01-22  8:20   ` Giuseppe CAVALLARO
2015-01-26 23:48   ` David Miller
2015-01-26 23:48 ` [PATCH 1/3] stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).