dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] drm/etnaviv: fix ref count leak via pm_runtime_get_sync
@ 2020-06-15 15:57 Markus Elfring
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2020-06-15 15:57 UTC (permalink / raw)
  To: Navid Emamdoost, dri-devel, etnaviv, linux+etnaviv
  Cc: David Airlie, Kangjie Lu, kernel-janitors, linux-kernel,
	Stephen McCamant, Andy Shevchenko, Navid Emamdoost, Qiushi Wu

…
> In case of failure, decrement the ref count before returning.

Can it be nicer to use the term “reference count” here?

Will the tag “Fixes” become helpful for the commit message?


…
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -1326,6 +1331,7 @@  struct dma_fence *etnaviv_gpu_submit(struct etnaviv_gem_submit *submit)
>  	ret = event_alloc(gpu, nr_events, event);
>  	if (ret) {
>  		DRM_ERROR("no free events\n");
> +		pm_runtime_put_noidle(gpu->dev);
>  		return NULL;
>  	}

I suggest to move a bit of exception handling code to the end of
this function implementation so that it can be better reused after
the addition of a jump target like “put_runtime”.

Regards,
Markus
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [PATCH] drm/etnaviv: fix ref count leak via pm_runtime_get_sync
@ 2020-06-14  9:48 Andy Shevchenko
  2020-06-15  6:12 ` [PATCH v2] " Navid Emamdoost
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-06-14  9:48 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: wu000273, David Airlie, Stephen McCamant, Kangjie Lu, etnaviv,
	dri-devel, Linux Kernel Mailing List, Navid Emamdoost,
	Russell King

On Sun, Jun 14, 2020 at 9:48 AM Navid Emamdoost
<navid.emamdoost@gmail.com> wrote:

...

> +               if (ret < 0) {

> +                       pm_runtime_put(gpu->dev);

Please, in all your patches fix this to be _put_noidle(). We wouldn't
bear the flag day of fixing these parts again.
Yes, I know that *now* behaviour is the same, but calling put here is
slightly inconsistent.

...

> +               pm_runtime_put(gpu->dev);

-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-06-18  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 15:57 [PATCH v2] drm/etnaviv: fix ref count leak via pm_runtime_get_sync Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-06-14  9:48 [PATCH] " Andy Shevchenko
2020-06-15  6:12 ` [PATCH v2] " Navid Emamdoost
2020-06-17  9:53   ` Lucas Stach
2020-06-17 17:57     ` Navid Emamdoost

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).