🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6282

Re: [PATCH net] net: ethernet: ti: am65-cpts: fix support for PTP_EXTTS_REQUEST2 ioctl

#6282
From: netdev-bot+sashiko
Date: Thu, 22 Oct 2026 03:37
89 lines
11396 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] Adding PTP_STRICT_FLAGS to am65_ptp_info.supported_extts_flags
  in drivers/net/ethernet/ti/am65-cpts.c also changes the legacy…

--

net: ethernet: ti: am65-cpts: fix support for PTP_EXTTS_REQUEST2 ioctl

This patch sets .supported_extts_flags for am65-cpts to
PTP_RISING_EDGE | PTP_STRICT_FLAGS. The PTP core then stops rejecting every
PTP_EXTTS_REQUEST2 for this driver. After the change, PTP_EXTTS_REQUEST2
succeeds for the rising edge and fails with -EOPNOTSUPP for the falling
edge or for both edges.

> diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c
> index efbf2ef976a3..df5659ead72f 100644
> --- a/drivers/net/ethernet/ti/am65-cpts.c
> +++ b/drivers/net/ethernet/ti/am65-cpts.c
> @@ -779,6 +779,7 @@ static long am65_cpts_ts_work(struct ptp_clock_info *ptp);
>  static struct ptp_clock_info am65_ptp_info = {
>  	.owner		= THIS_MODULE,
>  	.name		= "CTPS timer",
> +	.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,

[Severity: Medium]
Does this also change what the legacy PTP_EXTTS_REQUEST ioctl accepts?

In ptp_extts_request(), the v1 branch keeps the edge bits and never sets
PTP_STRICT_FLAGS. Whether the edge bits count only as hints depends just on
the driver's mask:

drivers/ptp/ptp_chardev.c:ptp_extts_request() {
    ...
	} 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 for am65-cpts. A v1 request
with PTP_ENABLE_FEATURE | PTP_FALLING_EDGE, or with both edges set, was
accepted and reached am65_cpts_extts_enable(), which ignores the flags.

Now the mask has PTP_STRICT_FLAGS but not PTP_FALLING_EDGE, so those same
v1 requests return -EOPNOTSUPP before ops->enable() is ever called.

The same check runs when PTP_ENABLE_FEATURE is clear. Through either ioctl,
a disable request that still carries PTP_FALLING_EDGE is now rejected.

One in-tree example is tools/testing/selftests/ptp/testptp.c run with
-e N -E 2 or -E 3. That sends a legacy request with PTP_FALLING_EDGE set:

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

On am65-cpts this worked before the patch. It now fails with
"PTP_EXTTS_REQUEST: Operation not supported".

Rejecting falling edge requests that the hardware can't honour matches how
the core treats other strict, rising-only drivers. However, the commit
message says:

    Only the PTP_EXTTS_REQUEST ioctl still works.

This suggests v1 behaviour does not change. The patch has a Fixes: tag and
is likely to go to stable. Could the commit message say that v1 requests
carrying PTP_FALLING_EDGE are now rejected as well?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261020003525.1237742-1-jjc%40jclark.com
Technical Details
Message-ID: <179264023362.3135.17895429756190814680@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-350365-linux-kernel-netdev=dewy.ru
References: <20261020003525.1237742-1-jjc@jclark.com>

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-350365-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpts: fix support for
 PTP_EXTTS_REQUEST2 ioctl
Date: Thu, 22 Oct 2026 03:37:13 +0000
Organization: Usenet Network
Message-ID: <179264023362.3135.17895429756190814680@kernel.org>
References: <20261020003525.1237742-1-jjc@jclark.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="120313"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HbofF756HIutyjTXfXyXEqWLpVY= sha256:UFugl7rOHT+XDTkdZtUmPsouKlaWjHk9CrB9/Q67PpY=
	sha1:lTb1nwZRzm95ixExrhznQplFX5U= sha256:p+pfjZ39v8LCC9L+n6JvDGIyYP7v4eFCRj6XrP0ES28=
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 45D19111196; Thu, 22 Oct 2026 06:38:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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 vb1rK3jY-arP;
	Thu, 22 Oct 2026 06:38:02 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-350365-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id B9C8A111185; Thu, 22 Oct 2026 06:37:53 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id BA1B7270E6; Thu, 22 Oct 2026 03:37:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792640236;
	b=P+l+CU3f8CQA7CctKprgEUYPEg2eVFnmpLg25JEUov62EOpNX8Z+64Utizo7G8O/ImKw
	 B+9vKCk8Tau9WIhaOgxSQ2hAUGv5mUCIku2nhV77TssImrIVLQyvuvLh1o2bBDlnd8cjW
	 NZjtpt6uoxxh/fuQvCR/q+AgjKtqXwlRNSi/OB1wIutdipmekUkSWrNMRyOBBzCisMDcn
	 /5eDcyX7ySGONZuCZ47XlV3m0GzcyIf+7kXBok3tbbSCdqTeE3NSJcIB785G16kuzlDoD
	 4UzLuafn/m8cP11Fr74awVqUiST1K5BkH+4aDwejhsjbK0ySTWUdvFpFV4gq8iIcz6Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792640236;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=wiOrzvAWE54RUecfoYSwa4qYrJQIt8QNmZHHKyYFVK0=;
	b=gYxrNexLDz85RXvphAahxbVYqeq9R4xsa/wH1gP4B2gqgOeUoiyDFQTXJ/8fNCcS4LO6
	 Mfq6x0/nGPfjlwgmEFmC3Ogb08DRlkMNSqAgiXHmtKxT6fj7T0M4/Kcon9/EJkTIDoQRZ
	 CwaBVALSV9uRNaNX2hIs8+ephb9x2f4ZbQoAQVOPLs3KgfrV4wTX5TiCvZQlyvp+xBT0P
	 P5f4LVdcRZ9Wtlp9T4wlatfgGumQRBL59ZdS/6LMZ7/EgEoVvI5eFH7psU+gTeHIaodR8
	 sHFc0WiRURsh5M/uzms5c57OeIdXkE7W82ZJz76CQyZB064MOMiaLhO7FW6PBc4Dhpw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nTvaCW2A;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 40144606A328;
	Thu, 22 Oct 2026 03:37:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nTvaCW2A
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792640235;
	b=E+o5fbHjOV7ny4uYczyrJpB+9O2grxYRLeLjG6gRuI+WfnXeswyn3md1DoQBd0NAgVbT
	 KxhvnoCemMXZi7vtzidbRPaX6zwGbK2T9x8hVxOYHJVjL1I9toa8ZHEEi/geb7qySAqUo
	 kVh5u7FucVS7/0p9sZ4rKL9F1v4A1EPK8jhtJHtmD45Wkb4DGOm0udlo/ERshu594xbbJ
	 JqOZCQbmaTlZg5qYkRKcpmbRB2w8jznwfuxOctDb32Pk9dCKBxocnUfedMIiPRFQLbdRN
	 +kAJ0udFB/r6RLt3BygIkjZzOAd0kRgOlbGCHK64MRkTEMSs5w0Ii/Y1wO2WUP1sotw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792640235;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=wiOrzvAWE54RUecfoYSwa4qYrJQIt8QNmZHHKyYFVK0=;
	b=LD4BoA5mkn+aJHt+mMxRM2LMYI3YSIJZNwsV7cDABbGkEEl4Ydv10gmKM7IH6GrKaAmY
	 I+wGVutKQn2/MJPnYmNSu2jmZiFkLxVctk0CN+Ln9sdpKm6AzK5Jn1ttAFw8i/xsJRMuG
	 sgYA2Gv558WtcWxGghu9XIWOYIeY0SQcVxabRw+vjZn1HONwIK2fzINCkXjcND4svfDdS
	 /IQuqMMK5XjWbHv+PKxCDqMMRwEaSd7W6iGEhRoPC8wneNmISPyHfcsoHYekjEKyTaaTy
	 DJ/Sl2wXgTJ5RBmcQdDpb+8k7TlT7+ikB201urGEhwo104Lk2iIYsihuJx8ecDYk5LQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nTvaCW2A;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BFD1606A31B;
	Thu, 22 Oct 2026 03:37:14 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1965F1F000C1;
	Thu, 22 Oct 2026 03:37:14 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792640234;
	bh=wiOrzvAWE54RUecfoYSwa4qYrJQIt8QNmZHHKyYFVK0=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=nTvaCW2A8PtFlz2WBPFWTQKpyVIVR2r8NgeRnmsZfqMR4MY5ntT96Wkm+8rQDboSS
	 KKQzN2Gnbt26IsIfre9+xrjhGBVXt4sggbZhJQ0AhAaZIo2FfY87bCGK2VywdgEYhg
	 nKJaRQGBp6ErXezG83eUQ17Pb+d+w+NKG4gcQ8lOKAIptCzgkEU/zp87ZdyHqhCam5
	 cVk4qqUONgK9Ep5Ak0iXYXtLkIIHsHoq2APv7zlnACCo2PRtdVqKiR5hnqafvTXi0o
	 0f2rqT8QbgxgBEFRr6Rrwwp8m7VOujOhegcP5v0rjMUkpNtURoXFAIgp9y42MQ+XQ0
	 jMNam+/q5e7+g==
X-Cc: 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, s-vadapalli@ti.com,
 c-vankar@ti.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261020003525.1237742-1-jjc@jclark.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list