From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.13 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796112400; b=i9pVPvcgNWSV99zCwUBg+NpEZW08DE2EWiE9mRPP5OdfopY1ZcmZLRoy5TUFIw2vvIWP tdmyFShxPKl+nKbS2uL6Gky2cVFh4QKA4DyfSLSsgMZRBZIjN3WY9h8yPL/qiRj38cwU7 U07zXf+y6/wx9+HzuHvqhguHwDEXkj6SXKAId7LFyw+W0e7Q4eNfYIulcm/9taHDP1ld5 ioYA8atJ/i40bLFoJradvQHbdVM+3T3BELAqC0p5hzEtTGFXGqX1JLIXwfgNv3Z4Yke1o GDu8NindkkJbwDVU2tCUqChWqGXCGAzC9rDJBkhR5So7r7Tbg2R61rOJOEiJR++Mp+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796112400; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=429LOyfkjbHQdAQFqDWTCmmRYRd0Fyf9s5STchs8xQY=; b=Wx8KyiECJJwyscmIPuXAXJfEWFEKyf7KzXFgEoHhGJfKqHzAWmnW3AgAd3a0XMrqZlqv +bI+2dVZB4kGmixhEC8di1WBCBErFyDaZcjoRKu8vkik3WzpDDLU0uVLFXZtMSjFdZ9lT rvOSGBTTnzWvpu/2nZ/TX8nBiIy9qzOaKMSZvN0CpzMvgGjgUNZ8muBYX6tHMAO+em4f5 32bkch9SowTdzx3hjGWqAcR3nW6szXkTAc+bvCnQswgW+YdqWgLCJo27VG0mz0yAe3hYA CAfjOBadY1KMhoInFW2bjpBVoMLx9sqEugTZTAaNdAOI9qKfUVroH0i88wQQcwicdRw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=bFcXcWTv; arc=none smtp.remote-ip=192.198.163.13 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54899606A31A for ; Tue, 1 Dec 2026 08:06:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 54899606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=bFcXcWTv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796112399; x=1827648399; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=429LOyfkjbHQdAQFqDWTCmmRYRd0Fyf9s5STchs8xQY=; b=bFcXcWTvLoFhKQ/l4fZ32nUtBrdMbu5swk4vI8UMwkn5A8LcoAsoqDIS +CJIjRZ807CSnKyHF2qBsAJdUdSYnAoGzXOxgLjf0sZ7oLMF/m23oJlRg 41FLbxMbAQibCtDVa3yl+CocFVJH6nssz2ToiSKoVzaKj6dcr3HBpxJRP tv9KTFyu6mo3pjFZtG84Gndo9hfs7dZknhk3s69odyfe6DEnFWfO9/UyZ mJ9C2sZBFse7m5WpXv6eZ/8n2+3Zs+8g93mrRdd96YGdpp2Got4Z7GiLI cI+0da/ReKN8en7AfhddRoHt1MsRAVYdNO14lUCrPJpeH3P92SB7COnKt w==; X-CSE-ConnectionGUID: VKRi6pF0TiyNg2GdrcICQg== X-CSE-MsgGUID: 1wzUHfUVT0ijrceZTiFrvg== X-IronPort-AV: E=McAfee;i="6800,10657,11982"; a="4939267" X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="4939267" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 00:06:38 -0800 X-CSE-ConnectionGUID: aGMHhDFSQsWP4pMgioKo9g== X-CSE-MsgGUID: oq47FgSjTd+wD78vRZNGzw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,244,1787036400"; d="scan'208";a="12985439" Received: from unknown (HELO localhost.igk.intel.com) ([172.28.191.211]) by orviesa005.jf.intel.com with ESMTP; 01 Dec 2026 00:06:38 -0800 From: Maciek Machnikowski To: intel-wired-lan@lists.osuosl.org Cc: maciek@machnikowski.net, netdev@vger.kernel.org, Maciek Machnikowski , Przemek Kitszel Subject: [PATCH iwl-net] ice: fix slow signal rise on SDPs Date: Tue, 1 Dec 2026 03:06:20 -0500 Message-ID: <20261201080620.149128-1-maciej.machnikowski@intel.com> X-Mailer: git-send-email 2.56.1 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-Transfer-Encoding: 8bit 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); -- 2.56.1