drm/amdkfd: fix bug when initializing sdma vm
authorOded Gabbay <oded.gabbay@gmail.com>
Wed, 29 Jul 2015 07:40:26 +0000 (10:40 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 30 Jul 2015 06:26:15 +0000 (09:26 +0300)
A logical AND operation was used during mask and shift, instead of a
bitwise AND operation. This patch fixes this bug by changing the
operation to bitwise AND.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c

index 23ce774ff09d324662c511f14e0188e53f079496..c6f435aa803fd2923e0a5c2b45d1a13f5a069ee5 100644 (file)
@@ -143,7 +143,7 @@ static void init_sdma_vm(struct device_queue_manager *dqm, struct queue *q,
                                get_sh_mem_bases_32(qpd_to_pdd(qpd));
        else
                value |= ((get_sh_mem_bases_nybble_64(qpd_to_pdd(qpd))) <<
-                               SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE__SHIFT) &&
+                               SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE__SHIFT) &
                                SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE_MASK;
 
        q->properties.sdma_vm_addr = value;
index 44c38e8e54d303b0bbb3cbcab51a968882f3589c..7e9cae9d349b5535f973c7825cf356fe48f42d9c 100644 (file)
@@ -155,7 +155,7 @@ static void init_sdma_vm(struct device_queue_manager *dqm, struct queue *q,
                                get_sh_mem_bases_32(qpd_to_pdd(qpd));
        else
                value |= ((get_sh_mem_bases_nybble_64(qpd_to_pdd(qpd))) <<
-                               SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE__SHIFT) &&
+                               SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE__SHIFT) &
                                SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE_MASK;
 
        q->properties.sdma_vm_addr = value;