Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1537724 > unrolled thread

[RESEND PATCH 1/3] bindings: net: stmmac: correct note about TSO

Started byNiklas Cassel <niklas.cassel@axis.com>
First post2016-12-07 13:50 +0100
Last post2016-12-08 17:40 +0100
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RESEND PATCH 1/3] bindings: net: stmmac: correct note about TSO Niklas Cassel <niklas.cassel@axis.com> - 2016-12-07 13:50 +0100
    [RESEND PATCH 3/3] net: stmmac: stmmac_platform: use correct setup function for gmac4 Niklas Cassel <niklas.cassel@axis.com> - 2016-12-07 13:50 +0100
      Re: [RESEND PATCH 3/3] net: stmmac: stmmac_platform: use correct  setup function for gmac4 David Miller <davem@davemloft.net> - 2016-12-08 17:40 +0100
    [RESEND PATCH 2/3] net: stmmac: dwmac-generic: add missing compatible strings Niklas Cassel <niklas.cassel@axis.com> - 2016-12-07 13:50 +0100
      Re: [RESEND PATCH 2/3] net: stmmac: dwmac-generic: add missing  compatible strings David Miller <davem@davemloft.net> - 2016-12-08 17:40 +0100
    Re: [RESEND PATCH 1/3] bindings: net: stmmac: correct note about  TSO David Miller <davem@davemloft.net> - 2016-12-08 17:40 +0100

#1537724 — [RESEND PATCH 1/3] bindings: net: stmmac: correct note about TSO

FromNiklas Cassel <niklas.cassel@axis.com>
Date2016-12-07 13:50 +0100
Subject[RESEND PATCH 1/3] bindings: net: stmmac: correct note about TSO
Message-ID<sLJPz-a6-5@gated-at.bofh.it>
From: Niklas Cassel <niklas.cassel@axis.com>

snps,tso was previously placed under AXI BUS Mode parameters,
suggesting that the property should be in the stmmac-axi-config node.

TSO (TCP Segmentation Offloading) has nothing to do with AXI BUS Mode
parameters, and the parser actually expects it to be in the root node,
not in the stmmac-axi-config.

Also added a note about snps,tso only being available on GMAC4 and newer.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 Documentation/devicetree/bindings/net/stmmac.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt
index 41b49e6075f5..b95ff998ba73 100644
--- a/Documentation/devicetree/bindings/net/stmmac.txt
+++ b/Documentation/devicetree/bindings/net/stmmac.txt
@@ -1,7 +1,7 @@
 * STMicroelectronics 10/100/1000 Ethernet driver (GMAC)
 
 Required properties:
-- compatible: Should be "snps,dwmac-<ip_version>" "snps,dwmac"
+- compatible: Should be "snps,dwmac-<ip_version>", "snps,dwmac"
 	For backwards compatibility: "st,spear600-gmac" is also supported.
 - reg: Address and length of the register set for the device
 - interrupt-parent: Should be the phandle for the interrupt controller
@@ -50,6 +50,8 @@ Optional properties:
 - snps,ps-speed: port selection speed that can be passed to the core when
 		 PCS is supported. For example, this is used in case of SGMII
 		 and MAC2MAC connection.
+- snps,tso: this enables the TSO feature otherwise it will be managed by
+		 MAC HW capability register. Only for GMAC4 and newer.
 - AXI BUS Mode parameters: below the list of all the parameters to program the
 			   AXI register inside the DMA module:
 	- snps,lpi_en: enable Low Power Interface
@@ -62,8 +64,6 @@ Optional properties:
 	- snps,fb: fixed-burst
 	- snps,mb: mixed-burst
 	- snps,rb: rebuild INCRx Burst
-	- snps,tso: this enables the TSO feature otherwise it will be managed by
-	    MAC HW capability register.
 - mdio: with compatible = "snps,dwmac-mdio", create and register mdio bus.
 
 Examples:
-- 
2.1.4

[toc] | [next] | [standalone]


#1537726 — [RESEND PATCH 3/3] net: stmmac: stmmac_platform: use correct setup function for gmac4

FromNiklas Cassel <niklas.cassel@axis.com>
Date2016-12-07 13:50 +0100
Subject[RESEND PATCH 3/3] net: stmmac: stmmac_platform: use correct setup function for gmac4
Message-ID<sLJPz-a6-17@gated-at.bofh.it>
In reply to#1537724
From: Niklas Cassel <niklas.cassel@axis.com>

devicetree binding for stmmac states:
- compatible: Should be "snps,dwmac-<ip_version>", "snps,dwmac"
	For backwards compatibility: "st,spear600-gmac" is also supported.

Previously, when specifying "snps,dwmac-4.10a", "snps,dwmac" as your
compatible string, plat_stmmacenet_data would have both has_gmac and
has_gmac4 set.

This would lead to stmmac_hw_init calling dwmac1000_setup rather than
dwmac4_setup, resulting in a non-functional driver.
This happened since the check for has_gmac is done before the check for
has_gmac4. However, the order should not matter, so it does not make sense
to have both set.

If something is valid for both, you should do as the stmmac_interrupt does:
if (priv->plat->has_gmac || priv->plat->has_gmac4) ...

The places where it was obvious that the author actually meant
if (has_gmac || has_gmac4) rather than if (has_gmac) has been updated.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c  | 4 ++--
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index d5a8122b6033..dd5b38e4cd1f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -263,7 +263,7 @@ static void stmmac_ethtool_getdrvinfo(struct net_device *dev,
 {
 	struct stmmac_priv *priv = netdev_priv(dev);
 
-	if (priv->plat->has_gmac)
+	if (priv->plat->has_gmac || priv->plat->has_gmac4)
 		strlcpy(info->driver, GMAC_ETHTOOL_NAME, sizeof(info->driver));
 	else
 		strlcpy(info->driver, MAC100_ETHTOOL_NAME,
@@ -448,7 +448,7 @@ static void stmmac_ethtool_gregs(struct net_device *dev,
 
 	memset(reg_space, 0x0, REG_SPACE_SIZE);
 
-	if (!priv->plat->has_gmac) {
+	if (!(priv->plat->has_gmac || priv->plat->has_gmac4)) {
 		/* MAC registers */
 		for (i = 0; i < 12; i++)
 			reg_space[i] = readl(priv->ioaddr + (i * 4));
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index e528e7126b65..d3b6f92f350a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -292,6 +292,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
 	if (of_device_is_compatible(np, "snps,dwmac-4.00") ||
 	    of_device_is_compatible(np, "snps,dwmac-4.10a")) {
 		plat->has_gmac4 = 1;
+		plat->has_gmac = 0;
 		plat->pmt = 1;
 		plat->tso_en = of_property_read_bool(np, "snps,tso");
 	}
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1538716 — Re: [RESEND PATCH 3/3] net: stmmac: stmmac_platform: use correct setup function for gmac4

FromDavid Miller <davem@davemloft.net>
Date2016-12-08 17:40 +0100
SubjectRe: [RESEND PATCH 3/3] net: stmmac: stmmac_platform: use correct setup function for gmac4
Message-ID<sM9TI-8om-19@gated-at.bofh.it>
In reply to#1537726
From: Niklas Cassel <niklas.cassel@axis.com>
Date: Wed, 7 Dec 2016 13:41:08 +0100

> From: Niklas Cassel <niklas.cassel@axis.com>
> 
> devicetree binding for stmmac states:
> - compatible: Should be "snps,dwmac-<ip_version>", "snps,dwmac"
> 	For backwards compatibility: "st,spear600-gmac" is also supported.
> 
> Previously, when specifying "snps,dwmac-4.10a", "snps,dwmac" as your
> compatible string, plat_stmmacenet_data would have both has_gmac and
> has_gmac4 set.
> 
> This would lead to stmmac_hw_init calling dwmac1000_setup rather than
> dwmac4_setup, resulting in a non-functional driver.
> This happened since the check for has_gmac is done before the check for
> has_gmac4. However, the order should not matter, so it does not make sense
> to have both set.
> 
> If something is valid for both, you should do as the stmmac_interrupt does:
> if (priv->plat->has_gmac || priv->plat->has_gmac4) ...
> 
> The places where it was obvious that the author actually meant
> if (has_gmac || has_gmac4) rather than if (has_gmac) has been updated.
> 
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
> Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

Applied.

[toc] | [prev] | [next] | [standalone]


#1537728 — [RESEND PATCH 2/3] net: stmmac: dwmac-generic: add missing compatible strings

FromNiklas Cassel <niklas.cassel@axis.com>
Date2016-12-07 13:50 +0100
Subject[RESEND PATCH 2/3] net: stmmac: dwmac-generic: add missing compatible strings
Message-ID<sLJPz-a6-23@gated-at.bofh.it>
In reply to#1537724
From: Niklas Cassel <niklas.cassel@axis.com>

devicetree binding for stmmac states:
- compatible: Should be "snps,dwmac-<ip_version>", "snps,dwmac"
	For backwards compatibility: "st,spear600-gmac" is also supported.

Since dwmac-generic.c calls stmmac_probe_config_dt explicitly,
another alternative would have been to remove all compatible strings
other than "snps,dwmac" and "st,spear600-gmac" from dwmac-generic.c.

However, that would probably do more good than harm, since when trying
to figure out what hardware a certain driver supports, you usually look
at the compatible strings in the struct of_device_id, and not in some
function defined in a completely different file.

No functional change intended.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
index e6e6c2fcc4b7..3304095c934c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c
@@ -71,9 +71,12 @@ static int dwmac_generic_probe(struct platform_device *pdev)
 
 static const struct of_device_id dwmac_generic_match[] = {
 	{ .compatible = "st,spear600-gmac"},
+	{ .compatible = "snps,dwmac-3.50a"},
 	{ .compatible = "snps,dwmac-3.610"},
 	{ .compatible = "snps,dwmac-3.70a"},
 	{ .compatible = "snps,dwmac-3.710"},
+	{ .compatible = "snps,dwmac-4.00"},
+	{ .compatible = "snps,dwmac-4.10a"},
 	{ .compatible = "snps,dwmac"},
 	{ }
 };
-- 
2.1.4

[toc] | [prev] | [next] | [standalone]


#1538721 — Re: [RESEND PATCH 2/3] net: stmmac: dwmac-generic: add missing compatible strings

FromDavid Miller <davem@davemloft.net>
Date2016-12-08 17:40 +0100
SubjectRe: [RESEND PATCH 2/3] net: stmmac: dwmac-generic: add missing compatible strings
Message-ID<sM9TJ-8om-47@gated-at.bofh.it>
In reply to#1537728
From: Niklas Cassel <niklas.cassel@axis.com>
Date: Wed, 7 Dec 2016 13:41:07 +0100

> From: Niklas Cassel <niklas.cassel@axis.com>
> 
> devicetree binding for stmmac states:
> - compatible: Should be "snps,dwmac-<ip_version>", "snps,dwmac"
> 	For backwards compatibility: "st,spear600-gmac" is also supported.
> 
> Since dwmac-generic.c calls stmmac_probe_config_dt explicitly,
> another alternative would have been to remove all compatible strings
> other than "snps,dwmac" and "st,spear600-gmac" from dwmac-generic.c.
> 
> However, that would probably do more good than harm, since when trying
> to figure out what hardware a certain driver supports, you usually look
> at the compatible strings in the struct of_device_id, and not in some
> function defined in a completely different file.
> 
> No functional change intended.
> 
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.

[toc] | [prev] | [next] | [standalone]


#1538709 — Re: [RESEND PATCH 1/3] bindings: net: stmmac: correct note about TSO

FromDavid Miller <davem@davemloft.net>
Date2016-12-08 17:40 +0100
SubjectRe: [RESEND PATCH 1/3] bindings: net: stmmac: correct note about TSO
Message-ID<sM9TH-8om-1@gated-at.bofh.it>
In reply to#1537724
From: Niklas Cassel <niklas.cassel@axis.com>
Date: Wed, 7 Dec 2016 13:41:06 +0100

> From: Niklas Cassel <niklas.cassel@axis.com>
> 
> snps,tso was previously placed under AXI BUS Mode parameters,
> suggesting that the property should be in the stmmac-axi-config node.
> 
> TSO (TCP Segmentation Offloading) has nothing to do with AXI BUS Mode
> parameters, and the parser actually expects it to be in the root node,
> not in the stmmac-axi-config.
> 
> Also added a note about snps,tso only being available on GMAC4 and newer.
> 
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
> Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>
> Acked-by: Rob Herring <robh@kernel.org>
> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web