Article View: linux.kernel.netdev
Article #8375Re: [PATCH net 2/5] e1000e: do not cache the hwtstamp config before it is applied
From: Vadim Fedorenko
Date: Wed, 28 Oct 2026 22:12
Date: Wed, 28 Oct 2026 22:12
60 lines
10578 bytes
10578 bytes
On 28/10/2026 09:04, Linkui Xiao wrote:
> From: Linkui Xiao <xiaolinkui@kylinos.cn>
>
> e1000e_config_hwtstamp() stores the requested configuration in
> adapter->hwtstamp_config right after the rx filter has been
> translated, but the two register writes that follow are verified by
> reading the registers back and each of them can fail with -EAGAIN.
>
> When one of them does, the driver is left holding a configuration the
> hardware never accepted:
>
> - e1000e_hwtstamp_get() hands it back to user space, so an
> application that reads the configuration back is told that
> hardware time stamping is in effect while it is not;
>
> - e1000e_systim_reset() re-applies it after every reset, including
> the ones the watchdog triggers, and keeps failing;
>
> - e1000_watchdog() starts polling TSYNCRXCTL_VALID for the cached rx
> filter, and e1000_xmit_frame() still parks skbs that ask for a Tx
> time stamp because it only looks at FLAG_HAS_HW_TIMESTAMP, so they
> are eventually dropped by e1000e_tx_hwtstamp_work() with a
> "clearing Tx timestamp hang" warning.
>
> Cache the configuration only once both registers have been verified,
> so that adapter->hwtstamp_config always describes what the hardware
> is programmed with.
>
> Fixes: 62d7e3a2d006 ("e1000e: Validate hwtstamp_config completely before applying it")
> Cc: stable@vger.kernel.org
> Signed-off-by: Linkui Xiao <xiaolinkui@kylinos.cn>
> ---
> drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 35f5590228eb..7ae33273734f 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -3715,8 +3715,6 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
> return -ERANGE;
> }
>
> - adapter->hwtstamp_config = *config;
> -
> /* enable/disable Tx h/w time stamping */
> regval = er32(TSYNCTXCTL);
> regval &= ~E1000_TSYNCTXCTL_ENABLED;
> @@ -3763,6 +3761,8 @@ static int e1000e_config_hwtstamp(struct e1000_adapter *adapter,
> er32(RXSTMPH);
> er32(TXSTMPH);
>
> + adapter->hwtstamp_config = *config;
> +
> return 0;
> }
>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Technical Details
Message-ID:
<6b9f70ca-86a5-465f-af09-2df49ee11628@linux.dev>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353053-linux-kernel-netdev=dewy.ruReferences:
<20261028090455.2291659-1-xiaolinkui@126.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353053-linux-kernel-netdev=dewy.ru From: vadim.fedorenko@linux.dev (Vadim Fedorenko) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 2/5] e1000e: do not cache the hwtstamp config before it is applied Date: Wed, 28 Oct 2026 22:12:31 +0000 Organization: Usenet Network Message-ID: <6b9f70ca-86a5-465f-af09-2df49ee11628@linux.dev> References: <20261028090455.2291659-1-xiaolinkui@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1882174"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:0OyF/LQn5FbW4Gm+WkB0bxUmnBk= sha256:M+QlVpM80z3DGBAXwXrJmKaZF2HDmKaP9RTRn66qoVc= sha1:ZxYr8GDninEQ54gGN6gmZrliXwc= sha256:fWCgJOk8XB8KYtzcedoFIsFqQv0/tWIkq4i+UKfBLjw= Content-Language: en-US List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1344C125C4D; Thu, 29 Oct 2026 01:13:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KWbicNrEhO70; Thu, 29 Oct 2026 01:13:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-353053-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 3379E125C44; Thu, 29 Oct 2026 01:12:52 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 4F8C626C14; Wed, 28 Oct 2026 22:12:51 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793225571; b=Nu+NVqVYr2J7IU42GGPpjNEsRecj3LksLdjmd6myvfZYC9VZfgIpz+Vc7+Nku+CjMQOO EO8rdQKb4a+TmOIodpqe6grv3JgcEq3opvId99mY4CDS0ElnVEVNTkt2R9vH/9qidzqP6 gEHFKmq6xP05TILwlq5ikHSRRws3D8fShgGQq3khmOMT2H24vDCzLaLNi9qexBetKYNI0 XIvFsGg22tYNOi9+U0CpQLQEpmynv4kvWVZquvOaOT3Ifvnjif/nlmOErp/AjRSTTuQou ZH+Aboh85Ax0uUqG9ZZjlrYjs9zDJRHz1Od3XToBr2atg4HTy3xmDFIgIYUIcH1g55A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793225571; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=M3Ck9eyVD75IOnRETh1mD4sLHe0E+TueuPB6Ea2RtIc=; b=l6itPpeo1jfxmJNl/EReDZ/JQzUesJrfxGSLHVPMiqcKdSJEC048XLl2c4dhdc9O5xeL 8HZ8tcbc9gsDQj5SY9TjQuG8XfBBjkg5v7sL9dZyXaAjy9k8Wg2l0937mmX8SG8kd9f4K 6IxIulDKwBtDBb2e8l4zNbX0f3JJrRmzTSEckpCmmj3ZJDTu88Hf1LF3z2aomeIAPmuR7 B9sq266OUXPgblMyqH9sLbhiVkAzri6roGMnCGvXgrw9xnPU5aBtmOBEFXW2fHAQy4P4j 7YHysEEJa/xDIbB6oSzFagtxPL2JVvPeV/IWLaAPTXDMbmlAUZJgi/w23XXgSO9Q2WQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=uxe3tKZD; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8CEF606A322; Wed, 28 Oct 2026 22:12:50 +0000 (UTC) X-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=uxe3tKZD X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.147 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793225563; b=Yk5u2yuWyGVWDdxPCuruTs/Tc4iseUJqBNSfJ7wDi5MTTc+BdKWxC8uxLI7xfaYtImx4 Ix2cq0GCJIKP+4cfjmp5G+2yQObevgc4r1sZ+E/7gh49sPUpbCXDYigSFpSzhil51RbFq C+bY4ktzJAk+nYINy1wTqm0be2/J1wOmtbcNdD96wcXkNB/TfTQ6Pc3qascDht0FSJ9Mt WQXwu0eu2qfJmW+j1+zXpE89tEuHlO5YIsJnQv2ZRTHNt6lMSNTyQ8TdzjsKVT/c6u94L 9lXQIJiJ3HUJoNrYEYuKJGGw80CfzYUS6oM0io+dsHaYnZmYb9CnHjyt/ubhoWpAw+w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793225563; 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=M3Ck9eyVD75IOnRETh1mD4sLHe0E+TueuPB6Ea2RtIc=; b=oJWlOxJSOnSkLHh0I/1ByE79oJmeR5npbjw+zeCi1iuem2LyjUj1Zcx3iYGYx6T83Tpv AhCDEeV+fTm+DBgwdIO7OxrrkSU5Xe7+5sEA7B0hxasID+TnZGnRWdilIgUvbvKZO4e04 Okeu601m3FTiU1ERlXXl9wxqyGO8OrTeuLx5n8kaYlT4NP/rTQAWCHyu5TfI9lRHKq+Fd WBBDKXE4e8oNA34PD+J84UClpjNFWz/FgHwnQn7zZiSsKQBFeyVLvlbD6nPJDvaLyKw3W 273Z8vAIRGSFXDCXRb+vqxGmeBZSl2/OGMLdZqZE0niuzvGyrJk2xs9TTHcSXiQ1Wyg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=none smtp.remote-ip=95.215.58.147 X-Received: from mta1.migadu.com (out-147.mta1.migadu.com [95.215.58.147]) (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 02C77606A31E for <netdev@vger.kernel.org>; Wed, 28 Oct 2026 22:12:38 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 02C77606A31E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=Y+Decs/7/+vp1xu4bxl9QSBsBoAQltojViXKsaLAsUQ=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793225556; v=1; x=1793830356; b=uxe3tKZD3rgWKDBrvKJdhzEHdVT5FOsyiurK82BE0r3CCx1NjDF/Ox1X/7UzJ8TiRg2H1mXH 6Riy7L0RQ/c+7UjW6euETgs66c3dk35K34lojEdkGxNygQxZ4pUbDHssGUd+TrbPpk8TYp+k90y NUsJ+/PWqNgYmINEprxnYf3s= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id c8b5232d2f55aa01; Wed, 28 Oct 2026 22:12:36 +0000 X-Mizu-Trace-ID: c8b5232d2f55aa01 X-Migadu-Flow: FLOW_OUT X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird X-Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Linkui Xiao <xiaolinkui@kylinos.cn>, stable@vger.kernel.org X-In-Reply-To: <20261028090455.2291659-1-xiaolinkui@126.com>