linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH net v3] net: stmmac: dwmac4: Fix high address display by updating reg_space[] from register values
       [not found] <20241021054625.1791965-1-leyfoon.tan@starfivetech.com>
@ 2024-10-23 11:07 ` Simon Horman
  0 siblings, 0 replies; only message in thread
From: Simon Horman @ 2024-10-23 11:07 UTC (permalink / raw)
  To: Ley Foon Tan
  Cc: Alexandre Torgue, Jose Abreu, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, lftan.linux,
	Corentin Labbe, Giuseppe Cavallaro, Maxime Coquelin, Andrew Lunn,
	linux-arm-kernel, linux-stm32

+ Corentin, Giuseppe, Maxime, Andrew, linux-arm-kernel, linux-stm32

  As per output of get_maintainers.pl FILE.patch
  Please consider doing likewise in future.

On Mon, Oct 21, 2024 at 01:46:25PM +0800, Ley Foon Tan wrote:
> The high address will display as 0 if the driver does not set the
> reg_space[]. To fix this, read the high address registers and
> update the reg_space[] accordingly.
> 
> Fixes: fbf68229ffe7 ("net: stmmac: unify registers dumps methods")
> Signed-off-by: Ley Foon Tan <leyfoon.tan@starfivetech.com>
> ---
> - Split the patch series to net and net-next. Submit this patch for net.
> - Rebased to net https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
> 
> v2: https://patchwork.kernel.org/project/netdevbpf/cover/20241016031832.3701260-1-leyfoon.tan@starfivetech.com/

Thanks for the update.

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 8 ++++++++
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h | 2 ++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> index e0165358c4ac..77b35abc6f6f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> @@ -203,8 +203,12 @@ static void _dwmac4_dump_dma_regs(struct stmmac_priv *priv,
>  		readl(ioaddr + DMA_CHAN_TX_CONTROL(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_RX_CONTROL(default_addrs, channel) / 4] =
>  		readl(ioaddr + DMA_CHAN_RX_CONTROL(dwmac4_addrs, channel));
> +	reg_space[DMA_CHAN_TX_BASE_ADDR_HI(default_addrs, channel) / 4] =
> +		readl(ioaddr + DMA_CHAN_TX_BASE_ADDR_HI(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_TX_BASE_ADDR(default_addrs, channel) / 4] =
>  		readl(ioaddr + DMA_CHAN_TX_BASE_ADDR(dwmac4_addrs, channel));
> +	reg_space[DMA_CHAN_RX_BASE_ADDR_HI(default_addrs, channel) / 4] =
> +		readl(ioaddr + DMA_CHAN_RX_BASE_ADDR_HI(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_RX_BASE_ADDR(default_addrs, channel) / 4] =
>  		readl(ioaddr + DMA_CHAN_RX_BASE_ADDR(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_TX_END_ADDR(default_addrs, channel) / 4] =
> @@ -225,8 +229,12 @@ static void _dwmac4_dump_dma_regs(struct stmmac_priv *priv,
>  		readl(ioaddr + DMA_CHAN_CUR_TX_DESC(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_CUR_RX_DESC(default_addrs, channel) / 4] =
>  		readl(ioaddr + DMA_CHAN_CUR_RX_DESC(dwmac4_addrs, channel));
> +	reg_space[DMA_CHAN_CUR_TX_BUF_ADDR_HI(default_addrs, channel) / 4] =
> +		readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR_HI(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_CUR_TX_BUF_ADDR(default_addrs, channel) / 4] =
>  		readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR(dwmac4_addrs, channel));
> +	reg_space[DMA_CHAN_CUR_RX_BUF_ADDR_HI(default_addrs, channel) / 4] =
> +		readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR_HI(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_CUR_RX_BUF_ADDR(default_addrs, channel) / 4] =
>  		readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR(dwmac4_addrs, channel));
>  	reg_space[DMA_CHAN_STATUS(default_addrs, channel) / 4] =
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h
> index 17d9120db5fe..4f980dcd3958 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h
> @@ -127,7 +127,9 @@ static inline u32 dma_chanx_base_addr(const struct dwmac4_addrs *addrs,
>  #define DMA_CHAN_SLOT_CTRL_STATUS(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x3c)
>  #define DMA_CHAN_CUR_TX_DESC(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x44)
>  #define DMA_CHAN_CUR_RX_DESC(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x4c)
> +#define DMA_CHAN_CUR_TX_BUF_ADDR_HI(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x50)
>  #define DMA_CHAN_CUR_TX_BUF_ADDR(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x54)
> +#define DMA_CHAN_CUR_RX_BUF_ADDR_HI(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x58)
>  #define DMA_CHAN_CUR_RX_BUF_ADDR(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x5c)
>  #define DMA_CHAN_STATUS(addrs, x)	(dma_chanx_base_addr(addrs, x) + 0x60)
>  
> -- 
> 2.34.1
> 
> 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-23 11:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241021054625.1791965-1-leyfoon.tan@starfivetech.com>
2024-10-23 11:07 ` [PATCH net v3] net: stmmac: dwmac4: Fix high address display by updating reg_space[] from register values Simon Horman

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).