Skip to contentSkip to conversation

drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

PATCH In review Christian König 4 participants 8 messages Sep 25, 2016 – Sep 26, 2016 5 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

From: Christian König <[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -0
index 2bb78dc..da31189 100644
@@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 						    AMDGPU_GPU_PAGE_SIZE);
 			pte[i] |= flags;
 		}
+		addr = 0;
 	}
 
 	r = amdgpu_sync_fence(adev, &job->sync, exclusive);
Signature · 6 lines
2.5.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1474797313-1994-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#2 lore raw
Quoted 26 lines · Christian König

From: Christian König <[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -0
index 2bb78dc..da31189 100644
@@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 						    AMDGPU_GPU_PAGE_SIZE);
 			pte[i] |= flags;
 		}
+		addr = 0;
 	}
 
 	r = amdgpu_sync_fence(adev, &job->sync, exclusive);
Signature · 1 line
2.5.0

IMHO this could fix the vmfault issue.

8<---
From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001
From: Flora Cui <[email protected]>
Date: Mon, 26 Sep 2016 15:14:02 +0800
Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()

Change-Id If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -0
index 2bb78dc..7f17127 100644
@@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
 			ttm = container_of(bo_va->bo->tbo.ttm, struct
 					   ttm_dma_tt, ttm);
 			pages_addr = ttm->dma_address;
+			amdgpu_ttm_bind(&bo_va->bo->tbo, mem);
+			addr = (u64)mem->start << PAGE_SHIFT;
 			break;
 
 		case TTM_PL_VRAM:
Signature · 7 lines
2.7.4


_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

please ignore this patch. it actually revert the gtt mgr changes.

Quoted 63 lines · Flora Cui
Quoted 26 lines · Christian König

From: Christian König <[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -0
index 2bb78dc..da31189 100644
@@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 						    AMDGPU_GPU_PAGE_SIZE);
 			pte[i] |= flags;
 		}
+		addr = 0;
 	}
 
 	r = amdgpu_sync_fence(adev, &job->sync, exclusive);
Signature · 1 line
2.5.0

IMHO this could fix the vmfault issue.

8<---
From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001
From: Flora Cui <[email protected]>
Date: Mon, 26 Sep 2016 15:14:02 +0800
Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()

Change-Id If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -0
index 2bb78dc..7f17127 100644
@@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
 			ttm = container_of(bo_va->bo->tbo.ttm, struct
 					   ttm_dma_tt, ttm);
 			pages_addr = ttm->dma_address;
+			amdgpu_ttm_bind(&bo_va->bo->tbo, mem);
+			addr = (u64)mem->start << PAGE_SHIFT;
 			break;
 
 		case TTM_PL_VRAM:
Signature · 7 lines
2.7.4


_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw

Yeah, that wouldn't really help but just make the problem more unlikely to happen once more.

Anyway Tom St confirmed that the patch seems to work for the open stack.

Anybody brave enough to throw an rb on this so that I can commit it?

Thanks,
Christian.

Am 26.09.2016 um 11:16 schrieb Flora Cui:

Quoted 61 lines

please ignore this patch. it actually revert the gtt mgr changes.

Quoted 58 lines · Flora Cui
Quoted 26 lines · Christian König

From: Christian König <[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -0
index 2bb78dc..da31189 100644
@@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
  						    AMDGPU_GPU_PAGE_SIZE);
  			pte[i] |= flags;
  		}
+		addr = 0;
  	}
 
  	r = amdgpu_sync_fence(adev, &job->sync, exclusive);
Signature · 1 line
2.5.0

IMHO this could fix the vmfault issue.

8<---
From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001
From: Flora Cui <[email protected]>
Date: Mon, 26 Sep 2016 15:14:02 +0800
Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()

Change-Id If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -0
index 2bb78dc..7f17127 100644
@@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
  			ttm = container_of(bo_va->bo->tbo.ttm, struct
  					   ttm_dma_tt, ttm);
  			pages_addr = ttm->dma_address;
+			amdgpu_ttm_bind(&bo_va->bo->tbo, mem);
+			addr = (u64)mem->start << PAGE_SHIFT;
  			break;
 
  		case TTM_PL_VRAM:
