From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796121395; b=2ipQY1paL/DUZ0u4BCr+bpIGgKRkCeOZv/htNCTMwELYe5XMUuA8UeLt1SO2BbizM2p9 nn+pnDQc7yEsNPqW0egbgKeoUocL2I9MM2ex7wrwuWy0ZA6vmRb0b/+1xHyfmJNjG8/n1 RoaRjL4yXQhEUpsBB+TP5vUZlCPwjGraXr9wZcu/t6qVmoXPTKjalymRPYFjFwMgh/Xem /YBBdyHO1SbwOwmyKgkJYW8ki1nzWsj9eFDiBFbd2PjpEhnr1QDrQ4pcvSnWoKeZ9ssWc qJMbV5kIQQ76XWRMyeGANaGemjFYIZW2pV3bLVTIcJRhumhBcQPD3854z8h41JbjNbA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796121395; h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc: Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type: Content-Transfer-Encoding:X-Last-TLS-Session-Version; bh=vAq9CoFsGG3GXtTVv4fb3tMMoJLXvpud+FmTylKaKrY=; b=yG6dGE4M+MoUmS4oOPqNDag/aV+XqgDdRCe5ZP+znYJDePFP2szcqVPLWui4uVeC9iKF VldkIj8utTn2oQd0AZbBDnCJzjnFwlwcJ8dI4Ei8ytzdWPSTglxG6PoQlERoXxY4InH34 l/3/v2qjvk5qWnzYRAh/luAS3Ln/MIdiv7qyQkirgAqxF3NtxckpFSr4B/OF4ICnB8Xvo Q3xkgwzgroRUDpxREOwdsVeThdAfb7kJTijqDrrDomr9Xsc8kTlwobG9DSLx3b9lPUucP JnlNe4xxduT53sTLVGaC675YRD6usH95igpZiKfSM+wNQHLm4ttQKA5b13Pxz2dBgQQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=tipi-net.de; spf=pass smtp.mailfrom=tipi-net.de; dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=q6iD9co8; arc=none smtp.remote-ip=194.13.80.246 Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246]) (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 124F7606A31A; Tue, 1 Dec 2026 10:36:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 124F7606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=q6iD9co8 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 06D4DA157F; Tue, 01 Dec 2026 11:36:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1796121392; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=vAq9CoFsGG3GXtTVv4fb3tMMoJLXvpud+FmTylKaKrY=; b=q6iD9co8KnBx5QqOcRKXwDDQLe1rd0306OlI8mfhrlvUjREn5vzmSggyTmEWncAP+b6k1k CUTY2NuA83ry8qmjfc/4FiNyKA/Dss1UyORiklkwIYTbVoPndQ28FmKiK/ZEUep2O82SvY mt4iv5IQvkhrJOzf1YVT7wOd1mZVsCm5Y8A2IVVVKJN7vep5eQzkl2fke9YLZOzKJhzRW2 EB+D0lUXoFdehYPEFmY7INRk6XsYrNLa6g/+8T95BBgmZjX32Sci1bpd2spsLnOS4LWBHJ Lw6byI74FlnhxA5QYd9ZQAy1TtxvONwGz4Qi/0ESo3uOB6AjZJ0mbk/KSP470A== X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Date: Tue, 01 Dec 2026 11:36:30 +0100 From: Nicolai Buchwitz To: javen Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, daniel@makrotopia.org, vladimir.oltean@nxp.com Subject: Re: [PATCH net-next v5 4/4] net: phy: realtek: add hardware timestamping for RTL8127a In-Reply-To: <20261201094454.1150-5-javen_xu@realsil.com.cn> References: <20261201094454.1150-1-javen_xu@realsil.com.cn> <20261201094454.1150-5-javen_xu@realsil.com.cn> Message-ID: X-Sender: nb@tipi-net.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Last-TLS-Session-Version: TLSv1.3 Hi Javen On 1.12.2026 10:44, javen wrote: > From: Javen Xu > > The PTP block of the RTL8127a internal PHY also timestamps PTPv2 event > messages over UDP in both directions. Register a mii_timestamper for > it, > so the PHY can provide hardware timestamps without any support from the > MAC driver. > > The timestamps are read out over MDIO, which may sleep, so this is done > from the PTP aux worker. Received packets are queued until their > timestamp has been read, transmitted packets are completed once the > hardware reports their timestamp. > > The hardware only keeps the most recent timestamp per message type and > direction and does not record the sequenceId. Hence only one TX > timestamp can be pending at a time, it is dropped if nothing arrives > within 15 seconds, and an RX timestamp may be overwritten by a later > message of the same type before it has been read. > > Signed-off-by: Javen Xu > --- > [...] > +void rtl8127a_ptp_link_change_notify(struct phy_device *phydev) > +{ > + struct rtl8127a_ptp *ptp = phydev->priv; > + int ret = 0; > + > + if (!ptp || !phydev->link) > + return; > + > + mutex_lock(&ptp->lock); > + /* Restore timestamping in case the PTP block was reset. */ > + if (ptp->hw_enabled) { > + ret = rtl8127a_ptp_read(ptp, RTL8127A_PTP_CTL); > + if (ret >= 0 && !(ret & RTL8127A_PTP_CTL_EN)) > + ret = __rtl8127a_ptp_hwtstamp_enable(ptp, true); phy_detach() clears dev->hwprov on down/up, so the PHY is no longer the selected after that. Should this still turn timestamping back on? > [...] > +static int rtl8127a_ptp_ts_info(struct mii_timestamper *mii_ts, > + struct kernel_ethtool_ts_info *info) > +{ > + struct rtl8127a_ptp *ptp = container_of(mii_ts, struct rtl8127a_ptp, > + mii_ts); > + > + info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | Please drop TX_SOFTWARE, that's for the MAC to report. > [...] Thanks, Nicolai