From patchwork Mon Aug 21 03:37:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 1823478 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=LDfzopYB; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RTdVJ5pjSz1yZs for ; Mon, 21 Aug 2023 13:38:16 +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 1qXvk4-0005wJ-H8; Mon, 21 Aug 2023 03:38:12 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qXvk1-0005v4-15 for kernel-team@lists.ubuntu.com; Mon, 21 Aug 2023 03:38:09 +0000 Received: from localhost.localdomain (unknown [10.101.196.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 2870F4149E for ; Mon, 21 Aug 2023 03:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1692589088; bh=pIw0GQdcjkm+Xk/+750mMMVEe+Yd4qrEzYUilUjVUtA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LDfzopYB96n8ERP/dPXRvTriOfe2vSaUmdE48kKB83kckXMqg6mZylL9MQNOFwzQn UbtWPT7LUInWQyl5HKs0XbLXVe2rF8jvqsRZ7dz+RkElf/rs2lmL1tVFrHmQ72Q0bU H2Pn/C9/7loukm8F6YIk/Gqjg90PTPXLWQujL2pVkkYLTC+ysmnIm69Rk/IkDHRyNr xaqviBv5j6s3ES440nTCCUDw5JYisf1AJ0H3bqO/Pe4O3e9Mq+XbhH+4VgPrK3Luel 1N93l9ypbu5+W6mvtK5/atrXvL20f5zXrtPIMVXw2t3NQbmit1BBsZPZfl8UR9UZnU 6lOfSooovfbeA== From: Kai-Heng Feng To: kernel-team@lists.ubuntu.com Subject: [J/L/M] [PATCH 1/1] e1000e: Use PME poll to circumvent unreliable ACPI wake Date: Mon, 21 Aug 2023 11:37:23 +0800 Message-Id: <20230821033723.285163-2-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821033723.285163-1-kai.heng.feng@canonical.com> References: <20230821033723.285163-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 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" BugLink: https://bugs.launchpad.net/bugs/2028122 On some I219 devices, ethernet cable plugging detection only works once from PCI D3 state. Subsequent cable plugging does set PME bit correctly, but device still doesn't get woken up. Since I219 connects to the root complex directly, it relies on platform firmware (ACPI) to wake it up. In this case, the GPE from _PRW only works for first cable plugging but fails to notify the driver for subsequent plugging events. The issue was originally found on CNP, but the same issue can be found on ADL too. So workaround the issue by continuing use PME poll after first ACPI wake. As PME poll is always used, the runtime suspend restriction for CNP can also be removed. Signed-off-by: Kai-Heng Feng Tested-by: Naama Meir Acked-by: Sasha Neftin Reviewed-by: Simon Horman Reviewed-by: Leon Romanovsky Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller (cherry picked from commit d147085183ea1b0efd2c18fca76e4dee873b1e4e linux-next) Signed-off-by: Kai-Heng Feng --- drivers/net/ethernet/intel/e1000e/netdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index bd7ef59b1f2e..f0e48f2bc3a2 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -7021,6 +7021,8 @@ static __maybe_unused int e1000e_pm_runtime_resume(struct device *dev) struct e1000_adapter *adapter = netdev_priv(netdev); int rc; + pdev->pme_poll = true; + rc = __e1000_resume(pdev); if (rc) return rc; @@ -7682,7 +7684,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_pm_set_driver_flags(&pdev->dev, DPM_FLAG_SMART_PREPARE); - if (pci_dev_run_wake(pdev) && hw->mac.type != e1000_pch_cnp) + if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev); return 0;