From: Ramalingam C Date: Tue, 5 Apr 2022 15:08:35 +0000 (+0530) Subject: drm/i915/gt: Pass the -EINVAL when emit_pte doesn't update any PTE X-Git-Tag: v6.6.17~3937^2~16^2~912 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=310bf25df2fcccc1d91f96928adb66bdc26613b5;p=platform%2Fkernel%2Flinux-rpi.git drm/i915/gt: Pass the -EINVAL when emit_pte doesn't update any PTE When emit_pte doesn't update any PTE with return value as 0, interpret it as -EINVAL. v2: Add missing goto [Thomas] Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20220405150840.29351-5-ramalingam.c@intel.com --- diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c index e0f1c72..6378d44 100644 --- a/drivers/gpu/drm/i915/gt/intel_migrate.c +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c @@ -577,7 +577,11 @@ intel_context_migrate_copy(struct intel_context *ce, len = emit_pte(rq, &it_src, src_cache_level, src_is_lmem, src_offset, CHUNK_SZ); - if (len <= 0) { + if (!len) { + err = -EINVAL; + goto out_rq; + } + if (len < 0) { err = len; goto out_rq; }