From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796222453; b=uLX1cc1o5phJYfzgcDbp7v/cmLjA2k5xZB+LtnH+EBWkU2zuj0Q7iP1yb7qwtYVQgAEn /6WYWiy7XcHsRVSxhG8p/Ftd2JPZjJygPylCW+7EZYQEXvlXpenJTFE12C21j4yjdoQla tlbDQi5a6AYUfMdaxgjitIs0aBiRUkaYJu3pn5ww4S9MWRq4uykAyRWouw1mevRKXqyJs /RRNl4olo9c6Vl5J8AX6sn3YI3iJh/32ZxNmDr7pPENUfHZH9PjyxybbIl9NrbNXsytvy b311c38DBgwxpQtGVCUiWYnTnmkz03AdcTF+EZQEIRlA2dHS96aJS4q0QLcTwIBiGQA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796222453; 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=sahc+e1PIjyP+rnZI+BaLWsjhLUfXGII4rS7xX2iIU0=; b=f+tKdowKvuovU+QMMDaZ0LO4uH5hBNm3ZcTIgwi5qPbdMEY2XtV38zgvAf7F1ZvguD02 C33MReNOA9FB3DCoIiu3qE+TbD0YyxTTOZjadCzRM8nQC5PsLTks+m9IUuoCxY0bUCIBv VFGsZCbsNxIQiLU0sp+J6RGiNWUT45BdG9JEQSnolGOAvianEt0A0oeyqvaHgVwerKLBZ eT/MiUnA7+Yn5Y/ioeNzBDTFrwNk9mgTgN0758/eP5e6W2fJDV+0xGd5VKYFxCkmzGJbe vaHXheFwZ5ly2+dg3iFkCnb+gQjwkEyufQT5SJO9Lli1b3ccb85hLebRTDEqliItFzg== 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=mpBDILN6; arc=none smtp.remote-ip=95.215.58.174 Received: from mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 D5033606A322 for ; Wed, 2 Dec 2026 14:40:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D5033606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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=mpBDILN6 X-Envelope-To: netdev@vger.kernel.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: netdev@vger.kernel.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-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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)