Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1047570rwd; Thu, 1 Jun 2023 09:45:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YdWQVisIS5XT8M3+DsqXPy4uEvFcgJSKtKhBISwkAMxkMCagRtAoLSg1S6+I1I8ooMZtg X-Received: by 2002:a05:6a20:7349:b0:111:4a86:f70 with SMTP id v9-20020a056a20734900b001114a860f70mr11664723pzc.6.1685637924383; Thu, 01 Jun 2023 09:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685637924; cv=none; d=google.com; s=arc-20160816; b=ay2e/49ofz9DDAJFfYOdOiRtqSE/9xOQvbA1ZFVHDx3SP3b1hVGIoQRaL4xCe16Kif fkGHLJkofD4rgTVv1MvG3nH9nP1nqzsbHcZlkrhzsZLN7wTN6BerZa+M4Sby1KEjmlIm 6GIQpML0ee+uBGFkpmI6ZF1kWrYTbFO5kpHduzDUZwOti4ieLbKJzlT0vCzPXNkQlAPD ShMIpAzCY8EBcjMm+wb3luVfdkQt4JehCxzo64HSWkDIQQT3K3Xf/t9okfxOSAU7nY6p U9HJbSBtziZjBfF7pI2m49QNkA5oxmZ47Ngb7b4Mvw426K0M4ifyKzbrrGwWY8NPl6gC O+BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=axcyh+az/BBUzfpbsUua0mK6zDrWRXBjvxehcafqRw0=; b=OcRPQyPpR0h+RGHg9oPOFF9sqGArMmKxGYL65CsK36baVT3+bz5YkLmKEgFWdkAQZn OGLuWNql6PPyvN+MrSqaThfWxLyeD25mmYajbdshRsLXwVZeL+I5vdAy3qEsW0WYFqZr euM6uI5evOj/LBgNWeLYXLKADROdnBqYG8RRB0/zWFsXlmXogI4mz66fBw7of6a781PQ gWliQjDQgTEnfDNAxtheZOuL77BYY73GEkuLuFK/N9QOmfaL3F0WzNTA57WOq4aRfuvi nFdmyvWsEKTVXXp6fDhF7ItR05mOJK0h3oNYED36dw6HxL62YqT5e4SXioC9RHAATCoJ SFVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=OFimkuWy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv188-20020a632ec5000000b0051909d663d8si3101851pgb.656.2023.06.01.09.45.07; Thu, 01 Jun 2023 09:45:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=OFimkuWy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231488AbjFAQ0l (ORCPT + 99 others); Thu, 1 Jun 2023 12:26:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbjFAQ0j (ORCPT ); Thu, 1 Jun 2023 12:26:39 -0400 Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E86A5138; Thu, 1 Jun 2023 09:26:37 -0700 (PDT) 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 134EE412AF; Thu, 1 Jun 2023 16:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1685636793; bh=axcyh+az/BBUzfpbsUua0mK6zDrWRXBjvxehcafqRw0=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=OFimkuWyFYRWSftA8jYcAl0tzkUQMW8d9D2Di/kyZMDMGb/0yzUZm6XoA80b9RKjo V2CFYG7zcW6O4GODt8uS55uXsWBYTRWaoz4pGBIET/WzX/6F9xWE1GJy3xOjZUdqwU bPmUmBHaCFwCJX6P7liZg01oCEpaAH96jmojFEvdvWiQS+9QRMtFvB15pVsue1V5CH nslXHWysanmAVO94TD+UABba+vrZi/63UDytkFWfCpzkNczYDSYV8hXeBMvWCoTsR8 PDNTQxDEvP5Z3t3tFzrzVhAA9rOQOu9+1jqInDnvTV0c6tKdJ3TOJoGlWUkCivqoIO C9mF8P1+72JcA== From: Kai-Heng Feng To: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com Cc: linux-pm@vger.kernel.org, Kai-Heng Feng , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] e1000e: Use PME poll to circumvent unreliable ACPI wake Date: Fri, 2 Jun 2023 00:25:37 +0800 Message-Id: <20230601162537.1163270-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.34.1