drm/amdkfd: Locking PM mutex while allocating IB buffer
Signed-off-by: Ben Goz <ben.goz@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
This commit is contained in:
		
							parent
							
								
									ccb76b149e
								
							
						
					
					
						commit
						bfdcbfd255
					
				| @ -94,12 +94,14 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm, | ||||
| 
 | ||||
| 	pm_calc_rlib_size(pm, rl_buffer_size, is_over_subscription); | ||||
| 
 | ||||
| 	mutex_lock(&pm->lock); | ||||
| 
 | ||||
| 	retval = kfd_gtt_sa_allocate(pm->dqm->dev, *rl_buffer_size, | ||||
| 					&pm->ib_buffer_obj); | ||||
| 
 | ||||
| 	if (retval) { | ||||
| 		pr_err("Failed to allocate runlist IB\n"); | ||||
| 		return retval; | ||||
| 		goto out; | ||||
| 	} | ||||
| 
 | ||||
| 	*(void **)rl_buffer = pm->ib_buffer_obj->cpu_ptr; | ||||
| @ -107,6 +109,9 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm, | ||||
| 
 | ||||
| 	memset(*rl_buffer, 0, *rl_buffer_size); | ||||
| 	pm->allocated = true; | ||||
| 
 | ||||
| out: | ||||
| 	mutex_unlock(&pm->lock); | ||||
| 	return retval; | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user