linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v6 0/4] RGMII Internal delay common property
@ 2020-06-04 11:14 Dan Murphy
  2020-06-04 11:14 ` [PATCH net-next v6 1/4] dt-bindings: net: Add tx and rx internal delays Dan Murphy
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Dan Murphy @ 2020-06-04 11:14 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, robh
  Cc: netdev, linux-kernel, devicetree, Dan Murphy

Hello

The RGMII internal delay is a common setting found in most RGMII capable PHY
devices.  It was found that many vendor specific device tree properties exist
to do the same function. This creates a common property to be used for PHY's
that have tunable internal delays for the Rx and Tx paths.

Dan Murphy (4):
  dt-bindings: net: Add tx and rx internal delays
  net: phy: Add a helper to return the index for of the internal delay
  dt-bindings: net: Add RGMII internal delay for DP83869
  net: dp83869: Add RGMII internal delay configuration

 .../devicetree/bindings/net/ethernet-phy.yaml | 13 ++++
 .../devicetree/bindings/net/ti,dp83869.yaml   | 16 ++++-
 drivers/net/phy/dp83869.c                     | 53 ++++++++++++++-
 drivers/net/phy/phy_device.c                  | 68 +++++++++++++++++++
 include/linux/phy.h                           |  4 ++
 5 files changed, 150 insertions(+), 4 deletions(-)

-- 
2.26.2


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

* [PATCH net-next v6 1/4] dt-bindings: net: Add tx and rx internal delays
  2020-06-04 11:14 [PATCH net-next v6 0/4] RGMII Internal delay common property Dan Murphy
@ 2020-06-04 11:14 ` Dan Murphy
  2020-06-15 17:33   ` Rob Herring
  2020-06-04 11:14 ` [PATCH net-next v6 2/4] net: phy: Add a helper to return the index for of the internal delay Dan Murphy
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Dan Murphy @ 2020-06-04 11:14 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, robh
  Cc: netdev, linux-kernel, devicetree, Dan Murphy

tx-internal-delays and rx-internal-delays are a common setting for RGMII
capable devices.

These properties are used when the phy-mode or phy-controller is set to
rgmii-id, rgmii-rxid or rgmii-txid.  These modes indicate to the
controller that the PHY will add the internal delay for the connection.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 .../devicetree/bindings/net/ethernet-phy.yaml       | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
index 9b1f1147ca36..edd0245d132b 100644
--- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
@@ -162,6 +162,19 @@ properties:
     description:
       Specifies a reference to a node representing a SFP cage.
 
+
+  rx-internal-delay-ps:
+    $ref: /schemas/types.yaml#definitions/uint32
+    description: |
+      RGMII Receive PHY Clock Delay defined in pico seconds.  This is used for
+      PHY's that have configurable RX internal delays.
+
+  tx-internal-delay-ps:
+    $ref: /schemas/types.yaml#definitions/uint32
+    description: |
+      RGMII Transmit PHY Clock Delay defined in pico seconds.  This is used for
+      PHY's that have configurable TX internal delays.
+
 required:
   - reg
 
-- 
2.26.2


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

* [PATCH net-next v6 2/4] net: phy: Add a helper to return the index for of the internal delay
  2020-06-04 11:14 [PATCH net-next v6 0/4] RGMII Internal delay common property Dan Murphy
  2020-06-04 11:14 ` [PATCH net-next v6 1/4] dt-bindings: net: Add tx and rx internal delays Dan Murphy
@ 2020-06-04 11:14 ` Dan Murphy
  2020-06-04 11:14 ` [PATCH net-next v6 3/4] dt-bindings: net: Add RGMII internal delay for DP83869 Dan Murphy
  2020-06-04 11:14 ` [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration Dan Murphy
  3 siblings, 0 replies; 12+ messages in thread
From: Dan Murphy @ 2020-06-04 11:14 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, robh
  Cc: netdev, linux-kernel, devicetree, Dan Murphy

Add a helper function that will return the index in the array for the
passed in internal delay value.  The helper requires the array, size and
delay value.

The helper will then return the index for the exact match or return the
index for the index to the closest smaller value.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/net/phy/phy_device.c | 68 ++++++++++++++++++++++++++++++++++++
 include/linux/phy.h          |  4 +++
 2 files changed, 72 insertions(+)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 04946de74fa0..611d4e68e3c6 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -31,6 +31,7 @@
 #include <linux/mdio.h>
 #include <linux/io.h>
 #include <linux/uaccess.h>
+#include <linux/property.h>
 
 MODULE_DESCRIPTION("PHY library");
 MODULE_AUTHOR("Andy Fleming");
@@ -2657,6 +2658,73 @@ void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause)
 }
 EXPORT_SYMBOL(phy_get_pause);
 
