From patchwork Sun Jan 10 19:48:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 360873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35119C433DB for ; Sun, 10 Jan 2021 19:52:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 006AF22A84 for ; Sun, 10 Jan 2021 19:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726742AbhAJTvu (ORCPT ); Sun, 10 Jan 2021 14:51:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbhAJTvt (ORCPT ); Sun, 10 Jan 2021 14:51:49 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CC8CC061786 for ; Sun, 10 Jan 2021 11:51:09 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id t16so14318149wra.3 for ; Sun, 10 Jan 2021 11:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=r8VJQNB2damptOcW1CZIDYyXVOcv08MPY/PIrsZ61r4=; b=Y1rQH5cknTqsm6seBvTG6fFZtRUqWi+PDZJ15E72xY4ipza7qxbhTgHTcpto8IZ92o KyzA4rMhpFXJ/e7Er/ddtFdc/ukcaEYBP9zRE+TMxVynp0hdjv9w3MmnqLoKDB+i7hNg VlyyxcLXrQC75SeCd1NefFY1WUqikXiL0fH612Iy7Gx9dKgz1Q6zByfl32yhecag1EuG llVbNfX5REQdHnqH47cmkUr8TQADtZcQV6yp/BVePCq861dCRBjEOfp1eLK6VRUaEMdR 21aLffaHl4rAHOkJsCwX9LMiSI8tobzWa7/Tcbd6fzdVTDMWbvKRSQvkLZduaSde17L+ 5pCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=r8VJQNB2damptOcW1CZIDYyXVOcv08MPY/PIrsZ61r4=; b=c2ltQOc9chb8qima4SP1zMUaZEHHGVi7/KgvD3O7YQEagZV9XuPbhCMnWrhAR0Ch8A IBt8hRcKfmN72RGNva+eYr9iInbdMVujxyT+z/b3VrqW21PR6RDmC3KEJ6eklNla/qpi Co08iv5xrFZp6N+y2/kD/FeycnzXPGVfLC8wRcs2eE7XCYZKFM/w4FXFG5tJ9YZYpBRD eqf63ZwiQ1ETLj2qd9O0WN3ow9V38Ba6tozGJZAgcLlTH1HbIY2xX6nJJgCPs1kgGILd cOGzp6YSfZQN+PBdY3kHHWvbzochZG6F4kibbtyjlmhgu2vDSOZFbCq5uVsU5v1nBsbt al2w== X-Gm-Message-State: AOAM531AHM6F9C2a6EcVVT85f0oBUzglQjI4AOp+YnBfLRxVLeFNl6rh scHDblRbZs58W7Cew+SRAqM80qZOGYQ= X-Google-Smtp-Source: ABdhPJyPckT/sa5akgZf8U6kmYNfH/PTWMJmoug/5iQOoaszhryFwp+Lyo+LX500KZ2PW0xJD92jjA== X-Received: by 2002:adf:8503:: with SMTP id 3mr13380873wrh.56.1610308267717; Sun, 10 Jan 2021 11:51:07 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:5449:e139:28a3:e114? (p200300ea8f0655005449e13928a3e114.dip0.t-ipconnect.de. [2003:ea:8f06:5500:5449:e139:28a3:e114]) by smtp.googlemail.com with ESMTPSA id o8sm21690646wrm.17.2021.01.10.11.51.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jan 2021 11:51:07 -0800 (PST) Subject: [PATCH net-next 1/3] r8169: enable PLL power-down for chip versions 34, 35, 36, 42 From: Heiner Kallweit To: Jakub Kicinski , David Miller , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: <1608dfa3-c4a5-0e92-31f7-76674b3c173a@gmail.com> Message-ID: Date: Sun, 10 Jan 2021 20:48:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1608dfa3-c4a5-0e92-31f7-76674b3c173a@gmail.com> Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There's no known reason why PLL powerdown on D3 shouldn't be enabled on chip versions 34, 35, 36, and 42. At least the vendor driver doesn't exclude any of these chip versions. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index dbf0c2909..9c87fb9f1 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2226,10 +2226,8 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) switch (tp->mac_version) { case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: - case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33: - case RTL_GIGA_MAC_VER_37: - case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_41: - case RTL_GIGA_MAC_VER_43 ... RTL_GIGA_MAC_VER_63: + case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: + case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_63: RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~0x80); break; default: @@ -2241,13 +2239,12 @@ static void rtl_pll_power_up(struct rtl8169_private *tp) { switch (tp->mac_version) { case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: - case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33: - case RTL_GIGA_MAC_VER_37: + case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: case RTL_GIGA_MAC_VER_39: case RTL_GIGA_MAC_VER_43: RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) | 0x80); break; - case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_41: + case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_42: case RTL_GIGA_MAC_VER_44 ... RTL_GIGA_MAC_VER_63: RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) | 0xc0); break; From patchwork Sun Jan 10 19:50:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 360342 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AAD4C433E6 for ; Sun, 10 Jan 2021 19:52:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16C0D22A85 for ; Sun, 10 Jan 2021 19:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726938AbhAJTvw (ORCPT ); Sun, 10 Jan 2021 14:51:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbhAJTvv (ORCPT ); Sun, 10 Jan 2021 14:51:51 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D05AC061794 for ; Sun, 10 Jan 2021 11:51:10 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id m5so14279100wrx.9 for ; Sun, 10 Jan 2021 11:51:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dmg6OWJn2j9OEnjloodqETRWHNBteqRgpFZfdHMZr9w=; b=ZWF7pJo30vMu56FJ2DzFR5fC9Zc4DTyrdpKBfvDYR/NFwEPSeg72UUJkyK7XAGM0VD TQKAU2G/8ZEaDQgH8MZdb5qFmBEn33IsTzmn3Pb+zN7zaKwhXa+xvDWtcSW8cc4LnBbk 2mW5cF+YWMjsGAhp4ZN5hx4J64EKNA7P2jQxc162MfXkDYoVU5NwrG58A1YUp3MHtYFD AXeZWGYA5h6hbTY3jKtS0KjrJjVkdEzhXBheXNNjQvFZi+npUOdDiuIHGS4Nl+5LftDW 4ucMT3+QHWyVbY3ScsHiYiW7d9qTamXotLTlOsbFQn9RXgtZX26S5xDt6MMqBUx1GVRr A+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dmg6OWJn2j9OEnjloodqETRWHNBteqRgpFZfdHMZr9w=; b=TKoL9ERwlKBtlKd1D1vwzd9LEma5VXeDorLsWRatmpZSLiWCztr5eWh4VWA0fNOZEn Hx0OAdBA32MwFoQ8RqRBbE5D4IBULnV+qKY5ePayeEA2ykVH9gzmM2oWGiRHzyw/2/nc N2VJcrWcoGeEUAXbYfkVykBgrTZxkEPdNWUMCsJjU0lJ3q/xRkMbCezDB/A3aMARytcx pFpcF98jJi4Soo2NF/l+2TVH+bXUWGEuZzgG0m8aYeehpDWP/dmqCe77gHmBxoK/MzzV vksXZWhnfO/tIaB4t7ZwJH89Jzth8R7ApgDGfz39YE9Nmtq102vVngD6BC74ch+FEBjG ndpw== X-Gm-Message-State: AOAM531XzH0470e3UDR3IVeKh0jpZ28LLwQlDhgzNt6ER1mlAVmSNEb/ 4/H2qNfoHIYBnxke9tHEAd4OU0j3zVI= X-Google-Smtp-Source: ABdhPJyWx80oGUJrtvcGljkEhEj99kLNmsYeh8VhNbpYEl3TBCzmcdqyX3cssofh9NmHDUkDXMpaYw== X-Received: by 2002:a5d:53c9:: with SMTP id a9mr12781592wrw.188.1610308268922; Sun, 10 Jan 2021 11:51:08 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:5449:e139:28a3:e114? (p200300ea8f0655005449e13928a3e114.dip0.t-ipconnect.de. [2003:ea:8f06:5500:5449:e139:28a3:e114]) by smtp.googlemail.com with ESMTPSA id f14sm21765682wre.69.2021.01.10.11.51.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jan 2021 11:51:08 -0800 (PST) Subject: [PATCH net-next 2/3] r8169: improve handling D3 PLL power-down From: Heiner Kallweit To: Jakub Kicinski , David Miller , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: <1608dfa3-c4a5-0e92-31f7-76674b3c173a@gmail.com> Message-ID: Date: Sun, 10 Jan 2021 20:50:08 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1608dfa3-c4a5-0e92-31f7-76674b3c173a@gmail.com> Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Realtek provided a description of bits 6 and 7 in register PMCH. They configure whether the chip powers down certain PLL in D3hot and D3cold respectively. They do not actually power down the PLL. Reflect this in the code and configure D3 PLL powerdown based on whether WOL is enabled. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 51 ++++++++++------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 9c87fb9f1..64fdc168f 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -261,6 +261,9 @@ enum rtl8168_8101_registers { #define CSIAR_BYTE_ENABLE 0x0000f000 #define CSIAR_ADDR_MASK 0x00000fff PMCH = 0x6f, +#define D3COLD_NO_PLL_DOWN BIT(7) +#define D3HOT_NO_PLL_DOWN BIT(6) +#define D3_NO_PLL_DOWN (BIT(7) | BIT(6)) EPHYAR = 0x80, #define EPHYAR_FLAG 0x80000000 #define EPHYAR_WRITE_CMD 0x80000000 @@ -1250,6 +1253,22 @@ static bool r8168_check_dash(struct rtl8169_private *tp) } } +static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable) +{ + switch (tp->mac_version) { + case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: + case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: + case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_63: + if (enable) + RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~D3_NO_PLL_DOWN); + else + RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) | D3_NO_PLL_DOWN); + break; + default: + break; + } +} + static void rtl_reset_packet_filter(struct rtl8169_private *tp) { rtl_eri_clear_bits(tp, 0xdc, BIT(0)); @@ -1416,6 +1435,7 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts) rtl_lock_config_regs(tp); device_set_wakeup_enable(tp_to_dev(tp), wolopts); + rtl_set_d3_pll_down(tp, !wolopts); tp->dev->wol_enabled = wolopts ? 1 : 0; } @@ -2221,37 +2241,11 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) if (device_may_wakeup(tp_to_dev(tp))) { phy_speed_down(tp->phydev, false); rtl_wol_suspend_quirk(tp); - return; - } - - switch (tp->mac_version) { - case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: - case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: - case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_63: - RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~0x80); - break; - default: - break; } } static void rtl_pll_power_up(struct rtl8169_private *tp) { - switch (tp->mac_version) { - case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: - case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_37: - case RTL_GIGA_MAC_VER_39: - case RTL_GIGA_MAC_VER_43: - RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) | 0x80); - break; - case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_42: - case RTL_GIGA_MAC_VER_44 ... RTL_GIGA_MAC_VER_63: - RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) | 0xc0); - break; - default: - break; - } - phy_resume(tp->phydev); } @@ -5330,6 +5324,8 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) /* configure chip for default features */ rtl8169_set_features(dev, dev->features); + rtl_set_d3_pll_down(tp, true); + jumbo_max = rtl_jumbo_max(tp); if (jumbo_max) dev->max_mtu = jumbo_max; @@ -5350,9 +5346,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (rc) return rc; - /* chip gets powered up in rtl_open() */ - rtl_pll_power_down(tp); - rc = register_netdev(dev); if (rc) return rc; From patchwork Sun Jan 10 19:50:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 360872 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A104C433E0 for ; Sun, 10 Jan 2021 19:52:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C9B822AAC for ; Sun, 10 Jan 2021 19:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726959AbhAJTv4 (ORCPT ); Sun, 10 Jan 2021 14:51:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbhAJTvw (ORCPT ); Sun, 10 Jan 2021 14:51:52 -0500 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7016C06179F for ; Sun, 10 Jan 2021 11:51:11 -0800 (PST) Received: by mail-wr1-x42c.google.com with SMTP id q18so14326253wrn.1 for ; Sun, 10 Jan 2021 11:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tRGptG015vaeyBcd/HPDPV0KrZI/mabDIvjI1IPzRPA=; b=qG8CBSrHrkBDPPF7vL4Z1NKk5u/DNqqBKRw4sdMDxuHmqztbv7zVzfwx4ZMXJFt48H i8qHFwYYJAf03P0fHslSRFaIA9o1S6dNAbY99iRYXewOl2cDacijd/zWubHqa91vE2RH SKyciiiw4UzLmsrSxRNvytHsNEJRGQw/kkAc4gDrwdC6m1CURyejVbz7twmrhiN9mwQ+ WNYyrLzYuiRPPPI0/eZG2TWkvfc2uP4VDOUqKTDexLYnnWw0V0PIHaQAepesi+KCL5iA sRimdlWPH52nMsHum77eLeUphBb86KeNqSk2/sMq2JaPbmN2upMkvTzsc9/VdR8PAZDL gEQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tRGptG015vaeyBcd/HPDPV0KrZI/mabDIvjI1IPzRPA=; b=edpjrmrQHV5HKIAWyxSNvDjfbPNqQEzD3lUAjhrqdtpbXZSc5SLm3FtGzz0R40ejHr YNO1FxN8v1k9Vyz2XE3rAS/jZqt0GArp7nOTI45Hoz27gBaZmLGLl5xefKb8gvE3PyBP wcvgYBVuWaVJ4YyaItG5Ri00IYLx5UotR1/i5wlDqRPeSEEmRUIXQM4MXU8Q4e4fuDaF xYj3sEMH91klbiWH4WxS8ib4jSGDZvQihC9jQ1KiPeMxmKhIafqX/xhWYcR/K2mJqmpo S0OPFPF8+5cdFxNCYmlGyzqVJ1YO8ejOglEvwhY8LYgFZ5KI/NZkFl5gZpp8tuaC5W+R 98lQ== X-Gm-Message-State: AOAM530iLfmBKkx0mD/8VfLQwuPfGvTrSvHVgzjhVF+9wshCdT5daDJS HzN0oBA782Gesk3ff9jRtjHdzCTZKus= X-Google-Smtp-Source: ABdhPJxBNWXkKXBxfX3/BLVdxy/U7P5vKL0zAIyYLJgxsHIAez9DTQjPe5vOvZCiU0tyBEKZDQDlIg== X-Received: by 2002:adf:8290:: with SMTP id 16mr12790640wrc.27.1610308270263; Sun, 10 Jan 2021 11:51:10 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:5449:e139:28a3:e114? (p200300ea8f0655005449e13928a3e114.dip0.t-ipconnect.de. [2003:ea:8f06:5500:5449:e139:28a3:e114]) by smtp.googlemail.com with ESMTPSA id o8sm21690758wrm.17.2021.01.10.11.51.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 Jan 2021 11:51:09 -0800 (PST) Subject: [PATCH net-next 3/3] r8169: clean up rtl_pll_power_down/up functions From: Heiner Kallweit To: Jakub Kicinski , David Miller , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" References: <1608dfa3-c4a5-0e92-31f7-76674b3c173a@gmail.com> Message-ID: <45350b9c-f90e-fc1e-0796-6e71c43cecfc@gmail.com> Date: Sun, 10 Jan 2021 20:50:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1608dfa3-c4a5-0e92-31f7-76674b3c173a@gmail.com> Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Clean up the remainings of rtl_pll_power_down/up and rename rtl_pll_power_down() to rtl_prepare_power_down(). Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 64fdc168f..33336098b 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2229,7 +2229,7 @@ static void rtl_wol_suspend_quirk(struct rtl8169_private *tp) } } -static void rtl_pll_power_down(struct rtl8169_private *tp) +static void rtl_prepare_power_down(struct rtl8169_private *tp) { if (r8168_check_dash(tp)) return; @@ -2244,11 +2244,6 @@ static void rtl_pll_power_down(struct rtl8169_private *tp) } } -static void rtl_pll_power_up(struct rtl8169_private *tp) -{ - phy_resume(tp->phydev); -} - static void rtl_init_rxcfg(struct rtl8169_private *tp) { switch (tp->mac_version) { @@ -4604,12 +4599,12 @@ static void rtl8169_down(struct rtl8169_private *tp) rtl8169_cleanup(tp, true); - rtl_pll_power_down(tp); + rtl_prepare_power_down(tp); } static void rtl8169_up(struct rtl8169_private *tp) { - rtl_pll_power_up(tp); + phy_resume(tp->phydev); rtl8169_init_phy(tp); napi_enable(&tp->napi); set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);