Hi Imre, > -----Original Message----- > From: Deak, Imre <imre.deak@xxxxxxxxx> > Sent: 29 August 2022 20:16 > To: Golani, Mitulkumar Ajitkumar <mitulkumar.ajitkumar.golani@xxxxxxxxx> > Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx > Subject: Re: [PATCH] drm/i915/display: Fix warning callstack for > imbalance wakeref > > On Mon, Aug 29, 2022 at 09:45:53AM +0300, Golani, Mitulkumar Ajitkumar > wrote: > > Hi Imre, > > > > > [...] > > > Still not sure what's going. Both i915_pci_probe() and > > > i915_pci_remove()->i915_driver_remove() is called with a runtime PM > > > reference - taken at local_pci_probe() and pci_device_remove() - and > > > so the device should be runtime resumed at those points. > > > > > > > Yes reference is being taken at local_pci_probe() and > > pci_device_remove() but During i915_selftest@perf, it is loading and > > unloading i915_pci_probe() and i915_pci_remove(), here > > pci_device_remove() is not being called, that's why runtime PM reference is > not present during i915_driver_remove(). > > Ok, that explains it. Taking an actual RPM reference unconditionally in > i915_driver_remove() should fix this (instead of the > disable/enable_rpm_wakeref_asserts() calls there): > > wakeref = intel_runtime_pm_get(); > ... > intel_runtime_pm_put(wakeref); > > While at it the same change should be applied in i915_driver_release() as > well for consistency. > Thanks Imre. Verified on Target. This works. Pushed changes : https://patchwork.freedesktop.org/patch/500180/?series=107211&rev=6