netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Ley Foon Tan <leyfoon.tan@starfivetech.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	lftan.linux@gmai.com, Corentin Labbe <clabbe.montjoie@gmail.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH net v3] net: stmmac: dwmac4: Fix high address display by updating reg_space[] from register values
Date: Wed, 23 Oct 2024 12:07:38 +0100	[thread overview]
Message-ID: <20241023110738.GM402847@kernel.org> (raw)
In-Reply-To: <20241021054625.1791965-1-leyfoon.tan@starfivetech.com>

+ 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
> 
> 

  reply	other threads:[~2024-10-23 11:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  5:46 [PATCH net v3] net: stmmac: dwmac4: Fix high address display by updating reg_space[] from register values Ley Foon Tan
2024-10-23 11:07 ` Simon Horman [this message]
2024-10-29 10:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241023110738.GM402847@kernel.org \
    --to=horms@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=clabbe.montjoie@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=leyfoon.tan@starfivetech.com \
    --cc=lftan.linux@gmai.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).