Signature · 1 line
2.7.4
Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 5336fe95-9645-0c9c-e948-1e51811ad907-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#6 lore raw

I'm reading through the amdgpu_vm.c to try and see if the patch is correct but I'm not that familiar with the VM side of things. It seems to boil down to calling params->func() with a new dst value of NULL but that's where I'm stopped at the moment since I don't know what func() is. Nothing up to that point looks overtly wrong (like trying to use that address as a source for a read/write).

Tom

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]>
Sent: Monday, September 26, 2016 09:29
To: Cui, Flora
Cc: Huang, Ray; [email protected]
Subject: Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

Yeah, that wouldn't really help but just make the problem more unlikely to happen once more.

Anyway Tom St confirmed that the patch seems to work for the open stack.

Anybody brave enough to throw an rb on this so that I can commit it?

Thanks,
Christian.

Am 26.09.2016 um 11:16 schrieb Flora Cui:

Quoted 61 lines

please ignore this patch. it actually revert the gtt mgr changes.

Quoted 58 lines · Flora Cui
Quoted 23 lines · Christian König

From: Christian König <[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 2bb78dc..da31189 100644
@@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
                                                 AMDGPU_GPU_PAGE_SIZE);
                     pte[i] |= flags;
             }
+           addr = 0;
     }
 
     r = amdgpu_sync_fence(adev, &job->sync, exclusive);
--
Quoted 3 lines

2.5.0

IMHO this could fix the vmfault issue.

8<---
From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001
From: Flora Cui <[email protected]>
Date: Mon, 26 Sep 2016 15:14:02 +0800
Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()

Change-Id If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -1
index 2bb78dc..7f17127 100644
@@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
                      ttm = container_of(bo_va->bo->tbo.ttm, struct
                                         ttm_dma_tt, ttm);
                      pages_addr = ttm->dma_address;
+                    amdgpu_ttm_bind(&bo_va->bo->tbo, mem);
+                    addr = (u64)mem->start << PAGE_SHIFT;
                      break;
 
              case TTM_PL_VRAM:
--

2.7.4

Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

amd-gfx Info Page - lists.freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives. Using amd-gfx: To post a message to all the list members, send email ...

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CY4PR12MB1768C24C35861367BAD1BA07F7CD0-rpdhrqHFk06yjjPBNVDk/[email protected]

#8 lore raw

The function called is either amdgpu_vm_do_set_ptes() or amdgpu_vm_do_copy_ptes().

But that is actually rather unrelated to the local handling of addr in the function changed.

The point here is we have handled the address offset by giving it to amdgpu_vm_map_gart() and so we shouldn't add the address again.

Regards,
Christian.

Am 26.09.2016 um 15:46 schrieb StDenis, Tom:

Quoted 106 lines

I'm reading through the amdgpu_vm.c to try and see if the patch is correct but I'm not that familiar with the VM side of things. It seems to boil down to calling params->func() with a new dst value of NULL but that's where I'm stopped at the moment since I don't know what func() is. Nothing up to that point looks overtly wrong (like trying to use that address as a source for a read/write).

Tom

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]> *Sent:* Monday, September 26, 2016 09:29
*To:* Cui, Flora
*Cc:* Huang, Ray; [email protected]
*Subject:* Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping
Yeah, that wouldn't really help but just make the problem more unlikely
to happen once more.

Anyway Tom St confirmed that the patch seems to work for the open stack.

Anybody brave enough to throw an rb on this so that I can commit it?

Thanks,
Christian.

Am 26.09.2016 um 11:16 schrieb Flora Cui:

Quoted 9 lines

please ignore this patch. it actually revert the gtt mgr changes.

Quoted 6 lines · Flora Cui
Quoted 5 lines · Christian König

From: Christian König <[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

Quoted 6 lines
Quoted 6 lines

Review

Quoted 6 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
  1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int

Quoted 4 lines

index 2bb78dc..da31189 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -1017,6 +1017,7 @@ static int 

amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,

Quoted 19 lines
Quoted 19 lines
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
 AMDGPU_GPU_PAGE_SIZE);
                     pte[i] |= flags;
             }
