[PATCH v2 2/5] drm/panthor: Be robust against runtime PM resume failures in the suspend path

Boris Brezillon boris.brezillon at collabora.com
Fri Nov 29 14:45:54 UTC 2024


On Fri, 29 Nov 2024 13:14:58 +0000
Adrián Larumbe <adrian.larumbe at collabora.com> wrote:

> Reviewed-by: Adrian Larumbe <adrian.larumbe at collabora.com>
> 
> On 28.11.2024 12:02, Boris Brezillon wrote:
> > The runtime PM resume operation is not guaranteed to succeed, but if it
> > fails, the device should be in a suspended state. Make sure we're robust
> > to resume failures in the unplug path.
> > 
> > v2:
> > - Move the bit that belonged in the next commit
> > - Drop the panthor_device_unplug() changes
> > 
> > Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> > ---
> >  drivers/gpu/drm/panthor/panthor_fw.c  | 14 +++++++++-----
> >  drivers/gpu/drm/panthor/panthor_gpu.c |  3 ++-
> >  drivers/gpu/drm/panthor/panthor_mmu.c |  3 ++-
> >  3 files changed, 13 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> > index ebf8980ca9a3..f3d3d8fbe13d 100644
> > --- a/drivers/gpu/drm/panthor/panthor_fw.c
> > +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> > @@ -12,6 +12,7 @@
> >  #include <linux/iosys-map.h>
> >  #include <linux/mutex.h>
> >  #include <linux/platform_device.h>
> > +#include <linux/pm_runtime.h>
> >  
> >  #include <drm/drm_drv.h>
> >  #include <drm/drm_managed.h>
> > @@ -1190,11 +1191,13 @@ void panthor_fw_unplug(struct panthor_device *ptdev)
> >  
> >  	cancel_delayed_work_sync(&ptdev->fw->watchdog.ping_work);
> >  
> > -	/* Make sure the IRQ handler can be called after that point. */
> > -	if (ptdev->fw->irq.irq)
> > -		panthor_job_irq_suspend(&ptdev->fw->irq);
> > +	if (!IS_ENABLED(CONFIG_PM) || pm_runtime_active(ptdev->base.dev)) {
> > +		/* Make sure the IRQ handler can be called after that point. */  
> 
> Did you mean 'cannot be called' ?

Oops, indeed I meant 'cannot'.



More information about the dri-devel mailing list