drm/amdkfd: fix clock counter retrieval for node without GPU
authorAndres Rodriguez <andres.rodriguez@amd.com>
Tue, 10 Apr 2018 21:32:33 +0000 (17:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Jun 2018 19:02:47 +0000 (04:02 +0900)
commit56dfe52e04a287eb8c1d25d8fcfaef9e32fcd2e8
treebcf66bc795784ca7415be2fb5be019915fe6ddbc
parent73ea96beb771e7a1670eeb9d945a00d6bf1855d5
drm/amdkfd: fix clock counter retrieval for node without GPU

[ Upstream commit 1cf6cc74bbeb85bb87c3ca3f3df97a283c3aa737 ]

Currently if a user requests clock counters for a node without a GPU
resource we will always return EINVAL.

Instead if no GPU resource is attached, fill the gpu_clock_counter
argument with zeroes so that we may proceed and return valid CPU
counters.

Signed-off-by: Andres Rodriguez <andres.rodriguez@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c