Thread (53 messages) flat view 53 messages, 5 authors, 2021-08-28

RE: [PATCH net-next 04/13] ravb: Add ptp_cfg_active to struct ravb_hw_info

From: Biju Das <biju.das.jz@bp.renesas.com>
Date: 2021-08-26 10:34:50
Also in: linux-renesas-soc

Hi Sergei,
Subject: Re: [PATCH net-next 04/13] ravb: Add ptp_cfg_active to struct
ravb_hw_info

On 26.08.2021 9:20, Biju Das wrote:

[...]
quoted
quoted
quoted
There are some H/W differences for the gPTP feature between R-Car
Gen3, R-Car Gen2, and RZ/G2L as below.

1) On R-Car Gen3, gPTP support is active in config mode.
2) On R-Car Gen2, gPTP support is not active in config mode.
3) RZ/G2L does not support the gPTP feature.

Add a ptp_cfg_active hw feature bit to struct ravb_hw_info for
supporting gPTP active in config mode for R-Car Gen3.
    Wait, we've just done this ion the previous patch!
quoted
This patch also removes enum ravb_chip_id, chip_id from both struct
ravb_hw_info and struct ravb_private, as it is unused.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
  drivers/net/ethernet/renesas/ravb.h      |  8 +-------
  drivers/net/ethernet/renesas/ravb_main.c | 12 +++++-------
  2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/renesas/ravb.h
b/drivers/net/ethernet/renesas/ravb.h
index 9ecf1a8c3ca8..209e030935aa 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -979,17 +979,11 @@ struct ravb_ptp {
  	struct ravb_ptp_perout perout[N_PER_OUT];  };

-enum ravb_chip_id {
-	RCAR_GEN2,
-	RCAR_GEN3,
-};
-
  struct ravb_hw_info {
  	const char (*gstrings_stats)[ETH_GSTRING_LEN];
  	size_t gstrings_size;
  	netdev_features_t net_hw_features;
  	netdev_features_t net_features;
-	enum ravb_chip_id chip_id;
  	int stats_len;
  	size_t max_rx_len;
    I would put the above in a spearte patch...
    Separate. :-)
quoted
quoted
quoted
  	unsigned aligned_tx: 1;
@@ -999,6 +993,7 @@ struct ravb_hw_info {
  	unsigned tx_counters:1;		/* E-MAC has TX counters */
  	unsigned multi_irqs:1;		/* AVB-DMAC and E-MAC has
multiple
quoted
quoted
irqs */
quoted
  	unsigned no_ptp_cfg_active:1;	/* AVB-DMAC does not support
gPTP
quoted
quoted
active in config mode */
quoted
+	unsigned ptp_cfg_active:1;	/* AVB-DMAC has gPTP support active in
config mode */

    Huh?
quoted
  };

  struct ravb_private {
[...]
quoted
@@ -2216,7 +2213,7 @@ static int ravb_probe(struct platform_device
*pdev)
quoted
  	INIT_LIST_HEAD(&priv->ts_skb_list);

  	/* Initialise PTP Clock driver */
-	if (info->chip_id != RCAR_GEN2)
+	if (info->ptp_cfg_active)
  		ravb_ptp_init(ndev, pdev);
    What's that? Didn't you touch this lie in patch #3?

    This seems lie a NAK bait... :-(
Please refer the original patch[1] which introduced gPTP support active
in config mode.
quoted
I am sure this will clear all your doubts.
    It hasn't. Why do we need 2 bit fields (1 "positive" and 1 "negative")
for the same feature is beyond me.
The reason is mentioned in commit description, Do you agree 1, 2 and 3 mutually exclusive?

1) On R-Car Gen3, gPTP support is active in config mode.
2) On R-Car Gen2, gPTP support is not active in config mode.
3) RZ/G2L does not support the gPTP feature.

Regards,
Biju
quoted
[1]
https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.
kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fnext%2Flinux-next.git%
2Fcommit%2Fdrivers%2Fnet%2Fethernet%2Frenesas%2Fravb_main.c%3Fh%3Dnext
-20210825%26id%3Df5d7837f96e53a8c9b6c49e1bc95cf0ae88b99e8&amp;data=04%
7C01%7Cbiju.das.jz%40bp.renesas.com%7C142c7f172b4141617e7008d9687c7881
%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%7C637655706082218315%7CUnk
nown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWw
iLCJXVCI6Mn0%3D%7C1000&amp;sdata=Miy2q4JGEZpwLHlkGxlEBK8P0XAPzuHUX6xib
FS8nDs%3D&amp;reserved=0

Regards,
Biju
MBR, Sergey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help