Skip to contentSkip to conversation

drm/radeon: fix missing bo reservation

PATCH In review Christian König 3 participants 4 messages Feb 20, 2014 – Feb 21, 2014

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

PATCH 1/1 drm/radeon: fix missing bo reservation

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

Otherwise we might get a crash here.

---
 drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_kms.c +6 -0
index 114d167..2aecd6d 100644
@@ -537,6 +537,10 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 
 		radeon_vm_init(rdev, &fpriv->vm);
 
+		r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
+		if (r)
+			return r;
+
 		/* map the ib pool buffer read only into
 		 * virtual address space */
 		bo_va = radeon_vm_bo_add(rdev, &fpriv->vm,
@@ -544,6 +548,8 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 		r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET,
 					  RADEON_VM_PAGE_READABLE |
 					  RADEON_VM_PAGE_SNOOPED);
+
+		radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
 		if (r) {
 			radeon_vm_fini(rdev, &fpriv->vm);
 			kfree(fpriv);
Signature · 6 lines
1.8.3.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 6 lines · Christian König

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

Otherwise we might get a crash here.

Good catch. Applied to my fixes tree.

Thanks!

Alex

Quoted 31 lines
---
 drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_kms.c +6 -1
index 114d167..2aecd6d 100644
@@ -537,6 +537,10 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 
                radeon_vm_init(rdev, &fpriv->vm);
 
+               r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
+               if (r)
+                       return r;
+
                /* map the ib pool buffer read only into
                 * virtual address space */
                bo_va = radeon_vm_bo_add(rdev, &fpriv->vm,
@@ -544,6 +548,8 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
                r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET,
                                          RADEON_VM_PAGE_READABLE |
                                          RADEON_VM_PAGE_SNOOPED);
+
+               radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
                if (r) {
                        radeon_vm_fini(rdev, &fpriv->vm);
                        kfree(fpriv);
--

1.8.3.2

#2 lore raw
In reply to Christian König

Alex,

shouldn't you send a pull request, that this land in 3.14-rc4? Just in case...

Thanks,
Dieter

Am 20.02.2014 18:47, schrieb Christian König:

Quoted 36 lines

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

Otherwise we might get a crash here.

---
 drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_kms.c +4 -0
index 114d167..2aecd6d 100644
@@ -537,6 +537,10 @@ int radeon_driver_open_kms(struct drm_device
 *dev, struct drm_file *file_priv)
 
 		radeon_vm_init(rdev, &fpriv->vm);
 
+		r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
+		if (r)
+			return r;
+
 		/* map the ib pool buffer read only into
 		 * virtual address space */
drivers/gpu/drm/radeon/radeon_kms.c +2 -0
 		bo_va = radeon_vm_bo_add(rdev, &fpriv->vm,
@@ -544,6 +548,8 @@ int radeon_driver_open_kms(struct drm_device *dev,
 struct drm_file *file_priv)
 		r = radeon_vm_bo_set_addr(rdev, bo_va, RADEON_VA_IB_OFFSET,
 					  RADEON_VM_PAGE_READABLE |
 					  RADEON_VM_PAGE_SNOOPED);
+
+		radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
 		if (r) {
 			radeon_vm_fini(rdev, &fpriv->vm);
Quoted 1 line

kfree(fpriv);

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 4 lines · Dieter Nützel

Alex,

shouldn't you send a pull request, that this land in 3.14-rc4? Just in case...

I'll send a pull request next week along with any other patches I've accumulated since the last pull. I usually try and send a -fixes pull once a week assuming there are fixes that need to go in.

Alex

Quoted 44 lines

Thanks,
Dieter

Am 20.02.2014 18:47, schrieb Christian König:

Quoted 39 lines

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

Otherwise we might get a crash here.

---
 drivers/gpu/drm/radeon/radeon_kms.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/radeon/radeon_kms.c +4 -0
index 114d167..2aecd6d 100644
@@ -537,6 +537,10 @@ int radeon_driver_open_kms(struct drm_device
 *dev, struct drm_file *file_priv)
 
                radeon_vm_init(rdev, &fpriv->vm);
 
+               r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
+               if (r)
+                       return r;
+
                /* map the ib pool buffer read only into
                 * virtual address space */
                bo_va = radeon_vm_bo_add(rdev, &fpriv->vm,
drivers/gpu/drm/radeon/radeon_kms.c +2 -0
@@ -544,6 +548,8 @@ int radeon_driver_open_kms(struct drm_device *dev,
 struct drm_file *file_priv)
                r = radeon_vm_bo_set_addr(rdev, bo_va,
 RADEON_VA_IB_OFFSET,
                                          RADEON_VM_PAGE_READABLE |
                                          RADEON_VM_PAGE_SNOOPED);
+
+               radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
                if (r) {
                        radeon_vm_fini(rdev, &fpriv->vm);
                        kfree(fpriv);