Linux-Renesas-SoC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net] sh_eth: check sh_eth_cpu_data::dual_port when dumping registers
@ 2020-01-08 20:42 Sergei Shtylyov
  2020-01-10  2:35 ` David Miller
  2020-01-20 11:00 ` Patchwork summary for: linux-renesas-soc patchwork-bot+linux-renesas-soc
  0 siblings, 2 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2020-01-08 20:42 UTC (permalink / raw)
  To: netdev, David S. Miller; +Cc: linux-renesas-soc, linux-sh

When adding the sh_eth_cpu_data::dual_port flag I forgot to add the flag
checks to __sh_eth_get_regs(), causing the non-existing TSU registers to
be dumped by 'ethtool' on the single port Ether controllers having TSU...

Fixes: a94cf2a614f8 ("sh_eth: fix TSU init on SH7734/R8A7740")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against DaveM's 'net.git' repo.

There are 3 more alike patches that check the same kind of omissions but they
seem to be subject to the latter register offset sanity checking, so shouldn't
affect the register dumping...

 drivers/net/ethernet/renesas/sh_eth.c |   38 ++++++++++++++++++----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

Index: net/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net/drivers/net/ethernet/renesas/sh_eth.c
@@ -2204,24 +2204,28 @@ static size_t __sh_eth_get_regs(struct n
 	if (cd->tsu) {
 		add_tsu_reg(ARSTR);
 		add_tsu_reg(TSU_CTRST);
-		add_tsu_reg(TSU_FWEN0);
-		add_tsu_reg(TSU_FWEN1);
-		add_tsu_reg(TSU_FCM);
-		add_tsu_reg(TSU_BSYSL0);
-		add_tsu_reg(TSU_BSYSL1);
-		add_tsu_reg(TSU_PRISL0);
-		add_tsu_reg(TSU_PRISL1);
-		add_tsu_reg(TSU_FWSL0);
-		add_tsu_reg(TSU_FWSL1);
+		if (cd->dual_port) {
+			add_tsu_reg(TSU_FWEN0);
+			add_tsu_reg(TSU_FWEN1);
+			add_tsu_reg(TSU_FCM);
+			add_tsu_reg(TSU_BSYSL0);
+			add_tsu_reg(TSU_BSYSL1);
+			add_tsu_reg(TSU_PRISL0);
+			add_tsu_reg(TSU_PRISL1);
+			add_tsu_reg(TSU_FWSL0);
+			add_tsu_reg(TSU_FWSL1);
+		}
 		add_tsu_reg(TSU_FWSLC);
-		add_tsu_reg(TSU_QTAGM0);
-		add_tsu_reg(TSU_QTAGM1);
-		add_tsu_reg(TSU_FWSR);
-		add_tsu_reg(TSU_FWINMK);
-		add_tsu_reg(TSU_ADQT0);
-		add_tsu_reg(TSU_ADQT1);
-		add_tsu_reg(TSU_VTAG0);
-		add_tsu_reg(TSU_VTAG1);
+		if (cd->dual_port) {
+			add_tsu_reg(TSU_QTAGM0);
+			add_tsu_reg(TSU_QTAGM1);
+			add_tsu_reg(TSU_FWSR);
+			add_tsu_reg(TSU_FWINMK);
+			add_tsu_reg(TSU_ADQT0);
+			add_tsu_reg(TSU_ADQT1);
+			add_tsu_reg(TSU_VTAG0);
+			add_tsu_reg(TSU_VTAG1);
+		}
 		add_tsu_reg(TSU_ADSBSY);
 		add_tsu_reg(TSU_TEN);
 		add_tsu_reg(TSU_POST1);

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

* Re: [PATCH net] sh_eth: check sh_eth_cpu_data::dual_port when dumping registers
  2020-01-08 20:42 [PATCH net] sh_eth: check sh_eth_cpu_data::dual_port when dumping registers Sergei Shtylyov
@ 2020-01-10  2:35 ` David Miller
  2020-01-20 11:00 ` Patchwork summary for: linux-renesas-soc patchwork-bot+linux-renesas-soc
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-01-10  2:35 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, linux-renesas-soc, linux-sh

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Wed, 8 Jan 2020 23:42:42 +0300

> When adding the sh_eth_cpu_data::dual_port flag I forgot to add the flag
> checks to __sh_eth_get_regs(), causing the non-existing TSU registers to
> be dumped by 'ethtool' on the single port Ether controllers having TSU...
> 
> Fixes: a94cf2a614f8 ("sh_eth: fix TSU init on SH7734/R8A7740")
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied, thanks.

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

* Patchwork summary for: linux-renesas-soc
  2020-01-08 20:42 [PATCH net] sh_eth: check sh_eth_cpu_data::dual_port when dumping registers Sergei Shtylyov
  2020-01-10  2:35 ` David Miller
@ 2020-01-20 11:00 ` patchwork-bot+linux-renesas-soc
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-renesas-soc @ 2020-01-20 11:00 UTC (permalink / raw)
  To: linux-renesas-soc

Hello:

The following patches were marked "accepted", because they were applied to
geert/renesas-devel (refs/heads/master):

Patch: [net] sh_eth: check sh_eth_cpu_data::dual_port when dumping registers
  Submitter: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
  Patchwork: https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=225633

Total patches: 1

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 20:42 [PATCH net] sh_eth: check sh_eth_cpu_data::dual_port when dumping registers Sergei Shtylyov
2020-01-10  2:35 ` David Miller
2020-01-20 11:00 ` Patchwork summary for: linux-renesas-soc patchwork-bot+linux-renesas-soc

Linux-Renesas-SoC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-renesas-soc/0 linux-renesas-soc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-renesas-soc linux-renesas-soc/ https://lore.kernel.org/linux-renesas-soc \
		linux-renesas-soc@vger.kernel.org
	public-inbox-index linux-renesas-soc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-renesas-soc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git