mirror of https://github.com/torvalds/linux.git
drm/amdkfd: Allow device error to be logged
The addition of a WARN_ON() check in order to return early in the kq_initialize function retroactively causes the default case in the following switch statement to never be executed, preventing dev_err from logging device errors in the kernel. Both logs are now checked in the default case. Signed-off-by: Sunday Clement <Sunday.Clement@amd.com> Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
cbf3a5d67a
commit
7bbfa1b1fa
|
|
@ -46,11 +46,7 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev,
|
|||
int retval;
|
||||
union PM4_MES_TYPE_3_HEADER nop;
|
||||
|
||||
if (WARN_ON(type != KFD_QUEUE_TYPE_DIQ && type != KFD_QUEUE_TYPE_HIQ))
|
||||
return false;
|
||||
|
||||
pr_debug("Initializing queue type %d size %d\n", KFD_QUEUE_TYPE_HIQ,
|
||||
queue_size);
|
||||
pr_debug("Initializing queue type %d size %d\n", type, queue_size);
|
||||
|
||||
memset(&prop, 0, sizeof(prop));
|
||||
memset(&nop, 0, sizeof(nop));
|
||||
|
|
@ -69,6 +65,7 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev,
|
|||
kq->mqd_mgr = dev->dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ];
|
||||
break;
|
||||
default:
|
||||
WARN(1, "Invalid queue type %d\n", type);
|
||||
dev_err(dev->adev->dev, "Invalid queue type %d\n", type);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue