From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796477782; b=KW/m5o8Skd0mmrWR1VAkrtuugJTlENxR61m7VuPubdCiETX2xuIevEHZ9eMxaLereGCd DL1l3Vgm8L+yPTicE1oPqzlFBgQvP8YsE6uT8Tbtpi9qfVYRG2IZCfs9HpSPabEreuDul 7NfLUMCjR4cFzUh6SLAiWLK95BsiYQpocJ96lI7QT6YA8s1WZQHQJ2l4yeYdA8W3CO2wi 9EE/zP+cEszomkHySazGkNIRqpeFgzvHaRyT0gFEkADLho1fn/ahi4O70PlmEAcoEaKjK u6lMfktlJsp2LQts+Qhi0paDPvQPwt8hphoEg2+cmsb+3SFBIia7iSpu8hR7bWD4Mbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796477782; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Info:X-Authority-Analysis:X-Proofpoint-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=3TQbdtZW1mbJrxqth2zfInrdG28PUYbI80C5akZ/m/M=; b=UYzVr+PUQG+GH5woyuRakFBDhIIrgNfGuKHK8JeSjOrQcJmo7e+lUiU/u2/6qhncbjQM 3UJRUXLQxELy/L4ZCki9kmH6TdpcXnGzp1eMi06ypa7vtow2I38omu4wcjS/3cL/f4ezo FPuvvx/Wu3XEJPjv1uI7EpCHL4KLATQUOT7VDgLuUPbLsfTYjkEdQyy3wnDNFzwVB8Nex gWZ4KCYh7ZZjBUOGoUjzghy+/9yfKlTok1Pnw8H70TIexJHJq4gIgP2m2fAxvg0LosdYI uZbKofvoUoO3x2DUZeQsgb+8OmIKQtQ4s24JiStQ2bCRYVz/XonqQZJLpv8Y0SdEb7w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=W0D6sTkA; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=NNeZVX9v; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 3425B606A322 for ; Sat, 5 Dec 2026 13:36:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3425B606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=W0D6sTkA; dkim=pass (2048-bit key, unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=NNeZVX9v Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B5D5uUi2192245 for ; Sat, 5 Dec 2026 13:36:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=3TQbdtZW1mbJrxqth2zfInrd G28PUYbI80C5akZ/m/M=; b=W0D6sTkAqvbfoDg7rIQfOGAUE6Xnxd1A5LRbM6oD d5IKLFaa+O5TPpGZTdVJOCcijX/uP7RkMJDW833YKLqgdV03iZi3h3SoDB1zuQGG DapAqu2E4AFKIl0Jp94s0tRZpgxnzuu1oYIm0cXnQuUOIteJLrTcQ5Wp+oBAWNTD pQZMmmoGP3EHM//34xI/c23IE92YE4ocEbGIQptYnhtXFNFz1im9L9RVttDTBT62 AbCLE88O3qU6NqcjOX7dnYLdf9t22w7mxfjd3eXB+NGc4iROcDKcyrt8mp7yIf1K h6vMEVsZRAqfEWnNWGANoKLIqp6Qbai3DqCyWRtRerfMPQ== Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jcbn4s1cs-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 05 Dec 2026 13:36:21 +0000 (GMT) Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-990835cec5aso1346862241.0 for ; Sat, 05 Dec 2026 05:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796477780; x=1797082580; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3TQbdtZW1mbJrxqth2zfInrdG28PUYbI80C5akZ/m/M=; b=NNeZVX9vZBxbl1OU7TRtmIcGpvJfDd57/Dyqfe3CeKN4GR/MQQOuwyt+aftM4BNyOv 3N0LCL5b9jtwfsksD7nbzrrASF+Pw4DiSyIPcRqZ5s3f50701sB0KvVu91iu0r3KaWoU OSq7wA+EC1Wr7OW5dQyTd1eQLpqlALV1VusgOYcto3Lf1lEjRV/oJYBblfbKxTPIwD6F u2UUziUrBQk+qfIMUQyEigBBHlXrFXbkU6kC47wYtD3DFrZWHNPzvZZHWmFVyzdhahTh AwFjrLYtbFWtsK14Nd/nZQb69/Wl+B59LB7pqVAKhN8BHryeCO3o97Cy0mxUI141HVl3 VXJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796477780; x=1797082580; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3TQbdtZW1mbJrxqth2zfInrdG28PUYbI80C5akZ/m/M=; b=2ukP2WTwCSIfM4kQb+ymzXP75QKaz57d+4Q+BNAbEjth4PB6xhwnnz0xpM898FU6rY CFpvwb4BhmrYCcOK3T4wQ987XXY26gHB69d1fqhWfU4tcrTErM3tzA6tAOtvCSgcjYkJ YL6rN1dNncAjTexWr2TjgqyMOhW1DU8MPEbcrYlBGQ8jc1mIWJC8pgDpvON8opouL9CJ 2A3roPwFq5kpYtIwe2xX1En0iABB2rAayQe9/ahIQxF3CoYi7j1M2eScX5XZ/KCsyTvq xQGfs/onpGMrpBUUdc2lKHWloHS0Q9ACTY5kP+fOIUJYXM+IKYT7+LWA3O+UJKAdeLTX Uybg== X-Forwarded-Encrypted: i=1; AL+hErG7kOxaYuuLJiTb/t6MCG7pe0dhcmMprsvQ48jAMZXM0rT/KdNsnUBBno5k0MeCopA22pWQzWs=@vger.kernel.org X-Gm-Message-State: AB4q+uEMUoidaTDW3qWriRVuOopLHnTDuVahV6tZKktxtKhGfsyCGZb0 mkkoWnkFMvDaGUnTzO66+M7AGvq3BJBbSqSKckgBKOI6Lv33omYv2w4onPtrc9XjlGHvbqx/KH8 RBb3Eg1/BiLksBbFnjOrJmZDzsV0Ty2eY0jIp1/GUD+1PYpzcahhNOCY4KDA= X-Gm-Gg: AZFdTZde2u0BMryeBJXkB3h2MPMxpJ+I1rdfNw+fALee1Y08orzXlmeNuLaH9OgzlJB h7+lQwGhQEgJ1dUgY1ALZLsQX1csdisnZsbJBx+ljkhLE7RChAJ1lJUJqKBNJKfV7A1Q/V7XCUx vAXO5+yeMtaHOcxz6vQdujyznUxYp0wMew8g8DmJPDLSUqzQWxPjBpWVpF+I+Rm5HO1dgSa6Yq3 2JxxuXar7NaUFHwEXr2cgSESErZ0jOobGMDMsV6spudKaq/16w4iN0Db2L/BycxDY44HYKitIb7 lsmFGNIHqOCySePK75kFn4mvBgVSHkWvrfeIWSEZ4ak0BnNu2tcDfdZ+ykm0f8Gg0RLv45u7zVU l3vAYRt0O8kOZl2rC8lMv4GU+aKgy/0lnGWDUG5W77dqy6ZxJlGNlZP9Z6Mofew== X-Received: by 2002:a05:6102:292a:b0:7da:d26f:9667 with SMTP id ada2fe7eead31-7dad6a70ebamr5570406137.27.1796477780315; Sat, 05 Dec 2026 05:36:20 -0800 (PST) X-Received: by 2002:a05:6102:292a:b0:7da:d26f:9667 with SMTP id ada2fe7eead31-7dad6a70ebamr5570382137.27.1796477779744; Sat, 05 Dec 2026 05:36:19 -0800 (PST) Received: from localhost ([130.25.105.85]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d174d08d42sm10589309f8f.55.2026.12.05.05.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 05:36:18 -0800 (PST) Date: Sat, 5 Dec 2026 14:36:18 +0100 From: Lorenzo Bianconi To: James Clark Cc: Maxime Chevallier , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Jose Abreu , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net] net: stmmac: xgmac: fix disabling flexible PPS output Message-ID: References: <20261205092716.17734-1-jjc@jclark.com> 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 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HIMTD0hoqNIwbybL" Content-Disposition: inline In-Reply-To: <20261205092716.17734-1-jjc@jclark.com> X-Proofpoint-ORIG-GUID: IVlFKRTBLnGYhfI0bWlanIIH01dycQE4 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA1MDA1NCBTYWx0ZWRfX1eneTuFkmPEg Sk3hg/rBaSNVleFTNWOWe47RSsefmYCRY/0PhzSLFK1FmJn/cTVbDCdKSUAPv0cYB4K5lRRfkvk YAdn9XiGUP7qOZMG9fu4kT8OnXVqnds= X-Authority-Analysis: v=2.4 cv=QvLLTlyd c=1 sm=1 tr=0 ts=6b141355 cx=c_pps a=R6oCqFB+Yf/t2GF8e0/dFg==:117 a=RcFDq6c+avmIvxkL9iwlxA==:17 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=NEAV23lmAAAA:8 a=idZxcIp9AAAA:8 a=EUspDBNiAAAA:8 a=aTf6Y1qc6H48dytMxgsA:9 a=CjuIK1q_8ugA:10 a=l4uQSsn9fpERBEmALbEA:9 a=TD8TdBvy0hsOASGTdmB-:22 a=NzLqzEvlDKEySyxblcRP:22 X-Proofpoint-GUID: IVlFKRTBLnGYhfI0bWlanIIH01dycQE4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA1MDA1NCBTYWx0ZWRfX7OCigRbwoFQr hompkeuYTBWKib1aySZZoqfCTR1hMzP5o09oXuj5+mQTjMl+qLsfNE5kXqF9OJk/kASnLA2olAE eWMm0dttgAij/HfkJzQWMftSQ6Jcfcvki+c4ok1xzYEussh/k4PeOiNPf8aCr1fK7GfU5VGZoiy vEC2klPX8cL91S1R5RL4EIA9EvsCSG3EQMhd2LI6j4H8tMa32cGQ596dSyvxFbnSF0vfeZM5QLd MHF/0OjgASDyJhAJXp+mBqMQCleHW09fEt4GyRDJs/IbF8I32XN9gzUqYQXB6zD7T1NjC68HFL4 sL0qUQ+QrQtsIhusYptF2ijrI3HvRJQ2WDKfMULaBgvud42g1xRPJL+urRUf6g622v0twNBdX1q f+I9fgNk+YB/MMdhOFnNJAGx7iXh8+1gT396qZXMdS+zd9ocJ2OFBnwGIaMVW/+iOgPnD8Wegnz GudcwemrhBBdr84pi+Q== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-05_04,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 phishscore=0 spamscore=0 impostorscore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2612040000 definitions=main-2612050054 --HIMTD0hoqNIwbybL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Dec 05, James Clark wrote: > On a Terasic DE25-Nano (Agilex 5, XGMAC core 3.10), disabling PPS > output 0 with PTP_PEROUT_REQUEST leaves about 15 pulses a second on the > pin instead of stopping it. >=20 > In the XGMAC register MAC_PPS_CONTROL, bit PPSEN0 selects what bits 3:0 > mean. When PPSEN0 is set, they are PPSCMD0, a command to the flexible > PPS logic. When it is clear, they are PPSCTRL0, the frequency of output > 0 in fixed PPS mode. The disable path in dwxgmac2_flex_pps_config() > clears PPSEN0 and then writes the stop command (0x5). The MAC reads > this as PPSCTRL0 =3D 5, so output 0 switches to fixed mode at that > frequency setting. >=20 > Set PPSENx when disabling, as the enable path does. Commit 520cf6002147 > ("net: stmmac: fix disabling flexible PPS output") made the same fix > for dwmac5 after the XGMAC code was copied from it. >=20 > Fix tested on the DE25-Nano. >=20 > Fixes: 95eaf3cd0a90 ("net: stmmac: dwxgmac: Add Flexible PPS support") > Signed-off-by: James Clark Reviewed-by: Lorenzo Bianconi > --- > I used an LLM coding assistant to help prepare this patch. >=20 > This can be tested on the DE25-Nano using the FPGA design at > https://github.com/jclark/de25-nano-debian, which connects periodic > output channel 0 to pin 6 of JP1. >=20 > drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/driver= s/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > index 6b2bfc241109..c43e8c597a09 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c > @@ -1171,6 +1171,7 @@ static int dwxgmac2_flex_pps_config(void __iomem *i= oaddr, int index, > =20 > if (!enable) { > val |=3D XGMAC_PPSCMDx(index, XGMAC_PPSCMD_STOP); > + val |=3D XGMAC_PPSENx(index); > writel(val, ioaddr + XGMAC_PPS_CONTROL); > return 0; > } > --=20 > 2.56.1 >=20 >=20 --HIMTD0hoqNIwbybL Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCaxQTUgAKCRA6cBh0uS2t rNJmAQDOdbbO2M6iM9X4PlwKztF+YXUzZP49gDHHH6+QrE6BDAD+JQZfjUNdrKxw mO7+DWFhRwWX6OjgcdJfoJO5RoL5twM= =Tlfp -----END PGP SIGNATURE----- --HIMTD0hoqNIwbybL--