From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Sergey Shtylyov <sergei.shtylyov@gmail.com>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Richard Cochran <richardcochran@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"DavidS. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Vadim Fedorenko <vadim.fedorenko@linux.dev>,
linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 10/10] net: ethernet: ravb: Add gPTP support for Gen4
Date: Wed, 2 Sep 2026 10:43:16 +0200 [thread overview]
Message-ID: <20260902084316.GD1116206@ragnatech.se> (raw)
In-Reply-To: <f140a168-0f92-4507-bf07-f5297ad92159@gmail.com>
Hi Sergey,
Thanks for your feedback.
On 2026-08-15 22:12:03 +0300, Sergey Shtylyov wrote:
> On 8/11/26 7:02 PM, Niklas Söderlund wrote:
>
> > While driver advertises gPTP support on Gen4 platforms it is in fact
> > completely broken. On R-Car Gen4 devices the RAVB module have no
> > internal gPTP clock as generations before it. Instead it utilizes a
> > system-wide gPTP clock.
> >
> > This change utilizes the refactoring of the RAVB gPTP code to add
> > support for a system-wide clock and stops the Gen4 devices trying to use
> > the non-existing internal gPTP clock.
> >
> > To remain backward compatible the ptp-timer property is optional.If not
> > present, or not enabled, the RAVB driver will no longer advertise gPTP
> > support to user-space.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > Reviewed-by: Sergey Shtylyov <sergei.shtylyov@gmail.com>
> [...]
>
> > diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h
> > index b4df5cab0e5c..4c8dc02022e2 100644
> > --- a/drivers/net/ethernet/renesas/ravb.h
> > +++ b/drivers/net/ethernet/renesas/ravb.h
> > @@ -249,6 +249,8 @@ enum APSR_BIT {
> > APSR_RDM = 0x00002000,
> > APSR_TDM = 0x00004000,
> > APSR_MIISELECT = 0x01000000, /* R-Car V4M only */
> > + APSR_GPTPTIMER_SOURCE = BIT(25), /* Gen4 */
> > + APSR_GPTPCLOCK = BIT(29), /* Gen4 */
>
> Again, I don't quite like that you switched to using BIT() all of a sudden...
Indeed, the while enum should really be converted to avoid LLM warnings.
But doing this in this already large and way overdue series feels a bit
too much. Once this is picked up I plan to convert them all to BIT macro
to make life easier for the future.
>
> [...]> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> > index 12877a8488ed..30170e92d3d7 100644
> > --- a/drivers/net/ethernet/renesas/ravb_main.c
> > +++ b/drivers/net/ethernet/renesas/ravb_main.c
> > @@ -2752,6 +2752,59 @@ static const struct ravb_hw_info ravb_gen3_hw_info = {
> > .magic_pkt = 1,
> > };
> >
> > +static int ravb_gen4_ptp_probe(struct net_device *ndev)
> > +{
> > + struct ravb_private *priv = netdev_priv(ndev);
> > +
> > + priv->of_gptp =
> > + of_parse_phandle(priv->pdev->dev.of_node, "ptp-timer", 0);
>
> You now have full 100 columns, no need to break that line... :-)
Fixed in next version.
>
> > + if (!priv->of_gptp)
> > + return 0;
> > +
> > + if (!of_device_is_available(priv->of_gptp)) {
> > + of_node_put(priv->of_gptp);
> > + priv->of_gptp = NULL;
> > + return 0;
>
> This *return* seems superfluous...
Thanks, fixed.
>
> > + }
> > +
> > + return 0;
> > +}[...]
>
> MBR, Sergey
>
--
Kind Regards,
Niklas Söderlund
prev parent reply other threads:[~2026-09-02 8:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 16:01 [PATCH net-next v2 00/10] ravb: Add gPTP support for Gen4 Niklas Söderlund
2026-08-11 16:01 ` [PATCH net-next v2 01/10] net: ethernet: ravb: Remove gPTP control from WoL setup and restore Niklas Söderlund
2026-08-11 16:01 ` [PATCH net-next v2 02/10] net: ethernet: ravb: Move programming of gPTP timer interval Niklas Söderlund
2026-08-11 16:01 ` [PATCH net-next v2 03/10] net: ethernet: ravb: Simplify gPTP start and stop Niklas Söderlund
2026-08-15 18:30 ` Sergey Shtylyov
2026-08-11 16:01 ` [PATCH net-next v2 04/10] net: ethernet: ravb: Remove redundant argument to ravb_ptp_init() Niklas Söderlund
2026-08-11 16:01 ` [PATCH net-next v2 05/10] net: ethernet: ravb: Propagate error from ptp_clock_register() Niklas Söderlund
2026-08-15 18:40 ` Sergey Shtylyov
2026-08-11 16:01 ` [PATCH net-next v2 06/10] net: ethernet: ravb: Replace gPTP flags with callbacks Niklas Söderlund
2026-08-11 16:01 ` [PATCH net-next v2 07/10] net: ethernet: ravb: Add callback for gPTP probe Niklas Söderlund
2026-08-11 16:01 ` [PATCH net-next v2 08/10] net: ethernet: ravb: Add callback for gPTP clock index Niklas Söderlund
2026-08-11 16:01 ` [PATCH net-next v2 09/10] dt-bindings: net: renesas,etheravb: Add optional gPTP phandle for Gen4 Niklas Söderlund
2026-08-13 8:48 ` Krzysztof Kozlowski
2026-08-11 16:02 ` [PATCH net-next v2 10/10] net: ethernet: ravb: Add gPTP support " Niklas Söderlund
2026-08-15 19:12 ` Sergey Shtylyov
2026-09-02 8:43 ` Niklas Söderlund [this message]
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=20260902084316.GD1116206@ragnatech.se \
--to=niklas.soderlund+renesas@ragnatech.se \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=geert+renesas@glider.be \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=sergei.shtylyov@gmail.com \
--cc=vadim.fedorenko@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox