From patchwork Wed Mar 29 03:07:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 9650853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0EFEC60349 for ; Wed, 29 Mar 2017 03:06:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0707828338 for ; Wed, 29 Mar 2017 03:06:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED4202837F; Wed, 29 Mar 2017 03:06:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6663628338 for ; Wed, 29 Mar 2017 03:06:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AFA1589265; Wed, 29 Mar 2017 03:06:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F80D89262; Wed, 29 Mar 2017 03:06:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490756775; x=1522292775; h=from:to:cc:subject:date:message-id; bh=QJnfSKtvHg0sqS49QvjqgyeKsOuQoia9+wcyFQ5/NDk=; b=rsnxbuGzE3rY+ZasO1JZCRh2v24RTa2U8ki7M14omWSlhOK+xVf0Wc5f qDrCVQT2Xh35eE86uO+Dk0qST8L5Dg==; Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2017 20:06:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,239,1486454400"; d="scan'208,223";a="839521111" Received: from debian-skl.sh.intel.com ([10.239.13.114]) by FMSMGA003.fm.intel.com with ESMTP; 28 Mar 2017 20:06:13 -0700 From: Zhenyu Wang To: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org Date: Wed, 29 Mar 2017 11:07:53 +0800 Message-Id: <20170329030753.10324-1-zhenyuw@linux.intel.com> X-Mailer: git-send-email 2.11.0 Cc: Dave Airlie Subject: [Intel-gfx] [PATCH] drm/i915/gvt: fix error return check for copy_gma_to_hva() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From commit 73dec95e6ba3 ("drm/i915: Emit to ringbuffer directly"), copy_gma_to_hva() now returns copied data length instead of 0, so need to change error return check for that. Note: Looks this is caused by backmerge conflict resolving, so 4.11-rc4 is not impacted as commit 73dec95e6ba3 ("drm/i915: Emit to ringbuffer directly") is not in 4.11. But need to fix this before I can apply 4.12 stuff against drm-intel-next correctly. Fixes: e5c1ff14757a ("Backmerge tag 'v4.11-rc4' into drm-next") Cc: Dave Airlie Cc: Tina Zhang Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/gvt/cmd_parser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index b3c9a478c656..6f972afbdbc3 100644 --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c @@ -1673,7 +1673,7 @@ static int perform_bb_shadow(struct parser_exec_state *s) ret = copy_gma_to_hva(s->vgpu, s->vgpu->gtt.ggtt_mm, gma, gma + bb_size, dst); - if (ret) { + if (ret < 0) { gvt_vgpu_err("fail to copy guest ring buffer\n"); goto unmap_src; } @@ -2666,7 +2666,7 @@ static int shadow_workload_ring_buffer(struct intel_vgpu_workload *workload) if (gma_head > gma_tail) { ret = copy_gma_to_hva(vgpu, vgpu->gtt.ggtt_mm, gma_head, gma_top, cs); - if (ret) { + if (ret < 0) { gvt_vgpu_err("fail to copy guest ring buffer\n"); return ret; } @@ -2676,7 +2676,7 @@ static int shadow_workload_ring_buffer(struct intel_vgpu_workload *workload) /* copy head or start <-> tail */ ret = copy_gma_to_hva(vgpu, vgpu->gtt.ggtt_mm, gma_head, gma_tail, cs); - if (ret) { + if (ret < 0) { gvt_vgpu_err("fail to copy guest ring buffer\n"); return ret; } @@ -2737,7 +2737,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx) wa_ctx->workload->vgpu->gtt.ggtt_mm, guest_gma, guest_gma + ctx_size, map); - if (ret) { + if (ret < 0) { gvt_vgpu_err("fail to copy guest indirect ctx\n"); goto unmap_src; }