On Sat, Apr 01, 2017 at 10:43:46AM +0800, Flora Cui wrote: > > 3727 for (i = 0; i < adev->gfx.config.max_shader_engines; i++) { > > 3728 for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) { > > 3729 mask = 1; > > 3730 ao_bitmap = 0; > > 3731 counter = 0; > > 3732 gfx_v6_0_select_se_sh(adev, i, j, 0xffffffff); > > 3733 if (i < 4 && j < 2) > > > > If i == 4 > > > > 3734 gfx_v6_0_set_user_cu_inactive_bitmap( > > 3735 adev, disable_masks[i * 2 + j]); > > 3736 bitmap = gfx_v6_0_get_cu_enabled(adev); > > 3737 cu_info->bitmap[i][j] = bitmap; > > > > then we are beyond the end of this array. Also, why was this patch even > > applied when it has no commit message? It's totally not clear to me > > what the patch is trying to do or why it exists... > adev->gfx.config.max_shader_engines is set in gfx_v6_0_gpu_init() and > it must be < 4 so we'll never be beyond the end of the array. Could you remove the condition then? We should either check it always or not at all. We shouldn't check it half the time and assume it's correct the other half. regards, dan carpenter _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel