I don't know The patch is from me, I just think the patch is dropping a vm update which looks not perfect to me -----邮件原件----- 发件人: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> 代表 Nirmoy 发送时间: 2020年2月20日 23:21 收件人: amd-gfx@xxxxxxxxxxxxxxxxxxxxx 主题: Re: 回复: [PATCH] drm/amdgpu: fix a bug NULL pointer dereference Hi Monk, How can I reproduce this bug ? Regards, Nirmoy On 2/20/20 4:15 PM, Nirmoy wrote: > > On 2/20/20 2:35 PM, Liu, Monk wrote: >> Sorry, my previous idea still leave RQ null, please check if below >> method works: >> >> 29 static struct drm_sched_rq * >> 130 drm_sched_entity_get_free_sched(struct drm_sched_entity *entity) >> 131 { >> 132 struct drm_sched_rq *rq = NULL; >> 133 unsigned int min_jobs = UINT_MAX, num_jobs; >> 134 int i; >> >> 135 >> While (!mutex_trylock(....)) >> Sleep() > We can't do that drm_sched_entity_get_free_sched is in another > module(drm scheduler) independent of amdgpu >> 136 for (i = 0; i < entity->num_rq_list; ++i) { >> 137 struct drm_gpu_scheduler *sched = >> entity->rq_list[i]->sched; >> 138 >> 139 if (!entity->rq_list[i]->sched->ready) { //we take the >> gpu reset mutex lock, so now sched->ready won't be set to "not ready" >> 140 DRM_WARN("sched%s is not ready, skipping", >> sched->name); >> 141 continue; >> 142 } >> 143 >> 144 num_jobs = atomic_read(&sched->num_jobs); >> 145 if (num_jobs < min_jobs) { >> 146 min_jobs = num_jobs; >> 147 rq = entity->rq_list[i]; >> 148 } >> 149 } >> >> Mutex_unlock(...) >> >> 150 >> 151 return rq; >> 152 } >> > _______________________________________________ > amd-gfx mailing list > amd-gfx@xxxxxxxxxxxxxxxxxxxxx > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist > s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cmo > nk.liu%40amd.com%7C3635fc8baa4d4b90387108d7b6188069%7C3dd8961fe4884e60 > 8e11a82d994e183d%7C0%7C0%7C637178088661253651&sdata=Ki0SmulPESLIj7 > dGyT10Be0zXungK4U9fXONp45NjaA%3D&reserved=0 > _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cmonk.liu%40amd.com%7C3635fc8baa4d4b90387108d7b6188069%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637178088661253651&sdata=Ki0SmulPESLIj7dGyT10Be0zXungK4U9fXONp45NjaA%3D&reserved=0 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx