Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Arun Iyengar via B4 Relay
Thu, 12 Nov 2026 08:41
[PATCH net-next v2 1/2] net: stmmac: dwmac-sun8i: Fix the RX_TH threshold encoding
Author: Arun Iyengar via B4 Relay
Date: Thu, 12 Nov 2026 08:41
Date: Thu, 12 Nov 2026 08:41
36 lines
11906 bytes
11906 bytes
From: Arun Iyengar <aiyengar1990@gmail.com>
The EMAC RX_CTL1 RX_TH field (bits 5:4) encodes 00 = 64 bytes and
01 = 32 bytes (H616 user manual v1.0, 6.5.10; 10 = 96 and 11 = 128 bytes
as in the driver). The driver has the first two swapped.
The values are only used in RX threshold mode, which stmmac selects only
when the snps,force_thresh_dma_mode property is set. No Allwinner device
tree sets it, so no in-tree board is affected.
Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")
Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 47954537b29e..0c82662fbe6e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -198,8 +198,9 @@ static const struct emac_variant emac_variant_h616_emac1 = {
/* Used in RX_CTL1*/
#define EMAC_RX_MD BIT(1)
#define EMAC_RX_TH_MASK GENMASK(5, 4)
-#define EMAC_RX_TH_32 0
-#define EMAC_RX_TH_64 (0x1 << 4)
+/* RX_CTL1 RX_TH encoding (H616 UM 6.5.10): 00 = 64, 01 = 32 bytes */
+#define EMAC_RX_TH_32 (0x1 << 4)
+#define EMAC_RX_TH_64 0
#define EMAC_RX_TH_96 (0x2 << 4)
#define EMAC_RX_TH_128 (0x3 << 4)
#define EMAC_RX_DMA_EN BIT(30)
--
2.55.0
Re: [PATCH net-next v2 1/2] net: stmmac: dwmac-sun8i: Fix the RX_TH threshold encoding
Author: Nicolai Buchwitz
Date: Thu, 12 Nov 2026 09:43
Date: Thu, 12 Nov 2026 09:43
44 lines
10497 bytes
10497 bytes
On 12.11.2026 09:41, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> The EMAC RX_CTL1 RX_TH field (bits 5:4) encodes 00 = 64 bytes and
> 01 = 32 bytes (H616 user manual v1.0, 6.5.10; 10 = 96 and 11 = 128
> bytes
> as in the driver). The driver has the first two swapped.
>
> The values are only used in RX threshold mode, which stmmac selects
> only
> when the snps,force_thresh_dma_mode property is set. No Allwinner
> device
> tree sets it, so no in-tree board is affected.
>
> Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> index 47954537b29e..0c82662fbe6e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> @@ -198,8 +198,9 @@ static const struct emac_variant
> emac_variant_h616_emac1 = {
> /* Used in RX_CTL1*/
> #define EMAC_RX_MD BIT(1)
> #define EMAC_RX_TH_MASK GENMASK(5, 4)
> -#define EMAC_RX_TH_32 0
> -#define EMAC_RX_TH_64 (0x1 << 4)
> +/* RX_CTL1 RX_TH encoding (H616 UM 6.5.10): 00 = 64, 01 = 32 bytes */
> +#define EMAC_RX_TH_32 (0x1 << 4)
> +#define EMAC_RX_TH_64 0
> #define EMAC_RX_TH_96 (0x2 << 4)
> #define EMAC_RX_TH_128 (0x3 << 4)
> #define EMAC_RX_DMA_EN BIT(30)
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Thanks,
Nicolai
Re: [PATCH net-next v2 1/2] net: stmmac: dwmac-sun8i: Fix the RX_TH threshold encoding
Author: Chen-Yu Tsai
Date: Thu, 12 Nov 2026 13:32
Date: Thu, 12 Nov 2026 13:32
24 lines
10173 bytes
10173 bytes
On Thu, Nov 12, 2026 at 5:41 PM Arun Iyengar via B4 Relay
<devnull+aiyengar1990.gmail.com@kernel.org> wrote:
>
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> The EMAC RX_CTL1 RX_TH field (bits 5:4) encodes 00 = 64 bytes and
> 01 = 32 bytes (H616 user manual v1.0, 6.5.10; 10 = 96 and 11 = 128 bytes
> as in the driver). The driver has the first two swapped.
>
> The values are only used in RX threshold mode, which stmmac selects only
> when the snps,force_thresh_dma_mode property is set. No Allwinner device
> tree sets it, so no in-tree board is affected.
>
> Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Checked A64, H3, H6 user manuals as well.
The original chip this came in, the A83T, the manual for it doesn't have
the bits for this register.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads