Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-21 Thread Felix Kuehling
On 17-04-21 01:01 PM, Christian König wrote: > Am 21.04.2017 um 17:43 schrieb Felix Kuehling: >> On 17-04-21 03:11 AM, Christian König wrote: >>> Hi Alex, >>> No. For the current source code, I think the premap and no-op is not working. >>> Indeed, we don't set bo->mem.bus.addr in

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-21 Thread Felix Kuehling
t;> struct ttm_mem_type_manager *man = >> >bdev->man[bo->mem.mem_type]; >> >> -if (!map->virtual) >> +if (!map->virtual) { >> +if (bo->mem.bus.printk) >> +printk ("scratch unmap return earlier"); >> return; >> +} &g

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-21 Thread Christian König
i.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -70,6 +70,7 @@ struct ttm_bus_placement { boolis_iomem; boolio_reserved_vm; uint64_tio_reserved_count; +boolprintk; }; -- 2.7.4 Thanks, Alex Bin *From:* Chris

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-20 Thread Xie, AlexBin
rintk ("scratch unmap bug"); BUG(); } (void) ttm_mem_io_lock(man, false); diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 2d0f63e..f74a554 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -70,6 +70,7 @@ struct ttm_bus_plac

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-20 Thread Christian König
Sent:* Wednesday, April 19, 2017 7:50 AM *To:* Xie, AlexBin; Zhou, David(ChunMing); amd-gfx@lists.freedesktop.org *Subject:* Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO Without correctly kunmap, page table is corrupted. Page entries point to wrong memory locations. You might call it completely

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-19 Thread Christian König
* Xie, AlexBin; Zhou, David(ChunMing); amd-gfx@lists.freedesktop.org *Subject:* Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO Hi AlexBin, the answer is ttm_bo_kunmap isn't called at all and yes in the case of an iomap we leak the address space reserved. But that is completely harmless o

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-19 Thread Xie, AlexBin
-gfx@lists.freedesktop.org Subject: Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO Hi AlexBin, the answer is ttm_bo_kunmap isn't called at all and yes in the case of an iomap we leak the address space reserved. But that is completely harmless on a 64bit system compared to leaking the memory

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-19 Thread Christian König
-gfx@lists.freedesktop.org *Subject:* Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO Hi AlexBin, No, David is right. This is a very common coding pattern in the kernel module. Freeing up a BO while there still exists a kernel mapping is perfectly ok, the mapping will just be released a bi

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-18 Thread Xie, AlexBin
Thanks, Alex Bin Xie From: Xie, AlexBin Sent: Tuesday, April 18, 2017 2:04:33 PM To: Christian König; Zhou, David(ChunMing); amd-gfx@lists.freedesktop.org Subject: Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO Hi Christian, Would you point out where/when will kunmap hap

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-18 Thread Xie, AlexBin
d(ChunMing) Sent: Monday, April 17, 2017 10:38 PM To: Xie, AlexBin; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> Subject: Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO On 2017年04月17日 22:54, Xie, AlexBin wrote: Hi David, Thanks for the comments. How

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-18 Thread Xie, AlexBin
Alex Bin Xie From: Zhou, David(ChunMing) Sent: Friday, April 14, 2017 12:00 AM To: Xie, AlexBin; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> Subject: Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO On 2017年04月14日 05:34, Alex Xie wrote: >

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-17 Thread zhoucm1
Xie *From:* Zhou, David(ChunMing) *Sent:* Friday, April 14, 2017 12:00 AM *To:* Xie, AlexBin; amd-gfx@lists.freedesktop.org *Subject:* Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO On 2017年04月14日 05:34, Alex Xie wrote: > According to comment of amdgpu_bo_r

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-17 Thread Xie, AlexBin
ent: Friday, April 14, 2017 12:00 AM To: Xie, AlexBin; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO On 2017年04月14日 05:34, Alex Xie wrote: > According to comment of amdgpu_bo_reserve, amdgpu_bo_reserve > can return with -ERESTARTSYS. When this

Re: [PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-13 Thread zhoucm1
On 2017年04月14日 05:34, Alex Xie wrote: 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

[PATCH] dmr/amdgpu: Fix wrongly unref of BO

2017-04-13 Thread 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: