netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] e1000e: Use PME poll to circumvent unreliable ACPI wake
@ 2023-08-15 17:01 Tony Nguyen
  2023-08-18  2:18 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Nguyen @ 2023-08-15 17:01 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Kai-Heng Feng, anthony.l.nguyen, Naama Meir, Sasha Neftin,
	Simon Horman, Leon Romanovsky

From: Kai-Heng Feng <kai.heng.feng@canonical.com>

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 <kai.heng.feng@canonical.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
v2:
- Dropped patch 'igb: Stop PTP related workqueues if aren't necessary'

v1: https://lore.kernel.org/netdev/20230810175410.1964221-1-anthony.l.nguyen@intel.com/

 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 771a3c909c45..18a5e73b8680 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.38.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v2] e1000e: Use PME poll to circumvent unreliable ACPI wake
  2023-08-15 17:01 [PATCH net-next v2] e1000e: Use PME poll to circumvent unreliable ACPI wake Tony Nguyen
@ 2023-08-18  2:18 ` Jakub Kicinski
  2023-08-18 16:31   ` Tony Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2023-08-18  2:18 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, pabeni, edumazet, netdev, Kai-Heng Feng, Naama Meir,
	Sasha Neftin, Simon Horman, Leon Romanovsky

On Tue, 15 Aug 2023 10:01:11 -0700 Tony Nguyen wrote:
> From: Kai-Heng Feng <kai.heng.feng@canonical.com>
> 
> 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.

Applied, thanks!

I'm curious - why not treat it as a fix?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v2] e1000e: Use PME poll to circumvent unreliable ACPI wake
  2023-08-18  2:18 ` Jakub Kicinski
@ 2023-08-18 16:31   ` Tony Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Nguyen @ 2023-08-18 16:31 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, pabeni, edumazet, netdev, Kai-Heng Feng, Naama Meir,
	Sasha Neftin, Simon Horman, Leon Romanovsky



On 8/17/2023 7:18 PM, Jakub Kicinski wrote:
> On Tue, 15 Aug 2023 10:01:11 -0700 Tony Nguyen wrote:
>> From: Kai-Heng Feng <kai.heng.feng@canonical.com>
>>
>> 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.
> 
> Applied, thanks!
> 
> I'm curious - why not treat it as a fix?

It came to IWL this way so I'm not sure if there was an initial reason 
from Kai-Heng, but there was discussions with this so I felt safer 
sticking with -next.

Thanks,
Tony

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-18 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15 17:01 [PATCH net-next v2] e1000e: Use PME poll to circumvent unreliable ACPI wake Tony Nguyen
2023-08-18  2:18 ` Jakub Kicinski
2023-08-18 16:31   ` Tony Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).