All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: netdev@vger.kernel.org, linux-rockchip@lists.infradead.org
Cc: Jose Abreu <joabreu@synopsys.com>,
	Heiko Stuebner <heiko@sntech.de>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Peter Geis <pgwipeout@gmail.com>,
	Kever Yang <kever.yang@rock-chips.com>,
	David Wu <david.wu@rock-chips.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	kernel@collabora.com
Subject: [PATCH v2 1/3] net: stmmac: Don't set has_gmac if has_gmac4 is set
Date: Wed, 21 Apr 2021 17:34:07 -0300	[thread overview]
Message-ID: <20210421203409.40717-2-ezequiel@collabora.com> (raw)
In-Reply-To: <20210421203409.40717-1-ezequiel@collabora.com>

Some Rockchip platforms have a GMAC4 core, and therefore
'plat_stmmacenet_data.has_gmac' shouldn't be set if
'plat_stmmacenet_data.has_gmac4' is set.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 6ef30252bfe0..c432a9592489 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1400,7 +1400,11 @@ static int rk_gmac_probe(struct platform_device *pdev)
 	if (IS_ERR(plat_dat))
 		return PTR_ERR(plat_dat);
 
-	plat_dat->has_gmac = true;
+	/* If the stmmac is not already selected as gmac4,
+	 * then make sure we fallback to gmac.
+	 */
+	if (!plat_dat->has_gmac4)
+		plat_dat->has_gmac = true;
 	plat_dat->fix_mac_speed = rk_fix_speed;
 
 	plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data);
-- 
2.30.0


WARNING: multiple messages have this Message-ID (diff)
From: Ezequiel Garcia <ezequiel@collabora.com>
To: netdev@vger.kernel.org, linux-rockchip@lists.infradead.org
Cc: Jose Abreu <joabreu@synopsys.com>,
	Heiko Stuebner <heiko@sntech.de>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Peter Geis <pgwipeout@gmail.com>,
	Kever Yang <kever.yang@rock-chips.com>,
	David Wu <david.wu@rock-chips.com>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	kernel@collabora.com
Subject: [PATCH v2 1/3] net: stmmac: Don't set has_gmac if has_gmac4 is set
Date: Wed, 21 Apr 2021 17:34:07 -0300	[thread overview]
Message-ID: <20210421203409.40717-2-ezequiel@collabora.com> (raw)
In-Reply-To: <20210421203409.40717-1-ezequiel@collabora.com>

Some Rockchip platforms have a GMAC4 core, and therefore
'plat_stmmacenet_data.has_gmac' shouldn't be set if
'plat_stmmacenet_data.has_gmac4' is set.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 6ef30252bfe0..c432a9592489 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1400,7 +1400,11 @@ static int rk_gmac_probe(struct platform_device *pdev)
 	if (IS_ERR(plat_dat))
 		return PTR_ERR(plat_dat);
 
-	plat_dat->has_gmac = true;
+	/* If the stmmac is not already selected as gmac4,
+	 * then make sure we fallback to gmac.
+	 */
+	if (!plat_dat->has_gmac4)
+		plat_dat->has_gmac = true;
 	plat_dat->fix_mac_speed = rk_fix_speed;
 
 	plat_dat->bsp_priv = rk_gmac_setup(pdev, plat_dat, data);
-- 
2.30.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2021-04-21 20:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 20:34 [PATCH v2 net-next 0/3] net: stmmac: RK3566 Ezequiel Garcia
2021-04-21 20:34 ` Ezequiel Garcia
2021-04-21 20:34 ` Ezequiel Garcia [this message]
2021-04-21 20:34   ` [PATCH v2 1/3] net: stmmac: Don't set has_gmac if has_gmac4 is set Ezequiel Garcia
2021-04-21 20:34 ` [PATCH v2 2/3] net: stmmac: dwmac-rk: Check platform-specific ops Ezequiel Garcia
2021-04-21 20:34   ` Ezequiel Garcia
2021-04-21 20:34 ` [PATCH v2 3/3] net: stmmac: Add RK3566 SoC support Ezequiel Garcia
2021-04-21 20:34   ` Ezequiel Garcia
2021-04-21 20:49   ` Johan Jonker
2021-04-21 20:49     ` Johan Jonker
2021-04-21 21:06     ` Ezequiel Garcia
2021-04-21 21:06       ` Ezequiel Garcia
2021-04-23  9:24 ` [PATCH v2 net-next 0/3] net: stmmac: RK3566 David Wu
2021-04-23  9:24   ` David Wu
2021-04-23 13:57   ` Ezequiel Garcia
2021-04-23 13:57     ` Ezequiel Garcia
2021-04-25  9:07     ` David Wu
2021-04-25  9:07       ` David Wu

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=20210421203409.40717-2-ezequiel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=davem@davemloft.net \
    --cc=david.wu@rock-chips.com \
    --cc=heiko@sntech.de \
    --cc=joabreu@synopsys.com \
    --cc=kernel@collabora.com \
    --cc=kever.yang@rock-chips.com \
    --cc=kuba@kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=pgwipeout@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.