Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp577746rdb; Thu, 21 Dec 2023 20:34:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJI4J8msqT8MeI11d1k/DwyX/LxWI90hMRcfU7pvZ7cChxrmJVhamsw7txP2sqC9K+KG2+ X-Received: by 2002:a05:620a:13e1:b0:77f:bfcf:a202 with SMTP id h1-20020a05620a13e100b0077fbfcfa202mr943315qkl.156.1703219685293; Thu, 21 Dec 2023 20:34:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703219685; cv=none; d=google.com; s=arc-20160816; b=wVgu72sqLhLkTYwGB5lwuU3hunUNmRDPE0yzUBKmuRO7y6na8TskoKr72QiMlFn0qJ I7lVeiuKSSwY2It15kMg75EHwHHF18vNTqb7e8+/QcgLU2crdkeKP7W4xYtIR9se9n27 A++4ri/vttTRH8UgDBxzGw+PlsVw8o2wnGFs9Ma+d4e82zMkjDD24JZQ0j5+hBCThn3S GN1un9lgZ4VaRmkTncZQj0sR/WAu4eWXFQraS+gRMO3REr+ir/qYqfI/oCi4Tkm8d0dD T0x8i0GFwFFUhaRvxHJU/9ng9ZvwaADmoq+xGakWlYyqqML9cDn2zRem1/aOBKCeMX3H 6+Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=cq3bS43kQ1OV36R627XQD8f9TpMkA/PC5nZ9emNcAsE=; fh=N+rrpmQ6QSrfmpEHABQJxlUuiLftgK+oTui9WzpRyXM=; b=hgljwVk06MKzBU7tCy9WbyH1IBEqddMlKB+wqJqJvo32290e1VI0Z00XFNrYrGCQbF 25GywUg2qhzjzTgnTHCbrNK2GIAGzVFsoPmfTNlAlw9X3ums2byx1di66TBAhEYMM1zl nP1TNU6RGFs1F2ohd0DTMJRu+stE+8sICnLoK+q37qbrwwZFfRYpNHEZ7zkkP8AbPSz4 wCI38Yyk+91bqmhSs0d2cbmhnBkPLlp5khDwe6xLgNNIVC7UfByzMSM9ECpieqUt/eMw Uo/yIHA4UHpVxse/97JLBn1n1czIMWC5j87xxwt+eSEYWpZ7H9bqYy5z2IPxc9ZP19hW H6OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=qGy5QGaF; spf=pass (google.com: domain of linux-kernel+bounces-9316-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j10-20020a37ef0a000000b0077956418783si3518024qkk.652.2023.12.21.20.34.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 20:34:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9316-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=qGy5QGaF; spf=pass (google.com: domain of linux-kernel+bounces-9316-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9316-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2785B1C21AC9 for ; Fri, 22 Dec 2023 04:34:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BC4353A8; Fri, 22 Dec 2023 04:34:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="qGy5QGaF" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) (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 A711B5395; Fri, 22 Dec 2023 04:34:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Received: from HP-EliteBook-x360-830-G8-Notebook-PC.. (unknown [10.101.196.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id A9F334137C; Fri, 22 Dec 2023 04:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1703219657; bh=cq3bS43kQ1OV36R627XQD8f9TpMkA/PC5nZ9emNcAsE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=qGy5QGaF7gYWurnr7jkmMMi9LB145iqDV/c8NTEgZ6+iSzvuG/9jSQ4AFGTGh3mv9 lZgThBY8uC7bvoGaYSWc6xcoCkHK6xPND4AbPASorMZpuDbe0FbBKxI7aCTN3tvUd+ BTlFZNqsGnMIKwwvB3wx24vhmlK3PaM/ZgAl2+LyR/htE7PUnS7LbJCFY0l+B5eYMZ 7ox3rw3qzljQRQmtswrNJCcYLx7jf7qE2+re1blk8U3njgfBtm0Ua+Zu9IGoPNCJxB L6pq8fxFGfTTtwaMZGGGrhSeZ1IhHWht1SOGE3sF8212T1EGW5iL9zJJQVvFuZe6x2 fxBHk0YNQLn6A== From: Kai-Heng Feng To: hkallweit1@gmail.com, nic_swsd@realtek.com Cc: Kai-Heng Feng , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v3] r8169: Fix PCI error on system resume Date: Fri, 22 Dec 2023 12:34:09 +0800 Message-Id: <20231222043410.464730-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Some r8168 NICs stop working upon system resume: [ 688.051096] r8169 0000:02:00.1 enp2s0f1: rtl_ep_ocp_read_cond == 0 (loop: 10, delay: 10000). [ 688.175131] r8169 0000:02:00.1 enp2s0f1: Link is Down ... [ 691.534611] r8169 0000:02:00.1 enp2s0f1: PCI error (cmd = 0x0407, status_errs = 0x0000) Not sure if it's related, but those NICs have a BMC device at function 0: 02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Realtek RealManage BMC [10ec:816e] (rev 1a) Trial and error shows that increase the loop wait on rtl_ep_ocp_read_cond to 30 can eliminate the issue, so let rtl8168ep_driver_start() to wait a bit longer. Fixes: e6d6ca6e1204 ("r8169: Add support for another RTL8168FP") Signed-off-by: Kai-Heng Feng --- v3: - Wording - Add Fixes tag - Denote 'net' in subject v2: - Wording drivers/net/ethernet/realtek/r8169_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index bb787a52bc75..81fd31f6fac4 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -1211,7 +1211,7 @@ static void rtl8168ep_driver_start(struct rtl8169_private *tp) { r8168ep_ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_START); r8168ep_ocp_write(tp, 0x01, 0x30, r8168ep_ocp_read(tp, 0x30) | 0x01); - rtl_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 10); + rtl_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10000, 30); } static void rtl8168_driver_start(struct rtl8169_private *tp) -- 2.34.1