From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796319695; b=UYf+LnRGgdmcw/ASElusZRPKDEjShbRNfYTRaICE28+OfbBc3IQpnjeHNmLw+fhkYMBK feeV+3xsrjB1OB53tho687jOgHYV6Cvq7t/FiwTPOtZuTeel+JXa7CQ4+YO4G1xA6yGTh s9rtQISsj3Lv/deEvwxNmbolHTIvmAFa+advwTWc6yzZHzZBHyzgTkrsGk4qLts0EirRj 97c0ilDkQb5fkgswdGKMh8b4lD5J1fpFk/k+XZbx4dUV1tXKvQndMUm/1p/0uwERHmtaI XJAXZulRozrps2xA9LV6ZWMWRFrf+9GUaww0SVjO4NnjvCuJXqnb/zoKsiYJPRppnfQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796319695; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=PAp30Pb/GGyiNavgzAsv+okewedKrvj8CTL694q69ik=; b=E79ycvC9+j2i/F7E49Mn0pxmR9RpJMZSVPjg5x7ESS1mD2hfxheOIStRq1dr/xg4tCRU 1T381Dmpcy9GaiumEseerKTShqMBdqezvxLYDIu89URC5gt1Kxyu2Hbk5MUC+Ip4N/Obr r08mrPEjt7guqrvkH1waOMdlxHMzY4lvr/BaS2dmG/8p1mODTDSahGg1suYn8kybaLO0c 2shimJ6i1vfSdYfHyAfBcKtQgtCQtVu80kjHALB28W8SCUoVAV/rLmPw+eBqk9qnZ2APJ fiMCOzHLTp+CkdYJxK6JOWSHI8aoWO/oM+YOLQrIr3JSkZmOSx9NY7NrLyi3kqtG3vg== 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=cW+zTNqP; arc=none smtp.remote-ip=100.103.45.18 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) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 260BE606A322 for ; Thu, 3 Dec 2026 17:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cW+zTNqP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88E271F00893; Thu, 3 Dec 2026 17:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796319694; bh=PAp30Pb/GGyiNavgzAsv+okewedKrvj8CTL694q69ik=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=cW+zTNqP3BboBYAOSKEH7b8IGFbXbolu5Ua+KHd3VO5RoPciAG7gZ7BXxLtUftBoV 7Cn+cAj27YRMenD9WViL3qz7LlmsKp6d2TmZIvNVbiRKc5IIaHVZQ/CGnP0dtcE8Rj 5gDHCRdykUwqizkoAu4QvAUxXCh5++huIWCDVWgXQraP45aCP7y4yPT/TSuBuGbMBt c42ym9qXoxr4TVl7E9bgeYle0baOEc7lmd2BHR89P129a9FURX8msARROldRFfrqdB 8aNj28Ix+CBLChxPbBjaEZBWvRY9iJMX7G5yg+HKBuuB1h3sadHItI4aUMrxFz9O1F wwXcn03zuJ7Cg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next v13 07/15] net: ethernet: oa_tc6: Support for hardware timestamp Reply-To: sashiko-reviews@lists.linux.dev To: "Selvamani Rajagopal" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261202-s2500-mac-phy-support-v13-7-a2908fad2693@onsemi.com> References: <20261202-s2500-mac-phy-support-v13-0-a2908fad2693@onsemi.com> <20261202-s2500-mac-phy-support-v13-7-a2908fad2693@onsemi.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 17:41:34 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] net: oa_tc6: unacknowledged TTSC bits wedge TX timestamping and config - [Low] net: oa_tc6: unrestored INT_MASK0 on error in oa_tc6_set_hwtstamp_settings() -- commit 078fad3eca6f074ed57b3296cfaf9ae956614687 Author: Selvamani Rajagopal net: ethernet: oa_tc6: Support for hardware timestamp This commit adds hardware timestamping and PTP clock registration helpers to the OPEN Alliance TC6 10BASE-T1x MAC-PHY framework. > diff --git a/drivers/net/ethernet/oa_tc6/oa_tc6_main.c b/drivers/net/ethe= rnet/oa_tc6/oa_tc6_main.c > index 341d13c97f91f..3bb274d0f647d 100644 > --- a/drivers/net/ethernet/oa_tc6/oa_tc6_main.c > +++ b/drivers/net/ethernet/oa_tc6/oa_tc6_main.c [ ... ] > @@ -49,6 +62,222 @@ static int oa_tc6_get_parity(u32 p) [ ... ] > +/* Pause new timestamp requests while an off request is pending. */ > +static void oa_tc6_req_tx_hwtstamp(struct oa_tc6 *tc6, struct sk_buff *s= kb) > +{ > + u8 tsc; > + > + lockdep_assert_held(&tc6->tx_skb_lock); > + > + if (!skb || !(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) > + return; > + > + if (tc6->ts_cfg.tx_type !=3D HWTSTAMP_TX_ON || > + (tc6->ts_cfg_req && > + tc6->ts_cfg_new.tx_type !=3D HWTSTAMP_TX_ON)) > + return; > + > + tsc =3D tc6->ttsc_current_id; > + if ((tc6->ttsc_pending | tc6->ttsc_held) & > + BIT(tsc - OA_TC6_TTSCA_REG_ID)) { > + tc6->tx_hwtstamp_err++; > + return; > + } > + > + tc6->ttsc_pending |=3D BIT(tsc - OA_TC6_TTSCA_REG_ID); > + tc6->ttsc_current_id =3D oa_tc6_next_tsc(tsc); > + oa_tc6_tsinfo_tx(skb)->tsc =3D tsc; > + skb_shinfo(skb)->tx_flags |=3D SKBTX_IN_PROGRESS; > +} [ ... ] > +static void oa_tc6_cleanup_tx_tstamp_skbs(struct oa_tc6 *tc6, bool hold) > +{ > + struct sk_buff *skb, *tmp; > + > + spin_lock_bh(&tc6->tx_skb_lock); > + list_for_each_entry_safe(skb, tmp, &tc6->ttsc_skb_list, list) { > + list_del(&skb->list); > + dev_kfree_skb(skb); > + > + /* The frame was transmitted, only its timestamp is lost. */ > + tc6->tx_hwtstamp_lost++; > + } > + > + /* A frame still being sent can also produce a capture after close. */ > + if (hold) > + tc6->ttsc_held |=3D tc6->ttsc_pending; > + tc6->ttsc_pending =3D 0; > + spin_unlock_bh(&tc6->tx_skb_lock); > +} [Severity: Medium] Can an unacknowledged bit in tc6->ttsc_pending or tc6->ttsc_held permanently wedge TX timestamping and block disabling HWTSTAMP_TX_ON? The MAC-PHY asserts OA_TC6_STATUS0_TTSCAx only when a frame is transmitted onto the medium, whereas TX chunks are transferred over SPI into the MAC-PHY FIFO whenever TX credits are available. When the interface is brought down, the vendor driver's ndo_stop disables the MAC transmitter and stops the PHY before NETDEV_DOWN runs oa_tc6_netdev_event() -> oa_tc6_cleanup_tx_tstamp_skbs(tc6, true), so any timestamped frame still buffered in the MAC-PHY FIFO (for example awaiting carrier or a PLCA transm= it opportunity) never produces a capture interrupt and its bit stays set in tc6->ttsc_held. Once a single capture bit is stuck, oa_tc6_req_tx_hwtstamp() returns early when tc6->ttsc_current_id reaches that register without advancing tc6->ttsc_current_id to try the other two registers, so every subsequent SKBTX_HW_TSTAMP packet is sent without a timestamp. In addition, oa_tc6_hwtstamp_req_process() waits for !(tc6->ttsc_pending | tc6->ttsc_hel= d) before turning TX timestamping off, causing oa_tc6_hwtstamp_set() with HWTSTAMP_TX_OFF to fail with -ETIMEDOUT. Two related paths can also leave tc6->ttsc_held bits stuck: oa_tc6_netdev_event() leaves tc6->ongoing_tx_skb in flight when latching tc6->ttsc_pending into tc6->ttsc_held, and oa_tc6_cleanup_ongoing_tx_skb() only clears tc6->ttsc_pending if that partially sent multi-chunk skb is lat= er aborted; and oa_tc6_set_hwtstamp_settings() writes OA_TC6_REG_STATUS0 to clear pending TTSCA bits in hardware without clearing the corresponding bits in tc6->ttsc_held. > diff --git a/drivers/net/ethernet/oa_tc6/oa_tc6_tstamp.c b/drivers/net/et= hernet/oa_tc6/oa_tc6_tstamp.c > new file mode 100644 > index 0000000000000..1806aa81a2852 > --- /dev/null > +++ b/drivers/net/ethernet/oa_tc6/oa_tc6_tstamp.c [ ... ] > @@ -0,0 +1,302 @@ [ ... ] > + ret =3D oa_tc6_write_register(tc6, OA_TC6_REG_INT_MASK0, irqm); > + if (ret) { > + dev_err(&tc6->spi->dev, "failed to write IRQM register\n"); > + return ret; > + } > + > + ret =3D oa_tc6_write_register(tc6, OA_TC6_REG_CONFIG0, cfg0); > + if (ret) { > + dev_err(&tc6->spi->dev, "failed to write CFG0 register\n"); > + return ret; > + } > + spin_lock_bh(&tc6->tx_skb_lock); > + tc6->ts_cfg =3D *ts_cfg; > + spin_unlock_bh(&tc6->tx_skb_lock); [Severity: Low] If writing OA_TC6_REG_CONFIG0 fails after OA_TC6_REG_INT_MASK0 has been updated, does this leave hardware interrupt masking out of sync with tc6->ts_cfg? When transitioning from HWTSTAMP_TX_ON to HWTSTAMP_TX_OFF, a failure on the OA_TC6_REG_CONFIG0 write leaves OA_TC6_INT_MASK0_TTSCA_MASK masked in hardware while tc6->ts_cfg.tx_type remains HWTSTAMP_TX_ON, so oa_tc6_req_tx_hwtstamp() and oa_tc6_queue_tx_tstamp_skb() continue claiming capture registers and queuing TX skbs whose capture interrupts are masked. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202-s2500-mac-= phy-support-v13-0-a2908fad2693@onsemi.com?part=3D7