From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/gvt: Annotate iomem usage
Date: Thu, 4 Apr 2019 15:42:50 +0800 [thread overview]
Message-ID: <20190404074250.GR2322@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <20190404071425.25847-1-chris@chris-wilson.co.uk>
[-- Attachment #1.1: Type: text/plain, Size: 2278 bytes --]
On 2019.04.04 08:14:25 +0100, Chris Wilson wrote:
> Fix the sparse warning for blithely using iomem with normal memcpy:
>
> drivers/gpu/drm/i915/gvt/kvmgt.c:916:21: warning: incorrect type in assignment (different address spaces)
> drivers/gpu/drm/i915/gvt/kvmgt.c:916:21: expected void *aperture_va
> drivers/gpu/drm/i915/gvt/kvmgt.c:916:21: got void [noderef] <asn:2> *
> drivers/gpu/drm/i915/gvt/kvmgt.c:927:26: warning: incorrect type in argument 1 (different address spaces)
> drivers/gpu/drm/i915/gvt/kvmgt.c:927:26: expected void [noderef] <asn:2> *vaddr
> drivers/gpu/drm/i915/gvt/kvmgt.c:927:26: got void *aperture_va
>
> Fixes: d480b28a41a6 ("drm/i915/gvt: Fix aperture read/write emulation when enable x-no-mmap=on")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Cc: Changbin Du <changbin.du@intel.com>
> Cc: Zhi Wang <zhi.a.wang@intel.com>
> ---
> drivers/gpu/drm/i915/gvt/kvmgt.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index d5fcc447d22f..a68addf95c23 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -905,7 +905,7 @@ static inline bool intel_vgpu_in_aperture(struct intel_vgpu *vgpu, u64 off)
> static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, u64 off,
> void *buf, unsigned long count, bool is_write)
> {
> - void *aperture_va;
> + void __iomem *aperture_va;
>
> if (!intel_vgpu_in_aperture(vgpu, off) ||
> !intel_vgpu_in_aperture(vgpu, off + count)) {
> @@ -920,9 +920,9 @@ static int intel_vgpu_aperture_rw(struct intel_vgpu *vgpu, u64 off,
> return -EIO;
>
> if (is_write)
> - memcpy(aperture_va + offset_in_page(off), buf, count);
> + memcpy_toio(aperture_va + offset_in_page(off), buf, count);
> else
> - memcpy(buf, aperture_va + offset_in_page(off), count);
> + memcpy_fromio(buf, aperture_va + offset_in_page(off), count);
>
> io_mapping_unmap(aperture_va);
>
> --
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
thanks!
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-04-04 7:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-04 7:14 [PATCH] drm/i915/gvt: Annotate iomem usage Chris Wilson
2019-04-04 7:42 ` Zhenyu Wang [this message]
2019-04-04 8:05 ` ✗ Fi.CI.BAT: failure for " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190404074250.GR2322@zhen-hp.sh.intel.com \
--to=zhenyuw@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.