diff mbox

[2/2] drm/amdkfd: fix bug when initializing sdma vm

Message ID 1438155863-9187-2-git-send-email-oded.gabbay@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Oded Gabbay July 29, 2015, 7:44 a.m. UTC
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>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Deucher July 29, 2015, 3:53 p.m. UTC | #1
On Wed, Jul 29, 2015 at 3:44 AM, Oded Gabbay <oded.gabbay@gmail.com> wrote:
> 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 | 2 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
> index 23ce774..c6f435a 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
> @@ -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;
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
> index 44c38e8..7e9cae9 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
> @@ -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;
> --
> 2.4.3
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
index 23ce774..c6f435a 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
index 44c38e8..7e9cae9 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
@@ -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;