+/**
+ * phy_get_delay_index - returns the index of the internal delay
+ * @phydev: phy_device struct
+ * @dev: pointer to the devices device struct
+ * @delay_values: array of delays the PHY supports
+ * @size: the size of the delay array
+ * @is_rx: boolean to indicate to get the rx internal delay
+ *
+ * Returns the index within the array of internal delay passed in.
+ * Or if size == 0 then the delay read from the firmware is returned.
+ * The array must be in ascending order.
+ * Return errno if the delay is invalid or cannot be found.
+ */
+s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
+			   const int *delay_values, int size, bool is_rx)
+{
+	int ret;
+	int i;
+	s32 delay;
+
+	if (is_rx)
+		ret = device_property_read_u32(dev, "rx-internal-delay-ps",
+					       &delay);
+	else
+		ret = device_property_read_u32(dev, "tx-internal-delay-ps",
+					       &delay);
+	if (ret) {
+		phydev_err(phydev, "internal delay not defined\n");
+		return -EINVAL;
+	}
+
+	if (delay < 0)
+		return -EINVAL;
+
+	if (size <= 0)
+		return delay;
+
+	if (delay < delay_values[0] || delay > delay_values[size - 1]) {
+		phydev_err(phydev, "Delay %d is out of range\n", delay);
+		return -EINVAL;
+	}
+
+	if (delay == delay_values[0])
+		return 0;
+
+	for (i = 1; i < size; i++) {
+		if (delay == delay_values[i])
+			return i;
+
+		/* Find an approximate index by looking up the table */
+		if (delay > delay_values[i - 1] &&
+		    delay < delay_values[i]) {
+			if (delay - delay_values[i - 1] <
+			    delay_values[i] - delay)
+				return i - 1;
+			else
+				return i;
+		}
+	}
+
+	phydev_err(phydev, "error finding internal delay index for %d\n",
+		   delay);
+
+	return -EINVAL;
+}
+EXPORT_SYMBOL(phy_get_internal_delay);
+
 static bool phy_drv_supports_irq(struct phy_driver *phydrv)
 {
 	return phydrv->config_intr && phydrv->ack_interrupt;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 8c05d0fb5c00..917bfd422e06 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1430,6 +1430,10 @@ void phy_set_asym_pause(struct phy_device *phydev, bool rx, bool tx);
 bool phy_validate_pause(struct phy_device *phydev,
 			struct ethtool_pauseparam *pp);
 void phy_get_pause(struct phy_device *phydev, bool *tx_pause, bool *rx_pause);
+
+s32 phy_get_internal_delay(struct phy_device *phydev, struct device *dev,
+			   const int *delay_values, int size, bool is_rx);
+
 void phy_resolve_pause(unsigned long *local_adv, unsigned long *partner_adv,
 		       bool *tx_pause, bool *rx_pause);
 
-- 
2.26.2


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

* [PATCH net-next v6 3/4] dt-bindings: net: Add RGMII internal delay for DP83869
  2020-06-04 11:14 [PATCH net-next v6 0/4] RGMII Internal delay common property Dan Murphy
  2020-06-04 11:14 ` [PATCH net-next v6 1/4] dt-bindings: net: Add tx and rx internal delays Dan Murphy
  2020-06-04 11:14 ` [PATCH net-next v6 2/4] net: phy: Add a helper to return the index for of the internal delay Dan Murphy
@ 2020-06-04 11:14 ` Dan Murphy
  2020-06-15 17:34   ` Rob Herring
  2020-06-04 11:14 ` [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration Dan Murphy
  3 siblings, 1 reply; 12+ messages in thread
From: Dan Murphy @ 2020-06-04 11:14 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, robh
  Cc: netdev, linux-kernel, devicetree, Dan Murphy

Add the internal delay values into the header and update the binding
with the internal delay properties.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 .../devicetree/bindings/net/ti,dp83869.yaml      | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/ti,dp83869.yaml b/Documentation/devicetree/bindings/net/ti,dp83869.yaml
index 5b69ef03bbf7..71e90a3e4652 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83869.yaml
+++ b/Documentation/devicetree/bindings/net/ti,dp83869.yaml
@@ -8,7 +8,7 @@ $schema: "http://devicetree.org/meta-schemas/core.yaml#"
 title: TI DP83869 ethernet PHY
 
 allOf:
-  - $ref: "ethernet-controller.yaml#"
+  - $ref: "ethernet-phy.yaml#"
 
 maintainers:
   - Dan Murphy <dmurphy@ti.com>
@@ -64,6 +64,18 @@ properties:
        Operational mode for the PHY.  If this is not set then the operational
        mode is set by the straps. see dt-bindings/net/ti-dp83869.h for values
 
+  rx-internal-delay-ps:
+    description: Delay is in pico seconds
+    enum: [ 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000,
+            3250, 3500, 3750, 4000 ]
+    default: 2000
+
+  tx-internal-delay-ps:
+    description: Delay is in pico seconds
+    enum: [ 250, 500, 750, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000,
+            3250, 3500, 3750, 4000 ]
+    default: 2000
+
 required:
   - reg
 
@@ -80,5 +92,7 @@ examples:
         ti,op-mode = <DP83869_RGMII_COPPER_ETHERNET>;
         ti,max-output-impedance = "true";
         ti,clk-output-sel = <DP83869_CLK_O_SEL_CHN_A_RCLK>;
+        rx-internal-delay-ps = <2000>;
+        tx-internal-delay-ps = <2000>;
       };
     };
-- 
2.26.2


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

* [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration
  2020-06-04 11:14 [PATCH net-next v6 0/4] RGMII Internal delay common property Dan Murphy
                   ` (2 preceding siblings ...)
  2020-06-04 11:14 ` [PATCH net-next v6 3/4] dt-bindings: net: Add RGMII internal delay for DP83869 Dan Murphy
@ 2020-06-04 11:14 ` Dan Murphy
  2020-06-04 16:25   ` Jakub Kicinski
  2020-06-04 21:09   ` kernel test robot
  3 siblings, 2 replies; 12+ messages in thread
From: Dan Murphy @ 2020-06-04 11:14 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, robh
  Cc: netdev, linux-kernel, devicetree, Dan Murphy

Add RGMII internal delay configuration for Rx and Tx.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/net/phy/dp83869.c | 53 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 50 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index cfb22a21a2e6..801341edbe31 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -64,6 +64,10 @@
 #define DP83869_RGMII_TX_CLK_DELAY_EN		BIT(1)
 #define DP83869_RGMII_RX_CLK_DELAY_EN		BIT(0)
 
+/* RGMIIDCTL */
+#define DP83869_RGMII_CLK_DELAY_SHIFT		4
+#define DP83869_CLK_DELAY_DEF			7
+
 /* STRAP_STS1 bits */
 #define DP83869_STRAP_OP_MODE_MASK		GENMASK(2, 0)
 #define DP83869_STRAP_STS1_RESERVED		BIT(11)
@@ -78,9 +82,6 @@
 #define DP83869_PHYCR_FIFO_DEPTH_MASK	GENMASK(15, 12)
 #define DP83869_PHYCR_RESERVED_MASK	BIT(11)
 
-/* RGMIIDCTL bits */
-#define DP83869_RGMII_TX_CLK_DELAY_SHIFT	4
-
 /* IO_MUX_CFG bits */
 #define DP83869_IO_MUX_CFG_IO_IMPEDANCE_CTRL	0x1f
 
@@ -99,6 +100,10 @@
 #define DP83869_OP_MODE_MII			BIT(5)
 #define DP83869_SGMII_RGMII_BRIDGE		BIT(6)
 
+static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
+					     1750, 2000, 2250, 2500, 2750, 3000,
+					     3250, 3500, 3750, 4000};
+
 enum {
 	DP83869_PORT_MIRRORING_KEEP,
 	DP83869_PORT_MIRRORING_EN,
@@ -108,6 +113,8 @@ enum {
 struct dp83869_private {
 	int tx_fifo_depth;
 	int rx_fifo_depth;
+	s32 rx_id_delay;
+	s32 tx_id_delay;
 	int io_impedance;
 	int port_mirroring;
 	bool rxctrl_strap_quirk;
@@ -182,6 +189,7 @@ static int dp83869_of_init(struct phy_device *phydev)
 	struct dp83869_private *dp83869 = phydev->priv;
 	struct device *dev = &phydev->mdio.dev;
 	struct device_node *of_node = dev->of_node;
+	int delay_size = ARRAY_SIZE(dp83869_internal_delay);
 	int ret;
 
 	if (!of_node)
@@ -232,6 +240,20 @@ static int dp83869_of_init(struct phy_device *phydev)
 				 &dp83869->tx_fifo_depth))
 		dp83869->tx_fifo_depth = DP83869_PHYCR_FIFO_DEPTH_4_B_NIB;
 
+	dp83869->rx_id_delay = phy_get_internal_delay(phydev, dev,
+						     &dp83869_internal_delay[0],
+						      delay_size, true);
+	if (dp83869->rx_id_delay < 0)
+		dp83869->rx_id_delay =
+				dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
+
+	dp83869->tx_id_delay = phy_get_internal_delay(phydev, dev,
+						     &dp83869_internal_delay[0],
+						      delay_size, false);
+	if (dp83869->tx_id_delay < 0)
+		dp83869->tx_id_delay =
+				dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
+
 	return ret;
 }
 #else
