linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gvt: fix deadlock in dispatch_workload()'s error path
@ 2016-12-04 23:57 Eric Engestrom
  2016-12-05  2:38 ` Zhenyu Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Engestrom @ 2016-12-04 23:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Eric Engestrom, Pei Zhang, Zhenyu Wang, Zhi Wang, Daniel Vetter,
	Jani Nikula, David Airlie, igvt-g-dev, intel-gfx, dri-devel

90d27a1 moved the lock before this error path but forgot to add an
unlock here.

Fixes: 90d27a1b180e51ef0713 ("drm/i915/gvt: fix deadlock in workload_thread")
Cc: Pei Zhang <pei.zhang@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
---
 drivers/gpu/drm/i915/gvt/scheduler.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
index f898df3..cd13c4b 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.c
+++ b/drivers/gpu/drm/i915/gvt/scheduler.c
@@ -177,6 +177,7 @@ static int dispatch_workload(struct intel_vgpu_workload *workload)
 	rq = i915_gem_request_alloc(dev_priv->engine[ring_id], shadow_ctx);
 	if (IS_ERR(rq)) {
 		gvt_err("fail to allocate gem request\n");
+		mutex_unlock(&dev_priv->drm.struct_mutex);
 		workload->status = PTR_ERR(rq);
 		return workload->status;
 	}
-- 
Cheers,
  Eric

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

* Re: [PATCH] drm/i915/gvt: fix deadlock in dispatch_workload()'s error path
  2016-12-04 23:57 [PATCH] drm/i915/gvt: fix deadlock in dispatch_workload()'s error path Eric Engestrom
@ 2016-12-05  2:38 ` Zhenyu Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Zhenyu Wang @ 2016-12-05  2:38 UTC (permalink / raw)
  To: Eric Engestrom
  Cc: linux-kernel, Pei Zhang, Zhenyu Wang, Zhi Wang, Daniel Vetter,
	Jani Nikula, David Airlie, igvt-g-dev, intel-gfx, dri-devel

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]

On 2016.12.04 23:57:18 +0000, Eric Engestrom wrote:
> 90d27a1 moved the lock before this error path but forgot to add an
> unlock here.
> 
> Fixes: 90d27a1b180e51ef0713 ("drm/i915/gvt: fix deadlock in workload_thread")
> Cc: Pei Zhang <pei.zhang@intel.com>
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Signed-off-by: Eric Engestrom <eric@engestrom.ch>
> ---

Hi, this has been fixed on https://cgit.freedesktop.org/drm/drm-intel/commit/?h=drm-intel-next-fixes&id=53d6f812c0dbf1c9cad89b1c2118e61c13ca9677

Thanks!

>  drivers/gpu/drm/i915/gvt/scheduler.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
> index f898df3..cd13c4b 100644
> --- a/drivers/gpu/drm/i915/gvt/scheduler.c
> +++ b/drivers/gpu/drm/i915/gvt/scheduler.c
> @@ -177,6 +177,7 @@ static int dispatch_workload(struct intel_vgpu_workload *workload)
>  	rq = i915_gem_request_alloc(dev_priv->engine[ring_id], shadow_ctx);
>  	if (IS_ERR(rq)) {
>  		gvt_err("fail to allocate gem request\n");
> +		mutex_unlock(&dev_priv->drm.struct_mutex);
>  		workload->status = PTR_ERR(rq);
>  		return workload->status;
>  	}
> -- 
> Cheers,
>   Eric
> 

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

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

end of thread, other threads:[~2016-12-05  2:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-04 23:57 [PATCH] drm/i915/gvt: fix deadlock in dispatch_workload()'s error path Eric Engestrom
2016-12-05  2:38 ` Zhenyu Wang

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