Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	wsa+renesas@sang-engineering.com
Subject: Re: [PATCH net-next v5 05/10] net: ethernet: ravb: Propagate error from ptp_clock_register()
Date: Tue, 22 Sep 2026 17:51:38 +0000	[thread overview]
Message-ID: <20260922175138.C35161F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260921175037.4084310-6-niklas.soderlund+renesas@ragnatech.se>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] net: ravb: ethtool timestamping capabilities are incorrectly suppressed when interface is down
--

commit bba7bddbe4fcaec0df4875259d8239664ffaa696
Author: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

net: ethernet: ravb: Propagate error from ptp_clock_register()

If the PTP clock registration failed, the error is silently ignored. This
commit reworks callers of ravb_ptp_init() to handle and propagate the error.
It also updates how the PHC index is handled.

Link: https://sashiko.dev/#/patchset/20260610102432.3538432-2-niklas.soderlund+renesas@ragnatech.se?part=1

> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1774,7 +1774,7 @@ static int ravb_get_ts_info(struct net_device *ndev,
>  	struct ravb_private *priv = netdev_priv(ndev);
>  	const struct ravb_hw_info *hw_info = priv->info;
>  
> -	if (hw_info->gptp || hw_info->ccc_gac) {
> +	if (priv->ptp.clock && (hw_info->gptp || hw_info->ccc_gac)) {

[Severity: Medium]
Does this new condition incorrectly suppress the static ethtool timestamping 
capabilities when the interface is administratively down?

If a userspace tool calls ethtool -T on the interface while it is in the down
state, priv->ptp.clock will be NULL since the clock is only active while the 
interface is open. By checking priv->ptp.clock here, ravb_get_ts_info() 
completely skips reporting static capabilities like SOF_TIMESTAMPING_TX_SOFTWARE 
and SOF_TIMESTAMPING_TX_HARDWARE.

Could the priv->ptp.clock check be moved so that it only guards the
info->phc_index assignment below, rather than the entire capabilities block?

>  		info->so_timestamping =
>  			SOF_TIMESTAMPING_TX_SOFTWARE |
>  			SOF_TIMESTAMPING_TX_HARDWARE |
> @@ -1785,7 +1785,7 @@ static int ravb_get_ts_info(struct net_device *ndev,
>  			(1 << HWTSTAMP_FILTER_NONE) |
>  			(1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
>  			(1 << HWTSTAMP_FILTER_ALL);
> -		info->phc_index = READ_ONCE(priv->ptp.phc_index);
> +		info->phc_index = ptp_clock_index(priv->ptp.clock);
>  	}

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260921175037.4084310-1-niklas.soderlund+renesas@ragnatech.se?part=5

  reply	other threads:[~2026-09-22 17:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 17:50 [PATCH net-next v5 00/10] ravb: Add gPTP support for Gen4 Niklas Söderlund
2026-09-21 17:50 ` [PATCH net-next v5 01/10] net: ethernet: ravb: Remove gPTP control from WoL setup and restore Niklas Söderlund
2026-09-22 17:51   ` sashiko-bot
2026-09-24 11:51   ` netdev-bot+sashiko
2026-09-21 17:50 ` [PATCH net-next v5 02/10] net: ethernet: ravb: Move programming of gPTP timer interval Niklas Söderlund
2026-09-24 11:51   ` netdev-bot+sashiko
2026-09-21 17:50 ` [PATCH net-next v5 03/10] net: ethernet: ravb: Simplify gPTP start and stop Niklas Söderlund
2026-09-22 17:51   ` sashiko-bot
2026-09-24 11:51   ` netdev-bot+sashiko
2026-09-21 17:50 ` [PATCH net-next v5 04/10] net: ethernet: ravb: Remove redundant argument to ravb_ptp_init() Niklas Söderlund
2026-09-21 17:50 ` [PATCH net-next v5 05/10] net: ethernet: ravb: Propagate error from ptp_clock_register() Niklas Söderlund
2026-09-22 17:51   ` sashiko-bot [this message]
2026-09-24 11:51   ` netdev-bot+sashiko
2026-09-21 17:50 ` [PATCH net-next v5 06/10] net: ethernet: ravb: Replace gPTP flags with callbacks Niklas Söderlund
2026-09-24 11:51   ` netdev-bot+sashiko
2026-09-21 17:50 ` [PATCH net-next v5 07/10] net: ethernet: ravb: Add callback for gPTP probe Niklas Söderlund
2026-09-21 17:50 ` [PATCH net-next v5 08/10] net: ethernet: ravb: Add callback for gPTP clock index Niklas Söderlund
2026-09-21 17:50 ` [PATCH net-next v5 09/10] dt-bindings: net: renesas,etheravb: Add optional gPTP phandle for Gen4 Niklas Söderlund
2026-09-21 17:50 ` [PATCH net-next v5 10/10] net: ethernet: ravb: Add gPTP support " Niklas Söderlund
2026-09-22 17:51   ` sashiko-bot
2026-09-24 11:51   ` netdev-bot+sashiko
2026-09-25 23:45 ` [PATCH net-next v5 00/10] " Jakub Kicinski
2026-09-25 23:50 ` patchwork-bot+netdevbpf

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=20260922175138.C35161F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox