[PATCH] drm/i915/gvt: return error code if dma map iova failed
Zhenyu Wang
zhenyuw at linux.intel.com
Tue Feb 14 09:38:18 UTC 2017
On 2017.02.14 17:15:54 +0800, Chuanxiao Dong wrote:
> When doing dma map failed for a pfn, kvmgt should unpin the
> pfn and return error code to device module driver
>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong at intel.com>
> Cc: xinda.zhao at intel.com
> ---
applied, thanks!
> drivers/gpu/drm/i915/gvt/kvmgt.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index db2c965..0f7f5d9 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -1402,8 +1402,11 @@ static unsigned long kvmgt_gfn_to_pfn(unsigned long handle, unsigned long gfn)
> }
> /* transfer to host iova for GFX to use DMA */
> rc = gvt_dma_map_iova(info->vgpu, pfn, &iova);
> - if (rc)
> + if (rc) {
> gvt_err("gvt_dma_map_iova failed for gfn: 0x%lx\n", gfn);
> + vfio_unpin_pages(dev, &gfn, 1);
> + return INTEL_GVT_INVALID_ADDR;
> + }
>
> gvt_cache_add(info->vgpu, gfn, iova);
> return iova;
> --
> 2.7.4
>
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170214/39028b06/attachment.sig>
More information about the intel-gvt-dev
mailing list