Commit 1365aa62 authored by Oded Gabbay's avatar Oded Gabbay

drm/amdkfd: Initialize only amdkfd's assigned pipelines

This patch fixes a bug in the initialization of the pipelines. The
init_pipelines() function was called with a constant value of 0 in the
first_pipe argument. This is an error because amdkfd doesn't handle pipe 0.

The correct way is to pass the value that get_first_pipe() returns as the
argument for first_pipe.

This bug appeared in 3.19 (first version with amdkfd) and it causes around 15%
drop in CPU performance of Kaveri (A10-7850).

v2: Don't set get_first_pipe() as inline because it calls BUG_ON()
Signed-off-by: default avatarOded Gabbay <oded.gabbay@amd.com>
Cc: stable@vger.kernel.org
Tested-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
parent c517d838
...@@ -62,9 +62,9 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type) ...@@ -62,9 +62,9 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type)
return KFD_MQD_TYPE_CP; return KFD_MQD_TYPE_CP;
} }
static inline unsigned int get_first_pipe(struct device_queue_manager *dqm) unsigned int get_first_pipe(struct device_queue_manager *dqm)
{ {
BUG_ON(!dqm); BUG_ON(!dqm || !dqm->dev);
return dqm->dev->shared_resources.first_compute_pipe; return dqm->dev->shared_resources.first_compute_pipe;
} }
......
...@@ -163,6 +163,7 @@ void program_sh_mem_settings(struct device_queue_manager *dqm, ...@@ -163,6 +163,7 @@ void program_sh_mem_settings(struct device_queue_manager *dqm,
struct qcm_process_device *qpd); struct qcm_process_device *qpd);
int init_pipelines(struct device_queue_manager *dqm, int init_pipelines(struct device_queue_manager *dqm,
unsigned int pipes_num, unsigned int first_pipe); unsigned int pipes_num, unsigned int first_pipe);
unsigned int get_first_pipe(struct device_queue_manager *dqm);
extern inline unsigned int get_sh_mem_bases_32(struct kfd_process_device *pdd) extern inline unsigned int get_sh_mem_bases_32(struct kfd_process_device *pdd)
{ {
......
...@@ -131,5 +131,5 @@ static int register_process_cik(struct device_queue_manager *dqm, ...@@ -131,5 +131,5 @@ static int register_process_cik(struct device_queue_manager *dqm,
static int initialize_cpsch_cik(struct device_queue_manager *dqm) static int initialize_cpsch_cik(struct device_queue_manager *dqm)
{ {
return init_pipelines(dqm, get_pipes_num(dqm), 0); return init_pipelines(dqm, get_pipes_num(dqm), get_first_pipe(dqm));
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment