Re: [PATCH] PCI/AER: Block runtime suspend when handling errors

Stanislaw Gruszka
2024-02-12T08:13:11Z

On Fri, Feb 09, 2024 at 07:45:05AM -0800, Kuppuswamy Sathyanarayanan wrote:
>
> On 2/9/24 6:08 AM, Stanislaw Gruszka wrote:
> > PM runtime can be done simultaneously with AER error handling.
> > Avoid that by using pm_runtime_get_sync() before and pm_runtime_put()
> > after reset in pcie_do_recovery() for all recovering devices.
> >
> > pm_runtime_get_sync() will increase dev->power.usage_count counter
> > to prevent any possible future request to runtime suspend a device,
> > as well as resume device is was in D3hot state.
> runtime suspend a device or resume a device that was in D3hot state.

I think "or" is not proper here, since both: resume and prevention
of suspend are done. I'll reword this way:

pm_runtime_get_sync() will increase dev->power.usage_count counter
to prevent any possible future request to runtime suspend a device
It will also resume a device, if it was previously in D3hot state.

Hope that's clearer.

Thanks
Stanislaw