From: Fei Yang Date: Tue, 16 Jan 2024 22:37:09 +0000 (-0800) Subject: drm/xe: correct the calculation of remaining size X-Git-Tag: v6.9-rc1~126^2~16^2~108 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43d48379c9399654059bd2af5898fc464641837c;p=thirdparty%2Fkernel%2Flinux.git drm/xe: correct the calculation of remaining size In function write_pgtable, the calculation of chunk in the do-while loop is wrong, we should always compare against remaining size instead of the total size update->qwords. Signed-off-by: Fei Yang Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20240116223709.652585-2-fei.yang@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index 44725f978f3e1..d5392cbbdb491 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -1116,7 +1116,7 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs, do { u64 addr = ppgtt_ofs + ofs * 8; - chunk = min(update->qwords, MAX_PTE_PER_SDI); + chunk = min(size, MAX_PTE_PER_SDI); /* Ensure populatefn can do memset64 by aligning bb->cs */ if (!(bb->len & 1))