From patchwork Fri Jun 15 05:32:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 10465715 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8A9C260384 for ; Fri, 15 Jun 2018 05:33:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B6B828418 for ; Fri, 15 Jun 2018 05:33:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DC5528CD4; Fri, 15 Jun 2018 05:33:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20E9E28418 for ; Fri, 15 Jun 2018 05:33:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755651AbeFOFcb (ORCPT ); Fri, 15 Jun 2018 01:32:31 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40215 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755629AbeFOFc3 (ORCPT ); Fri, 15 Jun 2018 01:32:29 -0400 Received: from 2.general.khfeng.us.vpn ([10.172.68.175] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fThLT-0002wG-4Q; Fri, 15 Jun 2018 05:32:23 +0000 From: Kai-Heng Feng To: davem@davemloft.net Cc: ryankao@realtek.com, hayeswang@realtek.com, hau@realtek.com, hkallweit1@gmail.com, romieu@fr.zoreil.com, bhelgaas@google.com, acelan.kao@canonical.com, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: [PATCH net-next v3 1/2] r8169: Don't disable ASPM in the driver Date: Fri, 15 Jun 2018 13:32:18 +0800 Message-Id: <20180615053219.14053-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enable or disable ASPM should be done in PCI core instead of in the device driver. Commit ba04c7c93bbc ("r8169: disable ASPM") uses pci_disable_link_state() to disable ASPM, but it's not the best way to do it. If the device really wants to disable ASPM, we can use a quirk in PCI core to prevent the PCI core from setting ASPM before probe. Let's remove pci_disable_link_state() for now. Use PCI core quirks if any regression happens. Signed-off-by: Kai-Heng Feng --- v3: - Change commit message wording. - Rename the function to rtl_hw_aspm_clkreq_enable(). v2: - Remove module parameter. - Remove pci_disable_link_state(). drivers/net/ethernet/realtek/r8169.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 75dfac0248f4..9b55ce513a36 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -7647,10 +7646,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) mii->reg_num_mask = 0x1f; mii->supports_gmii = cfg->has_gmii; - /* 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 | - PCIE_LINK_STATE_CLKPM); /* enable device (incl. PCI PM wakeup and hotplug setup) */ rc = pcim_enable_device(pdev);