From nobody Wed Dec 17 19:41:23 2025 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 511C378C9C; Mon, 6 Oct 2025 03:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759722895; cv=none; b=M0zHqZTZGSsY6gRMp1/GsZMnZ5tudQTE0TapJH/MvkpDq693imlj0Vq70sXYxgMCoZDTswfO8XhpIwpvqmtGEvhr6KOO4ashr1QNIGXZHXTP4Hyjhc/qSaQ3ex0joXEVF/fxDpIhfOKOXg7oBlCyC4C/k94MHHblUu8h/ZGb82I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759722895; c=relaxed/simple; bh=gqLcQ7RqXkovZeXFiaAwJnyASFvXFRIXCS/zaEP80gg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=GhdRUZFb+XZKnIJOTR5Y3B6al9+CcrEfvPRXTTLeV2E9MPlwSOASYgZbm+EXuzWvrbWLWnOG7GcsIXJi9KchpwoPECp0LgPq5B2kDHD+os62qwfuoOOMDaGVvuJ1nPjbC2poX19B+4sGpbRT+peT2T5PUDEqw3Rpmc0Exal30B4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 786a6412a26711f0a38c85956e01ac42-20251006 X-CID-CACHE: Type:Local,Time:202510061127+08,HitQuantity:1 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.3,REQID:4024681a-9057-48ca-acb3-5b95a563ea86,IP:0,UR L:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-25 X-CID-META: VersionHash:f1326cf,CLOUDID:fba4adf866208d8802773314a9dcaa41,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0|50,EDM:-3,IP:nil,UR L:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,S PR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 786a6412a26711f0a38c85956e01ac42-20251006 X-User: lilinmao@kylinos.cn Received: from llmserver.local [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1154822787; Mon, 06 Oct 2025 11:49:33 +0800 From: lilinmao To: hkallweit1@gmail.com, nic_swsd@realtek.com Cc: kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Linmao Li Subject: [PATCH] r8169: fix packet truncation after S4 resume on RTL8168H/RTL8111H Date: Mon, 6 Oct 2025 11:49:08 +0800 Message-Id: <20251006034908.2290579-1-lilinmao@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Linmao Li After resume from S4 (hibernate), RTL8168H/RTL8111H truncates incoming packets. Packet captures show messages like "IP truncated-ip - 146 bytes missing!". The issue is caused by RxConfig not being properly re-initialized after resume. Re-initializing the RxConfig register before the chip re-initialization sequence avoids the truncation and restores correct packet reception. This follows the same pattern as commit ef9da46ddef0 ("r8169: fix data corruption issue on RTL8402"). Signed-off-by: Linmao Li Reviewed-by: Jacob Keller --- drivers/net/ethernet/realtek/r8169_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethern= et/realtek/r8169_main.c index 9c601f271c02..4b0ac73565ea 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4994,8 +4994,9 @@ static int rtl8169_resume(struct device *device) if (!device_may_wakeup(tp_to_dev(tp))) clk_prepare_enable(tp->clk); =20 - /* Reportedly at least Asus X453MA truncates packets otherwise */ - if (tp->mac_version =3D=3D RTL_GIGA_MAC_VER_37) + /* Some chip versions may truncate packets without this initialization */ + if (tp->mac_version =3D=3D RTL_GIGA_MAC_VER_37 || + tp->mac_version =3D=3D RTL_GIGA_MAC_VER_46) rtl_init_rxcfg(tp); =20 return rtl8169_runtime_resume(device); --=20 2.25.1