🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25967

Re: [PATCH net-next 3/3] net: usb: ax88179: Enable PTP

#25967
From: Vadim Fedorenko
Date: Wed, 02 Dec 2026 21:09
68 lines
12345 bytes
On 02.12.2026 18:05, Birger Koblitz wrote:
> Hi Vadim,
> 
> On 02/12/2026 4:12 pm, Vadim Fedorenko wrote:
>> On 29/11/2026 17:24, Birger Koblitz wrote:
>>> Thanks Andrew for reviewing this!
>>>
>>> On 29/11/2026 4:48 pm, Andrew Lunn wrote:
>>>>> +static bool ptp_enable;
>>>>> +module_param(ptp_enable, bool, 0);
>>>>> +MODULE_PARM_DESC(ptp_enable, "Enable PTP hardware timestamping");
>>>>> +
>>>>
>>>> Module parameters are not liked. Is this needed? Why not always enable
>>>> it?
>>> I was not aware of that. I will enable PTP by default. That it disables 
>>> NETIF_F_SG and NETIF_F_TSO is probably a small price for users of the 
>>> AX88179A for the extra PTP functionality, and on the AX88279 no impact on the 
>>> rest of the features whatsoever. PTP also does not cost any resources when 
>>> not in use.
>>
>> Is it possible to dynamically disable NETIF_F_SG and NETIF_F_TSO when HW
>> timestamps are requested?
>> This is a deceptively simple question. There are actually 3 sides to this:
> - Is it possible for the driver to change features and are they then picked up? 
> I investigated a bit and that appears doable: drivers can update their features 
> and just call netdev_update_features().
> Features like NETIF_F_SG/NETIF_F_TSO are then handled dynamically when treating 
> SKBs.
> - Then there is the question of whether the driver can enable/disable PTP in 
> order to have NETIF_F_SG/NETIF_F_TSO or not. This is a bit more unpractical, 
> because it requires a reset of the device to activate different firmware options 
> and including power-cycling the internal PHY.
> My understanding is that it is the PHY doing the timestamping and then the MAC 
> and USB interface handle the timestamps coming from the PHY. Cycling the PHY is 
> definitely necessary, without it, no timestamps are generated. There is already 
> a fallback in ax88179a_bind() which kicks in when PTP setup for some reason 
> fails (e.g. because the firmware version of the dongle is too low):
> /* Disable PTP functionality again and cycle PHY to take effect */
> ax88179_write_cmd(dev, AX_FW_MODE, AX_FW_MODE_179A, 0, 0, NULL);
> ax88179_write_u8(dev, AX88179A_PHY_POWER, 0, 0, 0);
>          msleep(50);
> So that is not very practical, but doable.
> 
> - The third part is I believe the tricky one. Timestamps are requested when you 
> send PTP frames and ask for timestamps in the socket. In practice, you use ptp4l 
> and bind it to a network interface. If this does not have a PTP clock, it will 
> never ask for timestamps. So the driver needs to set up the PTP clock even if 
> not providing timestamping. I believe this works, because the firmware options 
> are for the timestamping functionality, not the clock. When an skb is sent it 
> then carries the SKBTX_HW_TSTAMP. So basically out of tx_fixup we have to ask 
> for a reset of the device with subsequent link-down/up that takes a couple of 
> seconds and may have network manager and company kick in.
> I believe that to be impractical, but maybe there are better ideas.

Well, technically timestamps are requested once .ndo_hwtstamp_set() called with
tx/rx configuration which enables timestamper.

But if this actually needs PHY reset, then yes, I agree, it might be
impractical. But I would consult with vendor whether it's actually needed, or
it's just implemented this way to be sure that driver doesn't expect timestamps
before it's actually enabled in HW.


> 
> Cheers,
>    Birger
Technical Details
Message-ID: <b393463a-c80d-4a3d-97d0-52219fecbccf@linux.dev>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376054-linux-kernel-netdev=dewy.ru
References: <20261129-ptp-v1-0-8148c402beaf@birger-koblitz.de> <20261129-ptp-v1-3-8148c402beaf@birger-koblitz.de> <b0be6f63-f8c1-4d6f-99a1-bf709e70dfd1@lunn.ch> <74970c25-597f-4a33-871e-f46db5606acb@birger-koblitz.de> <fb25c3d9-a352-4afa-ac21-415554a6bffe@linux.dev> <69086382-37be-4385-ab62-4286e64bf702@birger-koblitz.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376054-linux-kernel-netdev=dewy.ru
From: vadim.fedorenko@linux.dev (Vadim Fedorenko)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 3/3] net: usb: ax88179: Enable PTP
Date: Wed, 2 Dec 2026 21:09:04 +0000
Organization: Usenet Network
Message-ID: <b393463a-c80d-4a3d-97d0-52219fecbccf@linux.dev>
References: <20261129-ptp-v1-0-8148c402beaf@birger-koblitz.de>
 <20261129-ptp-v1-3-8148c402beaf@birger-koblitz.de>
 <b0be6f63-f8c1-4d6f-99a1-bf709e70dfd1@lunn.ch>
 <74970c25-597f-4a33-871e-f46db5606acb@birger-koblitz.de>
 <fb25c3d9-a352-4afa-ac21-415554a6bffe@linux.dev>
 <69086382-37be-4385-ab62-4286e64bf702@birger-koblitz.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2062301"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:RmhqWhZoajXjDpGwyhvXOeJBi14= sha256:2YxhyigyMUGN8CpmHoauUnNdQM++ifoxmCiLUjjeFx8=
	sha1:ifuGtlfdaug7flKnADOoDYCp4F8= sha256:zuDrSmDJVD5jKeoHX50ou0s+AyRhEmN4vz44YJFBXb8=
Content-Language: en-US
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 7861F11772F; Thu,  3 Dec 2026 00:09:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.95
X-Spam-Status: No, score=-1.95 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
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 ohhXTJ2uXalG;
	Thu,  3 Dec 2026 00:09:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376054-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 34CAB117729; Thu,  3 Dec 2026 00:09:13 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id A151B24059; Wed,  2 Dec 2026 21:09:11 +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=1796245751;
	b=XBmFOiqD53Wx6r5s6oDNKAC5n+WWCqebNEA7Mckh7JnUXts0QzGTQSOKYQydgEMLknSW
	 AKYsEvrQQjUGKFnr+mD2AVLll+YJCbQBatLRf9slcU5nFM7mHjUeBgf7Bn6Ol8pBc+Pe4
	 ExED0EMbDCltY33/pUoBn3DD0y0uSyJwKCN+tERCelUScnBacpz8oxKjHMY6x5/jomAf6
	 S6TNhj0t5rJxLCRjFUqtxuC32YN4Q9xQ+NPg/adyZ6CueQT0n8nqfQ2peuIssImiH0Pfs
	 gJulFZUldXxB5H+MA+ZxU1aenF/4/9I6ayN9Y7mxF9RkCsjzlg6WyxDab6R0UcfHVKA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796245751;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=eVv//j+y11pFv5m29aaVVFRgFaUTzbGhl/mDNdsB2jI=;
	b=36DikhczlNPqXyUo+FRvX13edNhAmez6lXiLidY+789wUMHAAXuqlFB8TPR+Pf9IoK+g
	 0ZTcz4EbkrERPXfbl62J/Uhg4cxDliyTT3wbjxWpMEPf7WFAG8Zxwr/6FUrgTqPA5DsIQ
	 7EimfTFTVnqfs6c197QdLY8WKvBDLsq0lege9Pu7VpbnS0AAu86/VPqIp2Mvl5G/fRVru
	 MAFctEszpXrX0HP1FUT+CRkYYBOvKvPsB3vYeyOgEN/o6tE+g2uK5vprnY5SWYRLyuMlX
	 g11VRnmk0tYDiEnF1rbxHOIRxFk7daAyCxcfhcWdOTO+MczWrWey89Nmacxf05Z4FaA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=SZWtXe3s;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 2D879606A335;
	Wed,  2 Dec 2026 21:09:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=SZWtXe3s
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.13
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796245750;
	b=MkzpDO0LKB/LypS6K5ug2RdhFJ8F6vebxWPG+PjSRb6T4dRvaxfeNkAvuq9aFgxYNSvj
	 FgZDpZDzu1rG2JLDUTm6Q3Tq2YasRfmptyTFIN+eQbQ6V+lgbzQZwPA0bRPPkx7A0dmSX
	 hVtyAP9q9N86ReA+eIF2g/MdZCBYj3VouGzj2CVLfXV4tepM6s4iI3P4PH5mpmSRem98A
	 fLZyvKfGUCcBQq5f53MBS+vsl/Vq4skDPdOiMoXHLvQpw2PmSFJAyd2k8wjapq0BAkLsY
	 ibaCxbhHUWfDo+GObm6+k6VIBAJlCSmnZu4ogAG860E/2o0/20peB3Ot2UkBMVs9TZA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796245750;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=eVv//j+y11pFv5m29aaVVFRgFaUTzbGhl/mDNdsB2jI=;
	b=P3q3tALMxyg7uHA45q8VFuOGWZ/CpZ3BrhPQ2e5bMchUX7emBII/aPdW9votkQYQiuMp
	 297DxfPe6ekkY3g7kGCFOSENxfnYKu0YdVgIl5uMRkzYRM/XlRJipmYzsHu86rmcIFAch
	 YsoonQhtGKdnL40iKho4yfc2DgYXSmlFyKjfCjP5ow+pTzGWpTv44dYKLLX+iAtMIuc28
	 3/mLF22BxECEBu1VQXi5yZIPt1+qzFac1Ckh+FvCKMh2qAubGI7DYVh0KX+n5naVvXNMM
	 FAQIlbNAD3feMj1a7OCvgrRR707xZ6H9dlxmJuuzhtVJ2nvy9MWY04ajBsZZY2OS/jw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=SZWtXe3s;
	arc=none smtp.remote-ip=95.215.58.13
X-Received: from mta1.migadu.com (out-13.mta1.migadu.com [95.215.58.13])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51774606A322
	for <netdev@vger.kernel.org>; Wed,  2 Dec 2026 21:09:07 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 51774606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=pu9oUytOFD9iwleR9LoXpvK8IadPRVjcVKjLObYbbTM=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1796245746; v=1; x=1796850546;
 b=SZWtXe3sLw3dDLSphDYyiOUZtYE9EyDAmbEugv9nEs80SaXBvVf1PcHuyBHnHdca8Spsii8g
 weJ2LQtZULe/1yOW7/F3txqDRn10b1FPWa0nRVX87XE8yozbEj1z4oBsAZ05qteOQyBOZNt2BJm
 SCqwIDqqfTrT3bgbYdFzAgnY=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id cfbaf85b202e57dd;
	Wed, 02 Dec 2026 21:09:05 +0000
X-Mizu-Trace-ID: cfbaf85b202e57dd
X-Migadu-Flow: FLOW_OUT
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
X-User-Agent: Mozilla Thunderbird
X-Cc: Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller"
 <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>,
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
 Richard Cochran <richardcochran@gmail.com>,
 Russell King <linux@armlinux.org.uk>, netdev@vger.kernel.org,
 linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <69086382-37be-4385-ab62-4286e64bf702@birger-koblitz.de>