From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4A0D5606A31A for ; Wed, 2 Dec 2026 14:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=kv2fkihF; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mpBDILN6 Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 26024606B6; Wed, 2 Dec 2026 14:41:00 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gnaHZiMm8yDe; Wed, 2 Dec 2026 14:40:58 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp3.osuosl.org 7A5D0606F0 Authentication-Results: smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796222458; b=ExiKZcFOEj0Ngkf5Ocxp+JZ51qM1JpWF2PwY0mwFzpTFYcN2UAYedyDLRb/SHiJfY7/q Pr4VniPFnHPBQtF0icHv2Nu4Hs6Icv1L4roU/BneZvNucA07U3Q94BEMs9T9o0my5S9pL HiENckZN25mRmt5nSX6DEddGXWVB1z6KasXLjW8t6Xvmx/17dG4giYvPjlqpkwiYWXN3h FrSIaWE0veYnQlX60DzN/dX6OyKNTF2/kwvNP6vu1b/r3eVr3XMjadqaTXMgkaOFaqArm Nh+0xcWErO6DYx5WGTSapxRjBQas/XFR40bWxdQR+lrLdi8Ab/179lBgDnOlP7KmNWg== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796222458; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received: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:X-BeenThere:X-Mailman-Version:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=sahc+e1PIjyP+rnZI+BaLWsjhLUfXGII4rS7xX2iIU0=; b=KFxepmvFGBZ45kT850SUccZRKuHUK2tpcOD7MIGW8+MiPY+FMyxsVu2ZZDXanspX8zy0 epyc/3TZlSLnD81mSnZrY8rsTGqhZJBCH76+E/2H0fL/AtaSNkC2Dr0ABPoHxgAyVcyZq 7fsE3J4PA+v6N5SCXtnOMvrtz9qjYcSDyiCZ//opNhzrxpluDStDw+lhmiYvpnHwnVAD/ hgm3PJ/s6UKodGq9zDXQr6waRmU/a8qjZ3AW4CkKrhh1VQa8Vs+hLfIczrvRqkW6ZnNFD LM33gXXHcf77TSuUmziXOaa2TZAvQyVFahiN0EnzG8rDodakdL7Agx4vUSRTdirmsRA== ARC-Authentication-Results: i=1; smtp3.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1796222458; bh=sahc+e1PIjyP+rnZI+BaLWsjhLUfXGII4rS7xX2iIU0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kv2fkihFShbWimNY2omvQS84wadC72yGR7/YCMSI/zY1THavGTrfJaLj7ov98omIj i5YoJ/nNk8iqqchM75/5PMS5dotT+HvIc0+MGQPcutIntWRrlRRD/U4bBoLUswP/AE P2dIAiJJ49kLxpaa0iXZp9ppitLdNazT/Yy+9fS2XUNpZZ/gPiHzDnEsZy3hflEEwX 7mRqajAglsMs6RloMLjOZ71s/XaRwu5N78ZhNxVNeH4J+gdhXs2DSs3qzv6UNwQZxj 7lQjkbmTmPvLcngXPHTvZZiC8u8SwVFfRnFFWBLvBgVuqeU0vPQ5bg54NyzZ4PcsYD pEuxGzvo6Wu9A== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 7A5D0606F0; Wed, 2 Dec 2026 14:40:58 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists1.osuosl.org (Postfix) with ESMTP id 2E482158 for ; Wed, 2 Dec 2026 14:40:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 20222401CD for ; Wed, 2 Dec 2026 14:40:57 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id BiRWv-HhrcSO for ; Wed, 2 Dec 2026 14:40:55 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp2.osuosl.org 10433400F5 Authentication-Results: smtp2.osuosl.org; arc=none smtp.remote-ip="2001:41d0:1004:224b::4f" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:41d0:1004:224b::4f; helo=mta0.migadu.com; envelope-from=vadim.fedorenko@linux.dev; receiver= Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=mpBDILN6 Received: from mta0.migadu.com (out-79.mta0.migadu.com [IPv6:2001:41d0:1004:224b::4f]) by smtp2.osuosl.org (Postfix) with ESMTPS id 10433400F5 for ; Wed, 2 Dec 2026 14:40:53 +0000 (UTC) X-Envelope-To: intel-wired-lan@lists.osuosl.org DKIM-Signature: a=rsa-sha256; bh=cwvXTrucwACm2pZad9AV3DtGUbNiDzRaRJDFwFyILfg=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796222450; v=1; x=1796827250; b=mpBDILN6cyS1BIbOkCneZU4XzkYUqXj6Y7E3ytE8uD0mEZvcTXelXH8E5Upd6tzj49pRZI0D ov+OjHQ3iFQUVnYBj7RaWzu+gqdcIJjTAPU3hxNq/bLJzPyfzRZQtlSbght8zMlv/kiq+tsm+zX bk2VCMoyCBPG8gst+dsPlY1Q= X-Envelope-To: intel-wired-lan@lists.osuosl.org Received: by smtp.migadu.com with ESMTPS id 7033ba0a6e8e3ac1; Wed, 02 Dec 2026 14:40:49 +0000 X-Mizu-Trace-ID: 7033ba0a6e8e3ac1 X-Migadu-Flow: FLOW_OUT Message-ID: Date: Wed, 2 Dec 2026 14:40:44 +0000 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH iwl-net] ice: fix slow signal rise on SDPs To: Maciek Machnikowski , intel-wired-lan@lists.osuosl.org Cc: maciek@machnikowski.net, netdev@vger.kernel.org, Przemek Kitszel References: <20261201080620.149128-1-maciej.machnikowski@intel.com> Content-Language: en-US From: Vadim Fedorenko In-Reply-To: <20261201080620.149128-1-maciej.machnikowski@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-15.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 01/12/2026 08:06, Maciek Machnikowski wrote: > When an SDP (Software Definable Pin) is configured as a periodic output, > the driver already sets PIN_DIR (output) and PIN_FUNC (routing the pin > to the timer's AUX output) in GPIO_CTL, but leaves TRI_CTL cleared. Per > the hardware definition, TRI_CTL (bit 5) is meaningful only for single > ended GPIOs configured as output and driven high: 0b tristates the pin, > 1b drives it high. > > With TRI_CTL cleared, the pin is driven low but tristated instead of > driven high, so the high level comes only from the pull-up and the > rising edge is slow. A device that timestamps this signal sees the > rising edge late. The measured delay was ~6 us, and it depends on the > board and the load on the line. This adds an offset and jitter between > the PHC and the device that consumes the signal. Examples are a second > NIC using EXTTS, a DPLL input or a measurement instrument. > > The problem was found during development, while validating periodic > output signal quality with an oscilloscope. It was not found by static > analysis. > > To reproduce, enable a 1 PPS periodic output on one of the SDPs, e.g.: > > testptp -d /dev/ptpX -L ,2 > testptp -d /dev/ptpX -p 1000000000 > > and probe the pin with an oscilloscope. The rising edge is delayed by > ~6 us. > > Set TRI_CTL, the only missing bit, when enabling periodic outputs, so > the pin is actively driven high. With this change the rising edge delay > drops from ~6 us to ~50 ns. This has no effect on pins that are not > single ended SDPs, such as the differential 1PPS output. > > Fixes: 172db5f91d5f ("ice: add support for auxiliary input/output pins") > Reviewed-by: Przemek Kitszel > Signed-off-by: Maciek Machnikowski > --- > drivers/net/ethernet/intel/ice/ice_hw_autogen.h | 1 + > drivers/net/ethernet/intel/ice/ice_ptp.c | 7 +++++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_hw_autogen.h b/drivers/net/ethernet/intel/ice/ice_hw_autogen.h > index 082ad33c53dc..1d538a04196c 100644 > --- a/drivers/net/ethernet/intel/ice/ice_hw_autogen.h > +++ b/drivers/net/ethernet/intel/ice/ice_hw_autogen.h > @@ -154,6 +154,7 @@ > #define GLGEN_CLKSTAT_SRC 0x000B826C > #define GLGEN_GPIO_CTL(_i) (0x000880C8 + ((_i) * 4)) > #define GLGEN_GPIO_CTL_PIN_DIR_M BIT(4) > +#define GLGEN_GPIO_CTL_TRI_CTL_M BIT(5) > #define GLGEN_GPIO_CTL_PIN_FUNC_S 8 > #define GLGEN_GPIO_CTL_PIN_FUNC_M ICE_M(0xF, 8) > #define GLGEN_RSTAT 0x000B8188 > diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c > index 30bc2d8aed9e..803744ff1a89 100644 > --- a/drivers/net/ethernet/intel/ice/ice_ptp.c > +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c > @@ -1762,9 +1762,12 @@ static int ice_ptp_write_perout(struct ice_hw *hw, unsigned int chan, > > /* 4. write GPIO CTL reg */ > val = GLGEN_GPIO_CTL_PIN_DIR_M; > - if (!!period) > - val |= FIELD_PREP(GLGEN_GPIO_CTL_PIN_FUNC_M, > + if (!!period) { > + /* TRI_CTL=1 drives SDPs high instead of tristating them */ > + val |= GLGEN_GPIO_CTL_TRI_CTL_M | > + FIELD_PREP(GLGEN_GPIO_CTL_PIN_FUNC_M, > 8 + chan + (tmr_idx * 4)); > + } > > wr32(hw, GLGEN_GPIO_CTL(gpio_pin), val); > ice_flush(hw); why is GLGEN_GPIO_CTL_TRI_CTL_M only applied to enable operation? does it harm when it's always applied? just simple patch with less LoC: /* 4. write GPIO CTL reg */ - val = GLGEN_GPIO_CTL_PIN_DIR_M; + val = GLGEN_GPIO_CTL_PIN_DIR_M | GLGEN_GPIO_CTL_TRI_CTL_M; if (!!period)