Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp953233rdb; Fri, 22 Dec 2023 09:39:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzgLabR+ms5DuYxKlFInx84MbDw5QAiF4zp5yiFcoOqsLKzC/IJc9c+pz/MQOu65/ba7T4 X-Received: by 2002:a05:6a20:6a0a:b0:187:4cf5:f171 with SMTP id p10-20020a056a206a0a00b001874cf5f171mr1562403pzk.2.1703266752440; Fri, 22 Dec 2023 09:39:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703266752; cv=none; d=google.com; s=arc-20160816; b=LN2ET1PbiEMVXsRt1R2xav2iY8ApEuxYBlk32D0V7JDMOKvhleUuifIAQvuY4fIWGP nxpiAb+fWncGX/sXq3Xv2zwp7ofw3Cy7eMgMjeM45F8NBCoMD33sObIEv1gBdUJ1/VSP 0JC2dTXlwkzSq9EQKpzklHOocItX10BLp0wSO/nQmX5lgp1nW9wzJFbVDyeZzHQpUuAD MTQJILNiu5x/R/7pL1SjR5LDk4VlLmXJazY6e2fKebaMI+zmb8vcnIkC+GeRoFxw7iMP DFuCUpMEknSc6sbImnjCEC1LauwSd7Hruz3vbNi4pZQI0NhC2IJu8GUdcbFTTBntIGMZ 5eAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=ZARMDRQx5b0ETS4xAtKMNDsGnlh68sgD0DmPNz7BzDE=; fh=1/wn73yAI306hX68n2cI9+atC58JgU9JFvNtc0pEHYg=; b=staZJKsHD2KjVToNRt7TfTzgYs9ZhRGAN9EGVzVEUHU1h4OSzVdHTGlrS7YbDjck/b rUH0+wpkQ/la4vsXxFNo1lBTq7Aq3CRiRCZFOF0mszL3R4M9H7ENcXM5vH9vU5Hvk09c 0vHzXWOdYuaizsyvw8VU1Rc/0/yqLx9PZEEac2/G8KB+SR2xMQNW5LyExle/seBs4Rul vW7UCuAvN/TEcsszMXO9xCWrhBOZ8wV6XGbsbTJ048X7yP0/FGd9PijhVsTCN38Bo7ot dAVQmzidoevVs5BUu7e7X/3n8LUhjmwzh7MDqaI4G5SNjSVmZakv5PENVdmEwPTNgu86 N5PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iJkjV8KH; spf=pass (google.com: domain of linux-kernel+bounces-9946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t4-20020a17090aba8400b0028bde3ae7f1si4284872pjr.186.2023.12.22.09.39.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:39:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iJkjV8KH; spf=pass (google.com: domain of linux-kernel+bounces-9946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9946-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DBE90B23F9F for ; Fri, 22 Dec 2023 17:39:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A4D628DDF; Fri, 22 Dec 2023 17:38:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iJkjV8KH" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B1A228DB1; Fri, 22 Dec 2023 17:38:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ccabf5a4beso8911961fa.2; Fri, 22 Dec 2023 09:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266733; x=1703871533; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZARMDRQx5b0ETS4xAtKMNDsGnlh68sgD0DmPNz7BzDE=; b=iJkjV8KHVUwVKkOh36CQo6sHLLzDb8o57VBXl0UxOrZhOuK9/DBkY1DyhnbMXGl3KK tYksL73snXL0yVeM9K/JqlLHi/5+LUMCTLA5C9zoH9HzFYAn9bQL5rTHffP3PAncaNp5 gb8edY98+B3vOHEihEt72GccJuO3vPEU4/uOidOBfMsmcUsiszKM42kzQjnXO/hGL1mJ jhK6dZX7eOmE0um9l3V6zmo7VyXUO44X6KhOe1q5aDAvrLQmULd1+CyNQFNsyyHcN8K8 GwZFN99I5kcHR6FZM6RaJwbYLZ15Q3xntmsgwBw+GV1BJvF0QjzY17D6Yc+iasVWpSMi 7bGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266733; x=1703871533; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZARMDRQx5b0ETS4xAtKMNDsGnlh68sgD0DmPNz7BzDE=; b=hfb6012nAfxMpsGAKgJ8o7sgnSjbDjZtQpGcLWvJj+VnRXYzjZhPnZ85Qc7fQ1n1vy P95zOOHvWbOyZm4KQRjnEIG627sYaui5Vgjf7jaxkz53TFOkroY8X3CaSvv0JXMI24a1 KjMLCXYkB+6ynjpJ+osvi4jSAWnu540xiJ4493w+kG1vPxX3MqoLOFRq3Ac7uouUiifW D7EJsYsWkpa/t6hTxvhlXiTLaVxOCeCjw+ebdNqmKmogzzfGVXKCJ4yiKx9XKpXSlInc ss2Z9fXfbL1aAEqCvxQ9vgoDNWz7G8ZvOrMFY2ims7az2J7d1yDK7ltcoaG4S2qYKjRO gy4w== X-Gm-Message-State: AOJu0YwWbjyveZo9l//4K73R3/fAukEkBR5y7TnOgNrvl/zroQ+pI8c0 wy0mGMIHlJpksbRWRczXTvQ= X-Received: by 2002:a2e:81cf:0:b0:2cc:65dc:b724 with SMTP id s15-20020a2e81cf000000b002cc65dcb724mr435931ljg.189.1703266732599; Fri, 22 Dec 2023 09:38:52 -0800 (PST) Received: from ?IPV6:2a01:c22:76fe:e700:90c7:5d23:5f70:b2c6? (dynamic-2a01-0c22-76fe-e700-90c7-5d23-5f70-b2c6.c22.pool.telefonica.de. [2a01:c22:76fe:e700:90c7:5d23:5f70:b2c6]) by smtp.googlemail.com with ESMTPSA id da21-20020a056402177500b00554768e8773sm296161edb.97.2023.12.22.09.38.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Dec 2023 09:38:52 -0800 (PST) Message-ID: Date: Fri, 22 Dec 2023 18:38:51 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v3] r8169: Fix PCI error on system resume Content-Language: en-US To: Kai-Heng Feng , nic_swsd@realtek.com Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231222043410.464730-1-kai.heng.feng@canonical.com> From: Heiner Kallweit Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8Gm89g92/YkHji4jIWlp2fwzCcx5+lZCQ1XdqAiHQARAQABzSZIZWluZXIgS2Fs bHdlaXQgPGh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+FX1Azea3Ce7oOnRUEZtWSsUidtIjmL8YUQFZYm+JUIgfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <20231222043410.464730-1-kai.heng.feng@canonical.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22.12.2023 05:34, Kai-Heng Feng wrote: > 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) Reviewed-by: Heiner Kallweit