+           addr = 0;
     }
 
     r = amdgpu_sync_fence(adev, &job->sync, exclusive);
--

2.5.0

IMHO this could fix the vmfault issue.

8<---
From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001
From: Flora Cui <[email protected]>
Date: Mon, 26 Sep 2016 15:14:02 +0800
Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()

Quoted 7 lines

Review

Quoted 7 lines
Change-Id If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++
  1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Quoted 4 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_update(struct amdgpu_device

Quoted 4 lines

index 2bb78dc..7f17127 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -0
@@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device 

*adev,

Quoted 12 lines
Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -1
                      ttm = container_of(bo_va->bo->tbo.ttm, struct
 ttm_dma_tt, ttm);
                      pages_addr = ttm->dma_address;
+ amdgpu_ttm_bind(&bo_va->bo->tbo, mem);
+                    addr = (u64)mem->start << PAGE_SHIFT;
                      break;
 
              case TTM_PL_VRAM:
--

2.7.4

Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
amd-gfx Info Page - lists.freedesktop.org <https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives. Using amd-gfx: To post a message to all the list members, send email ...

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): c6238048-9393-e20c-2b03-6ff11c82ea45-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#10 lore raw

Maybe it would be cleaner to just pass 0 to amdgpu_vm_frag_ptes() or remove the parameter altogether.

Alex

From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Christian König
Sent: Monday, September 26, 2016 11:12 AM
To: StDenis, Tom; Cui, Flora
Cc: Huang, Ray; [email protected]
Subject: Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

The function called is either amdgpu_vm_do_set_ptes() or amdgpu_vm_do_copy_ptes().

But that is actually rather unrelated to the local handling of addr in the function changed.

The point here is we have handled the address offset by giving it to amdgpu_vm_map_gart() and so we shouldn't add the address again.

Regards,
Christian.

Am 26.09.2016 um 15:46 schrieb StDenis, Tom:

I'm reading through the amdgpu_vm.c to try and see if the patch is correct but I'm not that familiar with the VM side of things. It seems to boil down to calling params->func() with a new dst value of NULL but that's where I'm stopped at the moment since I don't know what func() is. Nothing up to that point looks overtly wrong (like trying to use that address as a source for a read/write).

Tom

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:[email protected]> on behalf of Christian König <[email protected]><mailto:[email protected]>
Sent: Monday, September 26, 2016 09:29
To: Cui, Flora
Cc: Huang, Ray; [email protected]<mailto:amd-gfx-PD4FTy7X32lzq7FAFJ/[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

Yeah, that wouldn't really help but just make the problem more unlikely to happen once more.

Anyway Tom St confirmed that the patch seems to work for the open stack.

Anybody brave enough to throw an rb on this so that I can commit it?

Thanks,
Christian.

Am 26.09.2016 um 11:16 schrieb Flora Cui:

Quoted 61 lines

please ignore this patch. it actually revert the gtt mgr changes.

Quoted 58 lines · Flora Cui
Quoted 23 lines · Christian König

From: Christian König <[email protected]><mailto:[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 2bb78dc..da31189 100644
@@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
                                                 AMDGPU_GPU_PAGE_SIZE);
                     pte[i] |= flags;
             }
+           addr = 0;
     }
 
     r = amdgpu_sync_fence(adev, &job->sync, exclusive);
--
Quoted 3 lines

2.5.0

IMHO this could fix the vmfault issue.

8<---
From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001
From: Flora Cui <[email protected]><mailto:[email protected]>
Date: Mon, 26 Sep 2016 15:14:02 +0800
Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()

Change-Id If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -1
index 2bb78dc..7f17127 100644
@@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
                      ttm = container_of(bo_va->bo->tbo.ttm, struct
                                         ttm_dma_tt, ttm);
                      pages_addr = ttm->dma_address;
+                    amdgpu_ttm_bind(&bo_va->bo->tbo, mem);
+                    addr = (u64)mem->start << PAGE_SHIFT;
                      break;
 
              case TTM_PL_VRAM:
--

2.7.4

Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

amd-gfx Info Page - lists.freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives. Using amd-gfx: To post a message to all the list members, send email ...

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): MWHPR12MB16940A99EBD2BCB0A5F687C3F7CD0-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by
#12 lore raw

Wait, nevermind. It would be good to add a comment that addr needs to be reset to 0 in this case since it's used below in the amdgpu_vm_frag_ptes().

The patch is:

From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Deucher, Alexander
Sent: Monday, September 26, 2016 11:17 AM
To: 'Christian König'; StDenis, Tom; Cui, Flora
Cc: Huang, Ray; [email protected]
Subject: RE: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

Maybe it would be cleaner to just pass 0 to amdgpu_vm_frag_ptes() or remove the parameter altogether.

Alex

From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf Of Christian König
Sent: Monday, September 26, 2016 11:12 AM
To: StDenis, Tom; Cui, Flora
Cc: Huang, Ray; [email protected]<mailto:amd-gfx-PD4FTy7X32lzq7FAFJ/[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

The function called is either amdgpu_vm_do_set_ptes() or amdgpu_vm_do_copy_ptes().

But that is actually rather unrelated to the local handling of addr in the function changed.

The point here is we have handled the address offset by giving it to amdgpu_vm_map_gart() and so we shouldn't add the address again.

Regards,
Christian.

Am 26.09.2016 um 15:46 schrieb StDenis, Tom:

I'm reading through the amdgpu_vm.c to try and see if the patch is correct but I'm not that familiar with the VM side of things. It seems to boil down to calling params->func() with a new dst value of NULL but that's where I'm stopped at the moment since I don't know what func() is. Nothing up to that point looks overtly wrong (like trying to use that address as a source for a read/write).

Tom

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:[email protected]> on behalf of Christian König <[email protected]><mailto:[email protected]>
Sent: Monday, September 26, 2016 09:29
To: Cui, Flora
Cc: Huang, Ray; [email protected]<mailto:amd-gfx-PD4FTy7X32lzq7FAFJ/[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix addr handling in amdgpu_vm_bo_update_mapping

Yeah, that wouldn't really help but just make the problem more unlikely to happen once more.

Anyway Tom St confirmed that the patch seems to work for the open stack.

Anybody brave enough to throw an rb on this so that I can commit it?

Thanks,
Christian.

Am 26.09.2016 um 11:16 schrieb Flora Cui:

Quoted 61 lines

please ignore this patch. it actually revert the gtt mgr changes.

Quoted 58 lines · Flora Cui
Quoted 23 lines · Christian König

From: Christian König <[email protected]><mailto:[email protected]>

Otherwise we will look at the wrong place in the IB when GART mappings are split into smaller updates.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 2bb78dc..da31189 100644
@@ -1017,6 +1017,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
                                                 AMDGPU_GPU_PAGE_SIZE);
                     pte[i] |= flags;
             }
+           addr = 0;
     }
 
     r = amdgpu_sync_fence(adev, &job->sync, exclusive);
--
Quoted 3 lines

2.5.0

IMHO this could fix the vmfault issue.

8<---
From cc7b5618665defd88e2adcd6f735562ecd784298 Mon Sep 17 00:00:00 2001
From: Flora Cui <[email protected]><mailto:[email protected]>
Date: Mon, 26 Sep 2016 15:14:02 +0800
Subject: [PATCH] drm/amdgpu: add ttm_bind in amdgpu_vm_bo_update()

Change-Id If73d5b06e9188e40250ccdfd1a2a659ed1ef52a6
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -1
index 2bb78dc..7f17127 100644
@@ -1166,6 +1166,8 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
                      ttm = container_of(bo_va->bo->tbo.ttm, struct
                                         ttm_dma_tt, ttm);
                      pages_addr = ttm->dma_address;
+                    amdgpu_ttm_bind(&bo_va->bo->tbo, mem);
+                    addr = (u64)mem->start << PAGE_SHIFT;
                      break;
 
              case TTM_PL_VRAM:
--

2.7.4

Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

amd-gfx Info Page - lists.freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives. Using amd-gfx: To post a message to all the list members, send email ...

Quoted 4 lines

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list [email protected]<mailto:[email protected]>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx