Skip to contentSkip to conversation

drm/amdgpu:fix wb_clear

PATCH In review Monk Liu 2 participants 2 messages Oct 18, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu:fix wb_clear

Change-Id I6d50cc769ee29bf13524c83105d5004b0a2d85e3
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -2
index ee3846c..23f946b 100644
@@ -551,7 +551,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
 
 	if (offset < adev->wb.num_wb) {
 		__set_bit(offset, adev->wb.used);
-		*wb = offset * 8; /* convert to dw offset */
+		*wb = offset << 3; /* convert to dw offset */
 		return 0;
 	} else {
 		return -EINVAL;
@@ -569,7 +569,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
 void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb)
 {
 	if (wb < adev->wb.num_wb)
-		__clear_bit(wb, adev->wb.used);
+		__clear_bit(wb >> 3, adev->wb.used);
 }
 
 /**
Signature · 6 lines
2.7.4

_______________________________________________
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): 1508316721-8657-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 2 lines · Monk Liu
Change-Id I6d50cc769ee29bf13524c83105d5004b0a2d85e3

Please include a better patch description. Something like:
Properly shift the index when clearing so we clear the right bit.

With that fixed:

Quoted 29 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -3
index ee3846c..23f946b 100644
@@ -551,7 +551,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
 
        if (offset < adev->wb.num_wb) {
                __set_bit(offset, adev->wb.used);
-               *wb = offset * 8; /* convert to dw offset */
+               *wb = offset << 3; /* convert to dw offset */
                return 0;
        } else {
                return -EINVAL;
@@ -569,7 +569,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
 void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb)
 {
        if (wb < adev->wb.num_wb)
-               __clear_bit(wb, adev->wb.used);
+               __clear_bit(wb >> 3, adev->wb.used);
 }
 
 /**
--

2.7.4

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