From patchwork Mon Jul 18 02:43:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1657279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SSh5UgCB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LmR9d3r7dz9sGH for ; Mon, 18 Jul 2022 12:43:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oDGjR-0003rK-I1; Mon, 18 Jul 2022 02:43:37 +0000 Received: from mail-pj1-f53.google.com ([209.85.216.53]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oDGjM-0003qP-8p for kernel-team@lists.ubuntu.com; Mon, 18 Jul 2022 02:43:32 +0000 Received: by mail-pj1-f53.google.com with SMTP id q5-20020a17090a304500b001efcc885cc4so11294790pjl.4 for ; Sun, 17 Jul 2022 19:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CtP0xRCzRz8W8i8/zIcx6RJEWR8ZyvaAE91eni9/K0s=; b=SSh5UgCBO0fpGnAIokqTG5MZ0KpL9LUBrD73QzMFDAUrX+xxMCwAhqq0y/VKd9Dm+j 8W6+vNcBE2RWRbu44nZAKM1ICbB7e1dAe6gX9XzVLVJrsDpGiaQPhlkLt5TcfzWR2gB8 Ebs8RdmdonCcpPjuUyo9p9/Bsludv5go/QUijteP+Sz1ErgPFtPdodQpfX+Vo9J4jVxj 6fC0docWpLbNakB4tuYQP9cLmRPH2xzcQLopVvBcqHR5/Xu+B1lhNjprb8CTeXqmCyWc YAD0HE8lX1czoxupK9eG2ZP2EVnYH5zgIPXWLJEqPhEITxLmLsSEi4u/AMfGgXiWSm0e Pe6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CtP0xRCzRz8W8i8/zIcx6RJEWR8ZyvaAE91eni9/K0s=; b=bHBGtAnqcisS2ASIEKuZlY5yYmNdfBGCUWAMMaj5BJxUaZeM9puLbkSG4RYTANUXd8 MH4JqAy4UXuhoPz0hpYuyTUxJEN2JLoKKIbyy1DmYNJjVpnI78hyWHrXkvolKkNUrPQd RbTSkMO66rZq3+vMbGS47vfUnVRw6/LOPFgCEVqkpIkt7VYhbXlkdUcy/pM3jAbncf0F PKFfEqHRxacCbQL1ax2JXQrA2aF4rsG2+t04jqsXur2pZRlhsgQTfGa/w2Ygy2A+39K/ 2wAKbfVaaDmdI0AEY0Vb1THO5ZlcAqmrjaslZyvDnne6nL/gIymA3yGJtr6dtoq6t0Qm lAKg== X-Gm-Message-State: AJIora9Y0g0NshxVV9Q40s7+69P6FfLH1VEHrLnFmq2PuTRIyqp7BAmi vtfvDoA42C0Qro8b7AcVcXrLv1uxv9HybA== X-Google-Smtp-Source: AGRyM1uhdsPwoNAHtUZjFZrOnBGY3tMjctKpH1EaAJpHwuzGVF/fbTs73XWi6FZeBgAJrWOIBcKC6w== X-Received: by 2002:a17:902:c7d5:b0:16b:ea78:4eb4 with SMTP id r21-20020a170902c7d500b0016bea784eb4mr25509321pla.65.1658112210369; Sun, 17 Jul 2022 19:43:30 -0700 (PDT) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id e9-20020a170902784900b0016b8b35d725sm7937058pln.95.2022.07.17.19.43.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 19:43:30 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2][SRU][J][OEM-5.14][OEM-5.17] net: atlantic: remove deep parameter on suspend/resume functions Date: Mon, 18 Jul 2022 10:43:23 +0800 Message-Id: <20220718024324.1932501-2-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220718024324.1932501-1-acelan.kao@canonical.com> References: <20220718024324.1932501-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.53; envelope-from=acelan@gmail.com; helo=mail-pj1-f53.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Chia-Lin Kao (AceLan)" BugLink: https://bugs.launchpad.net/bugs/1981950 Below commit claims that atlantic NIC requires to reset the device on pm op, and had set the deep to true for all suspend/resume functions. commit 1809c30b6e5a ("net: atlantic: always deep reset on pm op, fixing up my null deref regression") So, we could remove deep parameter on suspend/resume functions without any functional change. Fixes: 1809c30b6e5a ("net: atlantic: always deep reset on pm op, fixing up my null deref regression") Signed-off-by: Chia-Lin Kao (AceLan) Link: https://lore.kernel.org/r/20220713111224.1535938-1-acelan.kao@canonical.com Signed-off-by: Paolo Abeni (cherry picked from commit 0f33250760384e05c36466b0a2f92f3c6007ba92) Signed-off-by: Chia-Lin Kao (AceLan) --- .../ethernet/aquantia/atlantic/aq_pci_func.c | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c index fc5ea434a27c9..8c05b2b793392 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c @@ -385,7 +385,7 @@ static void aq_pci_shutdown(struct pci_dev *pdev) } } -static int aq_suspend_common(struct device *dev, bool deep) +static int aq_suspend_common(struct device *dev) { struct aq_nic_s *nic = pci_get_drvdata(to_pci_dev(dev)); @@ -398,17 +398,15 @@ static int aq_suspend_common(struct device *dev, bool deep) if (netif_running(nic->ndev)) aq_nic_stop(nic); - if (deep) { - aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol); - aq_nic_set_power(nic); - } + aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol); + aq_nic_set_power(nic); rtnl_unlock(); return 0; } -static int atl_resume_common(struct device *dev, bool deep) +static int atl_resume_common(struct device *dev) { struct pci_dev *pdev = to_pci_dev(dev); struct aq_nic_s *nic; @@ -421,10 +419,8 @@ static int atl_resume_common(struct device *dev, bool deep) pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - if (deep) { - /* Reinitialize Nic/Vecs objects */ - aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol); - } + /* Reinitialize Nic/Vecs objects */ + aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol); if (netif_running(nic->ndev)) { ret = aq_nic_init(nic); @@ -450,22 +446,22 @@ static int atl_resume_common(struct device *dev, bool deep) static int aq_pm_freeze(struct device *dev) { - return aq_suspend_common(dev, true); + return aq_suspend_common(dev); } static int aq_pm_suspend_poweroff(struct device *dev) { - return aq_suspend_common(dev, true); + return aq_suspend_common(dev); } static int aq_pm_thaw(struct device *dev) { - return atl_resume_common(dev, true); + return atl_resume_common(dev); } static int aq_pm_resume_restore(struct device *dev) { - return atl_resume_common(dev, true); + return atl_resume_common(dev); } static const struct dev_pm_ops aq_pm_ops = { From patchwork Mon Jul 18 02:43:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1657277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SLIYuowt; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LmR9d3bwTz9sGD for ; Mon, 18 Jul 2022 12:43:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oDGjU-0003sS-1h; Mon, 18 Jul 2022 02:43:40 +0000 Received: from mail-pg1-f181.google.com ([209.85.215.181]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oDGjP-0003qj-Ew for kernel-team@lists.ubuntu.com; Mon, 18 Jul 2022 02:43:35 +0000 Received: by mail-pg1-f181.google.com with SMTP id 23so9403728pgc.8 for ; Sun, 17 Jul 2022 19:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eQXXu/vR9ozhhHRsCuJzJQhFKeHQtZ1tPTi539HF2K0=; b=SLIYuowtztxA3RrRt3N2lsGkwe03weA6wLwTosjr6RNjG/TjB1hhMUfQiq+M+iRXJ1 bJgU12O5XCyywltyHd7uGGsrMuTAuRCC4FAUh9B28sYaZLjbhnr/UQefXA9G2WVgrA3s 8QAvA0m9i7y8U4jqBu9z9mHaYuZYyZdyT4K5QWuJ/NwejVmwVEqjSJ+KitZHfLCY87LJ g1Mwi+QwF+ap1jJXUWW5F9eSprU3HImkn3yeBDZ6j6tvm4zxNbsEmcjmdwfMiMoXG4XU 64gMigjj45ErMNrUSB/6pRcfJOhktMs8imWcWffovQ90rjqngfW/z5eJwbN4cDfE6NH7 rnvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=eQXXu/vR9ozhhHRsCuJzJQhFKeHQtZ1tPTi539HF2K0=; b=gHtaoytUIP5rOIrFonvdupS0/lAstnhuMI+Jvl20STrUHJwWXQIskq0/W5+kR/hDAb C3QQV4MUkTEKKita5GVsXbu16IyMkgZ1k2yCscIVLamtqiYUWvC7DqLYryqvfdsxKK8z jntvJo9qhkZN/WWYmLTHY5Q0OMHtUnqqGDOP8WfQEQj+XqYlWgZh11bordH7PhGpZOdj VAr3iEk9r64dEAjsiSRuZ5sUMHA0btty0v68JpSEsYg6Vho31Jn3MwpUZY1n+eNxZOdJ WTpSAWWc/UStjy2nuPu888J7Hj/FKavss1HG17l3hXwGHenLnga52Ti77JnGy1mhtNJ4 aQcg== X-Gm-Message-State: AJIora+KBP4fTP5nrTWFs/ruipUsEQf3DxXlSd+o5FB14PUx74trKoKd Ty/fszxFAEekRD4fv13foZZnKUFhrGqssg== X-Google-Smtp-Source: AGRyM1t7UKt65kTvy/AKljKhgrGxy/qZxehn7dZHufcb6z9y285VSkV8E6VWn5wTNJ1y1acPpjA9LA== X-Received: by 2002:a63:84c8:0:b0:415:b761:efa1 with SMTP id k191-20020a6384c8000000b00415b761efa1mr22348458pgd.89.1658112213415; Sun, 17 Jul 2022 19:43:33 -0700 (PDT) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id w12-20020a170902e88c00b0016c4cbefea3sm8040912plg.218.2022.07.17.19.43.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Jul 2022 19:43:32 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2][SRU][J][OEM-5.14][OEM-5.17] net: atlantic: remove aq_nic_deinit() when resume Date: Mon, 18 Jul 2022 10:43:24 +0800 Message-Id: <20220718024324.1932501-3-acelan.kao@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220718024324.1932501-1-acelan.kao@canonical.com> References: <20220718024324.1932501-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.181; envelope-from=acelan@gmail.com; helo=mail-pg1-f181.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Chia-Lin Kao (AceLan)" BugLink: https://bugs.launchpad.net/bugs/1981950 aq_nic_deinit() has been called while suspending, so we don't have to call it again on resume. Actually, call it again leads to another hang issue when resuming from S3. Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992345] Call Trace: Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992346] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992348] aq_nic_deinit+0xb4/0xd0 [atlantic] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992356] aq_pm_thaw+0x7f/0x100 [atlantic] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992362] pci_pm_resume+0x5c/0x90 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992366] ? pci_pm_thaw+0x80/0x80 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992368] dpm_run_callback+0x4e/0x120 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992371] device_resume+0xad/0x200 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992373] async_resume+0x1e/0x40 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992374] async_run_entry_fn+0x33/0x120 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992377] process_one_work+0x220/0x3c0 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992380] worker_thread+0x4d/0x3f0 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992382] ? process_one_work+0x3c0/0x3c0 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992384] kthread+0x12a/0x150 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992386] ? set_kthread_struct+0x40/0x40 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992387] ret_from_fork+0x22/0x30 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992391] Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992392] ---[ end trace 1ec8c79604ed5e0d ]--- Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992394] PM: dpm_run_callback(): pci_pm_resume+0x0/0x90 returns -110 Jul 8 03:09:44 u-Precision-7865-Tower kernel: [ 5910.992397] atlantic 0000:02:00.0: PM: failed to resume async: error -110 Fixes: 1809c30b6e5a ("net: atlantic: always deep reset on pm op, fixing up my null deref regression") Signed-off-by: Chia-Lin Kao (AceLan) Link: https://lore.kernel.org/r/20220713111224.1535938-2-acelan.kao@canonical.com Signed-off-by: Paolo Abeni (cherry picked from commit 2e15c51fefaffaf9f72255eaef4fada05055e4c5) Signed-off-by: Chia-Lin Kao (AceLan) --- drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c index 8c05b2b793392..a0ce213c473bc 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c @@ -419,9 +419,6 @@ static int atl_resume_common(struct device *dev) pci_set_power_state(pdev, PCI_D0); pci_restore_state(pdev); - /* Reinitialize Nic/Vecs objects */ - aq_nic_deinit(nic, !nic->aq_hw->aq_nic_cfg->wol); - if (netif_running(nic->ndev)) { ret = aq_nic_init(nic); if (ret)