提交 63ae07ca 编写于 作者: M Monk Liu 提交者: Alex Deucher

drm/amdgpu:fix wb_clear

Properly shift the index when clearing so we clear
the right bit
Signed-off-by: NMonk Liu <Monk.Liu@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 6867e1b5
...@@ -546,7 +546,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb) ...@@ -546,7 +546,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
if (offset < adev->wb.num_wb) { if (offset < adev->wb.num_wb) {
__set_bit(offset, adev->wb.used); __set_bit(offset, adev->wb.used);
*wb = offset * 8; /* convert to dw offset */ *wb = offset << 3; /* convert to dw offset */
return 0; return 0;
} else { } else {
return -EINVAL; return -EINVAL;
...@@ -564,7 +564,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb) ...@@ -564,7 +564,7 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb) void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb)
{ {
if (wb < adev->wb.num_wb) if (wb < adev->wb.num_wb)
__clear_bit(wb, adev->wb.used); __clear_bit(wb >> 3, adev->wb.used);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部