Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6621403ybi; Mon, 8 Jul 2019 06:04:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxt21QgevphP6ekQBjSlGGyHTt+1jxjNogr8NJ1mV63taxI+aIVPhpPDpGKGqA53TSnHNYD X-Received: by 2002:a17:90a:2041:: with SMTP id n59mr24609520pjc.6.1562591065354; Mon, 08 Jul 2019 06:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562591065; cv=none; d=google.com; s=arc-20160816; b=R45WGa7I2JHnTBR4j+Cylw1W2A4mzwwEell1nWPhfzTpveocS6D9nikCTuqsd75i0y MLQlhOe4XEC2jvvLMegpTv+ebvzh3ghfUJYiwRJbz+3xaQ3BpUVRLUoU1naeEuLsHx1k DKSpLPBPU4ikn7zYNq3u3Qh3ef1JhDDw4FQxs4lMa8H/93rzqYbjtyT/J0iUuG/lXfqR aowyO7Hf9SaHbEdFy9Yg9hYITwqxgPQGXtwf1jpisYnCbAnZuk6HSfQagItOn9UHE4JM FF1c01QvVsWb+Wdz8I1zZDBlo03+X7UEPMVaWgrGp0nOX+pXefWFdUps6Mo0oB+L30ie +1Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:dkim-signature; bh=xBnTc52DNh0B6xUFwny0830lUIEUiPz7+JY1AzE6U20=; b=hh7W/cE7L2gyJJOwckNwnpC8zAlemlumNraXMKt6ORGc29ycNmdYOpV038cfAYD2aZ ms6wkcpmtrmdyTHqzyPCpI5N3Nhw/R+nWKxMsiOMM1ULGYy3HqmoBCL5+DqZs1Zw5NfJ Zj/VxRlmCdKiberQ6315Ie4nvMDig13tSodt0oxEcyKXzTAY4uzCMg0LeSlPbs/kcg0g hohm5eg7HAwXKIAK0n/Ml5kbCMRvE+biDKjoYg+cJBIk1nYdqIItZItUnO9SqkA7DZBx zaYQgrKUYeZDHoWlCsqQ78pNhHFzqkEWrPqBAUGgIUtQbgWh8RyhGzvwYq15lC2UkSZp c1wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ylBClEPX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11si17497250pjq.108.2019.07.08.06.03.52; Mon, 08 Jul 2019 06:04:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=ylBClEPX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729120AbfGHJJS (ORCPT + 99 others); Mon, 8 Jul 2019 05:09:18 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:56276 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726284AbfGHJJR (ORCPT ); Mon, 8 Jul 2019 05:09:17 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6893uBa041139; Mon, 8 Jul 2019 09:09:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=xBnTc52DNh0B6xUFwny0830lUIEUiPz7+JY1AzE6U20=; b=ylBClEPX8DzAbh+aMS2YEL7+DpfZblzXh3OoCm7PGCkZVFHU0xPKGQCYA1BWX0486QL+ 8VyfSI6aOxLlDaWCcUAVeWaQLUA5ZuAVRb13LfQrdUjyZVG5zNl/pSYZusSv4g6znx8M LYIXaBpO3FjyxLoMORspjaFmkG/QzV7H2WvbawGV6pdu6Ynj0Zn8FKGJ26EUp8pEGAja Gdhmg6fqxXfTCoB40WEBpAjMt5QtMgyi3u7DcErqLjt42kxDTVyyWr+R73/LrXgLSXxv 2WmQnsLJ7ueCXBAGhaVl89UCKElUEpSgAgMS2GIu13P/LTTe8mffseF4meXK3AScF+TS 5A== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2tjkkpd7sj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2019 09:09:01 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x6898FMm070344; Mon, 8 Jul 2019 09:09:01 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2tjgrtddd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jul 2019 09:09:01 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x6898w01003582; Mon, 8 Jul 2019 09:08:59 GMT Received: from [10.182.69.170] (/10.182.69.170) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Jul 2019 02:08:58 -0700 Subject: Re: [PATCH] r8169: add enable_aspm parameter To: AceLan Kao , Realtek linux nic maintainers , Heiner Kallweit , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190708063751.16234-1-acelan.kao@canonical.com> From: Yanjun Zhu Organization: Oracle Corporation Message-ID: Date: Mon, 8 Jul 2019 17:10:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190708063751.16234-1-acelan.kao@canonical.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9311 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907080120 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9311 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907080119 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/7/8 14:37, AceLan Kao wrote: > We have many commits in the driver which enable and then disable ASPM > function over and over again. > commit b75bb8a5b755 ("r8169: disable ASPM again") > commit 0866cd15029b ("r8169: enable ASPM on RTL8106E") > commit 94235460f9ea ("r8169: Align ASPM/CLKREQ setting function with vendor driver") > commit aa1e7d2c31ef ("r8169: enable ASPM on RTL8168E-VL") > commit f37658da21aa ("r8169: align ASPM entry latency setting with vendor driver") > commit a99790bf5c7f ("r8169: Reinstate ASPM Support") > commit 671646c151d4 ("r8169: Don't disable ASPM in the driver") > commit 4521e1a94279 ("Revert "r8169: enable internal ASPM and clock request settings".") > commit d64ec841517a ("r8169: enable internal ASPM and clock request settings") > > This function is very important for production, and if we can't come out > a solution to make both happy, I'd suggest we add a parameter in the > driver to toggle it. Perhaps sysctl is better? > > Signed-off-by: AceLan Kao > --- > drivers/net/ethernet/realtek/r8169.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c > index d06a61f00e78..f557cb36e2c6 100644 > --- a/drivers/net/ethernet/realtek/r8169.c > +++ b/drivers/net/ethernet/realtek/r8169.c > @@ -702,10 +702,13 @@ struct rtl8169_private { > > typedef void (*rtl_generic_fct)(struct rtl8169_private *tp); > > +static int enable_aspm; > MODULE_AUTHOR("Realtek and the Linux r8169 crew "); > MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); > module_param_named(debug, debug.msg_enable, int, 0); > MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)"); > +module_param(enable_aspm, int, 0); > +MODULE_PARM_DESC(enable_aspm, "Enable ASPM support (0 = disable, 1 = enable"); > MODULE_SOFTDEP("pre: realtek"); > MODULE_LICENSE("GPL"); > MODULE_FIRMWARE(FIRMWARE_8168D_1); > @@ -7163,10 +7166,12 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) > if (rc) > return rc; > > - /* Disable ASPM completely as that cause random device stop working > - * problems as well as full system hangs for some PCIe devices users. > - */ > - pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); > + if (!enable_aspm) { > + /* Disable ASPM completely as that cause random device stop working > + * problems as well as full system hangs for some PCIe devices users. > + */ > + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); > + } > > /* enable device (incl. PCI PM wakeup and hotplug setup) */ > rc = pcim_enable_device(pdev);