All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmr/amdgpu: Fix wrongly unref of BO
@ 2017-04-13 21:34 Alex Xie
       [not found] ` <1492119298-8526-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Alex Xie @ 2017-04-13 21:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Xie

According to comment of amdgpu_bo_reserve, amdgpu_bo_reserve
can return with -ERESTARTSYS. When this function was interrupted
by a signal, BO should not be unref. Otherwise the BO might be
released while is kmapped and pinned, or BO MIGHT be deref
multiple times, etc.

Change-Id: If76071a768950a0d3ad9d5da7fcae04881807621
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 53996e3..1dcc2d1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -355,8 +355,8 @@ static void amdgpu_vram_scratch_fini(struct amdgpu_device *adev)
 		amdgpu_bo_kunmap(adev->vram_scratch.robj);
 		amdgpu_bo_unpin(adev->vram_scratch.robj);
 		amdgpu_bo_unreserve(adev->vram_scratch.robj);
+		amdgpu_bo_unref(&adev->vram_scratch.robj);
 	}
-	amdgpu_bo_unref(&adev->vram_scratch.robj);
 }
 
 /**
-- 
1.9.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2017-04-21 17:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-13 21:34 [PATCH] dmr/amdgpu: Fix wrongly unref of BO Alex Xie
     [not found] ` <1492119298-8526-1-git-send-email-AlexBin.Xie-5C7GfCeVMHo@public.gmane.org>
2017-04-14  4:00   ` zhoucm1
     [not found]     ` <58F0495D.60607-5C7GfCeVMHo@public.gmane.org>
2017-04-17 14:54       ` Xie, AlexBin
     [not found]         ` <MWHPR1201MB0045DE55E81D0FF5CE76671FF2060-3iK1xFAIwjq45V35fqe+hGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-04-18  2:38           ` zhoucm1
     [not found]             ` <58F57C14.20403-5C7GfCeVMHo@public.gmane.org>
2017-04-18 15:17               ` Xie, AlexBin
     [not found]                 ` <MWHPR1201MB00452889FF2C7FDC55630B4BF2190-3iK1xFAIwjq45V35fqe+hGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-04-18 17:46                   ` Christian König
     [not found]                     ` <7807726d-7318-b72f-1a14-2b37a73988bf-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-18 18:04                       ` Xie, AlexBin
     [not found]                         ` <MWHPR1201MB00451DFD2A06BBA3CD6F928EF2190-3iK1xFAIwjq45V35fqe+hGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-04-18 18:54                           ` Xie, AlexBin
     [not found]                             ` <MWHPR1201MB004553768BCAC951D28A347AF2190-3iK1xFAIwjq45V35fqe+hGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-04-19  6:35                               ` Christian König
     [not found]                                 ` <4509f79a-ffd5-eb40-117c-84ea02cbf5cd-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-19 11:37                                   ` Xie, AlexBin
     [not found]                                     ` <MWHPR1201MB0045EC51F6CE7C6C4283888CF2180-3iK1xFAIwjq45V35fqe+hGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-04-19 11:50                                       ` Christian König
     [not found]                                         ` <2b43e2a9-0c79-f945-c835-0cfc486304c8-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-19 19:30                                           ` Xie, AlexBin
     [not found]                                             ` <MWHPR1201MB0045B04F77E1F1C6D37D24FBF2180-3iK1xFAIwjq45V35fqe+hGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-04-20  8:43                                               ` Christian König
     [not found]                                                 ` <96809715-3c78-3784-fbeb-57a00359e3f3-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-20 21:56                                                   ` Xie, AlexBin
     [not found]                                                     ` <MWHPR1201MB004568A33CBF287710759301F21B0-3iK1xFAIwjq45V35fqe+hGrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-04-21  7:11                                                       ` Christian König
     [not found]                                                         ` <af065740-e219-fccb-4dac-d46f3472f4aa-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-21 15:43                                                           ` Felix Kuehling
     [not found]                                                             ` <003d5e5f-ea99-4517-fd4a-de4df3ce1b89-5C7GfCeVMHo@public.gmane.org>
2017-04-21 17:01                                                               ` Christian König
     [not found]                                                                 ` <a8715aca-05ff-1262-e2f5-31279052e606-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-21 17:53                                                                   ` Felix Kuehling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.