🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #361

Re: [PATCH net 1/3] dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl

#361
From: netdev-bot+sashiko
Date: Wed, 07 Oct 2026 23:16
91 lines
9229 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] Declaring PTP_STRICT_FLAGS in dpaa2_ptp_caps also makes the
  legacy PTP_EXTTS_REQUEST (v1) ioctl strict on DPAA2, and the commit…

--

dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl

This patch sets .supported_extts_flags on dpaa2_ptp_caps to
PTP_RISING_EDGE | PTP_STRICT_FLAGS. With that set, the PTP core accepts
PTP_EXTTS_REQUEST2 on DPAA2 and rejects requests for the falling edge,
which the timer does not support.

> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
> index 4497e3c0456d1..ac2b873dcf8e6 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
> @@ -78,6 +78,7 @@ static const struct ptp_clock_info dpaa2_ptp_caps = {
>  	.n_per_out	= 3,
>  	.n_pins		= 0,
>  	.pps		= 1,
> +	.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,

[Severity: Medium]
Does declaring PTP_STRICT_FLAGS here also make the legacy
PTP_EXTTS_REQUEST ioctl strict on DPAA2?

In ptp_extts_request() in drivers/ptp/ptp_chardev.c, v1 requests are
only masked to PTP_EXTTS_V1_VALID_FLAGS. They then go through the same
supported-flags check as v2:

	} else {
		req.extts.flags &= PTP_EXTTS_V1_VALID_FLAGS;
		memset(req.extts.rsv, 0, sizeof(req.extts.rsv));
	}
	[ ... ]
	if (!(supported_extts_flags & PTP_STRICT_FLAGS))
		supported_extts_flags |= PTP_EXTTS_EDGES;
	/* Reject unsupported flags */
	if (req.extts.flags & ~supported_extts_flags)
		return -EOPNOTSUPP;

Before this patch, supported_extts_flags was 0. The effective mask was
therefore ENABLE | RISING | FALLING, and v1 accepted any edge
combination as a hint.

After this patch the mask is ENABLE | RISING | STRICT. A v1 request
with PTP_ENABLE_FEATURE | PTP_FALLING_EDGE, or with both edge bits set,
now returns -EOPNOTSUPP before ops->enable() is called.

One in-tree caller hits this. tools/testing/selftests/ptp/testptp.c
run with -e N -E 2 or -E 3 sends the edge through the legacy ioctl:

	extts_request.flags = PTP_ENABLE_FEATURE | edge;
	if (ioctl(fd, PTP_EXTTS_REQUEST, &extts_request)) {
		perror("PTP_EXTTS_REQUEST");
		extts = 0;

That used to succeed on DPAA2. Now it fails and skips timestamp
collection.

Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") said that the edge flags are "merely 'hints' when
using the old PTP_EXTTS_REQUEST ioctl, and are not expected to be
enforced".

The commit message says falling-edge requests should be rejected. It
doesn't say that legacy v1 users are affected too, including the
both-edges hint case.

Should the commit message mention this change for PTP_EXTTS_REQUEST
users? The later patches in the series apply the same change to ENETC
and generic QorIQ PTP, so it would reach those devices as well.

>  	.adjfine	= ptp_qoriq_adjfine,
>  	.adjtime	= ptp_qoriq_adjtime,
>  	.gettime64	= ptp_qoriq_gettime,

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261006-for-upstream-qoriq-ptp-extts-flags-v1-0-b4a161b92832%40free.fr
Technical Details
Message-ID: <179141500147.434549.12688861703859466456@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342573-linux-kernel-netdev=dewy.ru
References: <20261006-for-upstream-qoriq-ptp-extts-flags-v1-1-b4a161b92832@free.fr>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342573-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/3] dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
Date: Wed, 07 Oct 2026 23:16:41 +0000
Organization: Usenet Network
Message-ID: <179141500147.434549.12688861703859466456@kernel.org>
References: <20261006-for-upstream-qoriq-ptp-extts-flags-v1-1-b4a161b92832@free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="757454"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:SfjrBc9a3PfhT5o+fvNeSwglXt8= sha256:CTa/+Wi1/zpKWn/6k9FZa+7ueWC5Xr8eHmaGDNrdpQo=
	sha1:t+I7iiim5IMgChxcVut8NtGqg2k= sha256:mqdYI8XFPmQBB46qGvriTmaToHYLwX9IvEBWfhs3Cik=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 3108710F272; Thu,  8 Oct 2026 02:17:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.641