@@ -394,6 +416,31 @@ static int dp83869_config_init(struct phy_device *phydev)
 				     dp83869->clk_output_sel <<
 				     DP83869_IO_MUX_CFG_CLK_O_SEL_SHIFT);
 
+	if (phy_interface_is_rgmii(phydev)) {
+		ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_RGMIIDCTL,
+				    dp83869->rx_id_delay |
+			dp83869->tx_id_delay << DP83869_RGMII_CLK_DELAY_SHIFT);
+		if (ret)
+			return ret;
+
+		val = phy_read_mmd(phydev, DP83869_DEVADDR, DP83869_RGMIICTL);
+		val &= ~(DP83869_RGMII_TX_CLK_DELAY_EN |
+			 DP83869_RGMII_RX_CLK_DELAY_EN);
+
+		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
+			val |= (DP83869_RGMII_TX_CLK_DELAY_EN |
+				DP83869_RGMII_RX_CLK_DELAY_EN);
+
+		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
+			val |= DP83869_RGMII_TX_CLK_DELAY_EN;
+
+		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
+			val |= DP83869_RGMII_RX_CLK_DELAY_EN;
+
+		ret = phy_write_mmd(phydev, DP83869_DEVADDR, DP83869_RGMIICTL,
+				    val);
+	}
+
 	return ret;
 }
 
-- 
2.26.2


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

* Re: [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration
  2020-06-04 11:14 ` [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration Dan Murphy
@ 2020-06-04 16:25   ` Jakub Kicinski
  2020-06-04 16:38     ` Dan Murphy
  2020-06-04 21:09   ` kernel test robot
  1 sibling, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2020-06-04 16:25 UTC (permalink / raw)
  To: Dan Murphy
  Cc: andrew, f.fainelli, hkallweit1, davem, robh, netdev,
	linux-kernel, devicetree

On Thu, 4 Jun 2020 06:14:10 -0500 Dan Murphy wrote:
> Add RGMII internal delay configuration for Rx and Tx.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>

Hi Dan, please make sure W=1 C=1 build is clean:

drivers/net/phy/dp83869.c:103:18: warning: ‘dp83869_internal_delay’ defined but not used [-Wunused-const-variable=]
  103 | static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
      |                  ^~~~~~~~~~~~~~~~~~~~~~

Also net-next is closed right now, you can post RFCs but normal patches
should be deferred until after net-next reopens.

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

* Re: [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration
  2020-06-04 16:25   ` Jakub Kicinski
@ 2020-06-04 16:38     ` Dan Murphy
  2020-06-04 16:48       ` Jakub Kicinski
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Murphy @ 2020-06-04 16:38 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: andrew, f.fainelli, hkallweit1, davem, robh, netdev,
	linux-kernel, devicetree

Jakub

On 6/4/20 11:25 AM, Jakub Kicinski wrote:
> On Thu, 4 Jun 2020 06:14:10 -0500 Dan Murphy wrote:
>> Add RGMII internal delay configuration for Rx and Tx.
>>
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> Hi Dan, please make sure W=1 C=1 build is clean:
>
> drivers/net/phy/dp83869.c:103:18: warning: ‘dp83869_internal_delay’ defined but not used [-Wunused-const-variable=]
>    103 | static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
>        |                  ^~~~~~~~~~~~~~~~~~~~~~

I built with W=1 and C=1 and did not see this warning.

What defconfig are you using?

Can you check if CONFIG_OF_MDIO is set or not?  That would be the only 
way that warning would come up.

> Also net-next is closed right now, you can post RFCs but normal patches
> should be deferred until after net-next reopens.

I know net-next is closed.

I pinged David M when it was open about what is meant by "new" patches 
in the net-dev FAQ.  So I figured I would send the patches to see what 
the response was.

To me these are not new they are in process patches.  My understand is 
New is v1 patchesets.

But now I have the answer.

Dan


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

* Re: [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration
  2020-06-04 16:38     ` Dan Murphy
@ 2020-06-04 16:48       ` Jakub Kicinski
  2020-06-04 20:27         ` Dan Murphy
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2020-06-04 16:48 UTC (permalink / raw)
  To: Dan Murphy
  Cc: andrew, f.fainelli, hkallweit1, davem, robh, netdev,
	linux-kernel, devicetree

On Thu, 4 Jun 2020 11:38:14 -0500 Dan Murphy wrote:
> Jakub
> 
> On 6/4/20 11:25 AM, Jakub Kicinski wrote:
> > On Thu, 4 Jun 2020 06:14:10 -0500 Dan Murphy wrote:  
> >> Add RGMII internal delay configuration for Rx and Tx.
> >>
> >> Signed-off-by: Dan Murphy <dmurphy@ti.com>  
> > Hi Dan, please make sure W=1 C=1 build is clean:
> >
> > drivers/net/phy/dp83869.c:103:18: warning: ‘dp83869_internal_delay’ defined but not used [-Wunused-const-variable=]
> >    103 | static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
> >        |                  ^~~~~~~~~~~~~~~~~~~~~~  
> 
> I built with W=1 and C=1 and did not see this warning.
> 
> What defconfig are you using?

allmodconfig with gcc-10

> Can you check if CONFIG_OF_MDIO is set or not?  That would be the only 
> way that warning would come up.

Hm. I don't have the config from this particular build but just running
allmodconfig makes it CONFIG_OF_MDIO=m

> > Also net-next is closed right now, you can post RFCs but normal patches
> > should be deferred until after net-next reopens.  
> 
> I know net-next is closed.
> 
> I pinged David M when it was open about what is meant by "new" patches 
> in the net-dev FAQ.  So I figured I would send the patches to see what 
> the response was.
> 
> To me these are not new they are in process patches.  My understand is 
> New is v1 patchesets.
> 
> But now I have the answer.

Oh sorry, I may be wrong in this case, I haven't tracked this series.


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

* Re: [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration
  2020-06-04 16:48       ` Jakub Kicinski
@ 2020-06-04 20:27         ` Dan Murphy
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Murphy @ 2020-06-04 20:27 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: andrew, f.fainelli, hkallweit1, davem, robh, netdev,
	linux-kernel, devicetree

Jakub

On 6/4/20 11:48 AM, Jakub Kicinski wrote:
> On Thu, 4 Jun 2020 11:38:14 -0500 Dan Murphy wrote:
>> Jakub
>>
>> On 6/4/20 11:25 AM, Jakub Kicinski wrote:
>>> On Thu, 4 Jun 2020 06:14:10 -0500 Dan Murphy wrote:
>>>> Add RGMII internal delay configuration for Rx and Tx.
>>>>
>>>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>>> Hi Dan, please make sure W=1 C=1 build is clean:
>>>
>>> drivers/net/phy/dp83869.c:103:18: warning: ‘dp83869_internal_delay’ defined but not used [-Wunused-const-variable=]
>>>     103 | static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
>>>         |                  ^~~~~~~~~~~~~~~~~~~~~~
>> I built with W=1 and C=1 and did not see this warning.
>>
>> What defconfig are you using?
> allmodconfig with gcc-10
>
>> Can you check if CONFIG_OF_MDIO is set or not?  That would be the only
>> way that warning would come up.
> Hm. I don't have the config from this particular build but just running
> allmodconfig makes it CONFIG_OF_MDIO=m

OK that makes sense then.  That is an existing bug that shows up because 
of this.

#ifdef CONFIG_OF_MDIO

So the addition of the array exposed an existing issue.

That bug fix can go to net then.
>>> Also net-next is closed right now, you can post RFCs but normal patches
>>> should be deferred until after net-next reopens.
>> I know net-next is closed.
>>
>> I pinged David M when it was open about what is meant by "new" patches
>> in the net-dev FAQ.  So I figured I would send the patches to see what
>> the response was.
>>
>> To me these are not new they are in process patches.  My understand is
>> New is v1 patchesets.
>>
>> But now I have the answer.
> Oh sorry, I may be wrong in this case, I haven't tracked this series.
>
It says v6 in $subject.

But still you may be correct I don't know

Dan


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

* Re: [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration
  2020-06-04 11:14 ` [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration Dan Murphy
  2020-06-04 16:25   ` Jakub Kicinski
@ 2020-06-04 21:09   ` kernel test robot
  1 sibling, 0 replies; 12+ messages in thread
From: kernel test robot @ 2020-06-04 21:09 UTC (permalink / raw)
  To: Dan Murphy, andrew, f.fainelli, hkallweit1, davem, robh
  Cc: kbuild-all, clang-built-linux, netdev, linux-kernel, devicetree,
	Dan Murphy

[-- Attachment #1: Type: text/plain, Size: 2023 bytes --]

Hi Dan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on robh/for-next sparc-next/master net/master linus/master v5.7 next-20200604]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Dan-Murphy/RGMII-Internal-delay-common-property/20200605-003113
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git cb8e59cc87201af93dfbb6c3dccc8fcad72a09c2
config: x86_64-allmodconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project ac47588bc4ff5927a01ed6fcd269ce86aba52a7c)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/net/phy/dp83869.c:103:18: warning: unused variable 'dp83869_internal_delay' [-Wunused-const-variable]
static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
^
1 warning generated.

vim +/dp83869_internal_delay +103 drivers/net/phy/dp83869.c

   102	
 > 103	static const int dp83869_internal_delay[] = {250, 500, 750, 1000, 1250, 1500,
   104						     1750, 2000, 2250, 2500, 2750, 3000,
   105						     3250, 3500, 3750, 4000};
   106	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 74498 bytes --]

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

* Re: [PATCH net-next v6 1/4] dt-bindings: net: Add tx and rx internal delays
  2020-06-04 11:14 ` [PATCH net-next v6 1/4] dt-bindings: net: Add tx and rx internal delays Dan Murphy
@ 2020-06-15 17:33   ` Rob Herring
  0 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2020-06-15 17:33 UTC (permalink / raw)
  To: Dan Murphy
  Cc: andrew, f.fainelli, hkallweit1, davem, netdev, linux-kernel, devicetree

On Thu, Jun 04, 2020 at 06:14:07AM -0500, Dan Murphy wrote:
> tx-internal-delays and rx-internal-delays are a common setting for RGMII
> capable devices.
> 
> These properties are used when the phy-mode or phy-controller is set to
> rgmii-id, rgmii-rxid or rgmii-txid.  These modes indicate to the
> controller that the PHY will add the internal delay for the connection.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  .../devicetree/bindings/net/ethernet-phy.yaml       | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> index 9b1f1147ca36..edd0245d132b 100644
> --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
> @@ -162,6 +162,19 @@ properties:
>      description:
>        Specifies a reference to a node representing a SFP cage.
>  
> +
> +  rx-internal-delay-ps:
> +    $ref: /schemas/types.yaml#definitions/uint32

Standard units already have a type, so you can drop this.

> +    description: |
> +      RGMII Receive PHY Clock Delay defined in pico seconds.  This is used for
> +      PHY's that have configurable RX internal delays.
> +
> +  tx-internal-delay-ps:
> +    $ref: /schemas/types.yaml#definitions/uint32
> +    description: |
> +      RGMII Transmit PHY Clock Delay defined in pico seconds.  This is used for
> +      PHY's that have configurable TX internal delays.
> +
>  required:
>    - reg
>  
> -- 
> 2.26.2
> 

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

* Re: [PATCH net-next v6 3/4] dt-bindings: net: Add RGMII internal delay for DP83869
  2020-06-04 11:14 ` [PATCH net-next v6 3/4] dt-bindings: net: Add RGMII internal delay for DP83869 Dan Murphy
@ 2020-06-15 17:34   ` Rob Herring
  0 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2020-06-15 17:34 UTC (permalink / raw)
  To: Dan Murphy
  Cc: andrew, davem, linux-kernel, netdev, devicetree, f.fainelli, hkallweit1

On Thu, 04 Jun 2020 06:14:09 -0500, Dan Murphy wrote:
> Add the internal delay values into the header and update the binding
> with the internal delay properties.
> 
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>  .../devicetree/bindings/net/ti,dp83869.yaml      | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2020-06-15 17:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 11:14 [PATCH net-next v6 0/4] RGMII Internal delay common property Dan Murphy
2020-06-04 11:14 ` [PATCH net-next v6 1/4] dt-bindings: net: Add tx and rx internal delays Dan Murphy
2020-06-15 17:33   ` Rob Herring
2020-06-04 11:14 ` [PATCH net-next v6 2/4] net: phy: Add a helper to return the index for of the internal delay Dan Murphy
2020-06-04 11:14 ` [PATCH net-next v6 3/4] dt-bindings: net: Add RGMII internal delay for DP83869 Dan Murphy
2020-06-15 17:34   ` Rob Herring
2020-06-04 11:14 ` [PATCH net-next v6 4/4] net: dp83869: Add RGMII internal delay configuration Dan Murphy
2020-06-04 16:25   ` Jakub Kicinski
2020-06-04 16:38     ` Dan Murphy
2020-06-04 16:48       ` Jakub Kicinski
2020-06-04 20:27         ` Dan Murphy
2020-06-04 21:09   ` kernel test robot

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