Subject: Re: [PATCH net v3] net: ethtool: do runtime PM outside RTNL

From: Jakub Kicinski <[email-masked]>
Date: Wed, 3 Jan 2024 15:34:05 -0800

On Wed, 3 Jan 2024 11:30:17 +0100 Stanislaw Gruszka wrote:
> > I was really, really hoping that this would serve as a motivation
> > for Intel to sort out the igb/igc implementation. The flow AFAICT
> > is ndo_open() starts the NIC, the calls pm_sus, which shuts the NIC
> > back down immediately (!?) then it schedules a link check from a work  
> 
> It's not like that. pm_runtime_put() in igc_open() does not disable device.
> It calls runtime_idle callback which check if there is link and if is
> not, schedule device suspend in 5 second, otherwise device stays running.

Hm, I missed the 5 sec delay there. Next question for me is - how does
it not deadlock in the open?

igc_open()
  __igc_open(resuming=false)
    if (!resuming)
      pm_runtime_get_sync(&pdev->dev);

igc_resume()
  rtnl_lock()