X-Spam-Status: No, score=-3.641 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 4tx_4GQ6EM01;
	Thu,  8 Oct 2026 02:17:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-342573-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 02A3610F023; Thu,  8 Oct 2026 02:17:10 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 4F2892BB58; Wed,  7 Oct 2026 23:16:50 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 70F2F4B5CD2;
	Wed,  7 Oct 2026 23:16:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cp9GPU9v"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52FC934D4C9;
	Wed,  7 Oct 2026 23:16:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791415004; cv=none; b=pGJY2/WH9CGAYmokJdK3UnfPcsnLIknEjXfYICM9UVYWBdkFfhHXz7lLbVWk53TctbR/yEs5B+JVoenhQUH7RF0hQEo4nD4pB15CyvxhCojsXKwOiS74L+hDhGmgJ2mOPvBfOYZcKjcjnyUcC8Kj6AwgIdwiidSajYAOGKKJPSE=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791415004; c=relaxed/simple;
	bh=kZ9Yr/PGmtQqW9KEaAtn3on5T1ktFVVQ9yttOwMcZEw=;
	h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References:
	 Content-Type:MIME-Version; b=oqkKbAbggvWF6TN8VuzD5wiYuLFTHKD+zu2pBn40+xu36fnK48HNmeKLGnCHB2imz3PyDbVhFZ5h0Qb1xahhvN+KjMGtpSJf0fEtSmBFqJJ/6vkyE8Zuw39e/UdllXxg3YHPyb+CStvlbYfiS5wl3iLX3dNRiI3/VJsyeH8pN5o=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Cp9GPU9v; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA8341F000FF;
	Wed,  7 Oct 2026 23:16:41 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1791415003;
	bh=Hq9PkZq6Tc4gFRiogBEHZ8ZE+4O+b+Nj0QIhh9aEDgU=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=Cp9GPU9vggdBv51XiKeDS2n401QGmO4dUAHMNTu2vVyJYor3Xg6lZe0PCWda1fzrO
	 32wymrs9M+VKrSO3GFjFIMuxItUObijPt8LT+JHttUvK59rLHXjo8afLNVLpOTwLIy
	 B9g8cmByrVOOn0MMHvDlzhQoODmv+WCJe65y/+zFe2T2dpwAvHGoowRSS6BCHPMfRm
	 2LuYEaYbE+4aSdxKxe9cBZbBeM3jjUDMTzq5Cb2Ou6yurwh2AAMrjn2d+pqADOfScN
	 zYwxw4Sh2UOqbOU0CyfBQYkNBSv///YeuVVrvPPJT5Eqel2ZwDJm1WNyS/Cwg0cMIo
	 zoN7D9z9LY+jw==
X-Cc: yangbo.lu@nxp.com, andrew+netdev@lunn.ch, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 richardcochran@gmail.com, jacob.e.keller@intel.com, kory.maincent@bootlin.com,
 claudiu.manoil@nxp.com, vladimir.oltean@nxp.com, wei.fang@nxp.com,
 xiaoning.wang@nxp.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
 imx@lists.linux.dev, ioana.ciornei@nxp.com
X-In-Reply-To:  <20261006-for-upstream-qoriq-ptp-extts-flags-v1-1-b4a161b92832@free.fr>
X-sashiko-severity: Medium
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>