From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Tom St Denis <tom.stdenis@amd.com>, amd-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] drm/ttm: Fix 'buf' pointer update in ttm_bo_vm_access_kmap() (v2)
Date: Mon, 29 Jan 2018 15:36:43 +0100 [thread overview]
Message-ID: <190b12bd-cd5c-7ef3-50f1-5e80dd428ba6@gmail.com> (raw)
In-Reply-To: <20180129143410.24323-1-tom.stdenis@amd.com>
Greg and other stable maintainers please ignore this one.
Tom just misunderstood, what to do with this patch.
Thanks,
Christian.
Am 29.01.2018 um 15:34 schrieb Tom St Denis:
> The buf pointer was not being incremented inside the loop
> meaning the same block of data would be read or written
> repeatedly.
>
> Fixes: 09ac4fcb3f25 ("drm/ttm: Implement vm_operations_struct.access v2")
>
> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> (v2) Change 'buf' pointer to uint8_t* type
> ---
> drivers/gpu/drm/ttm/ttm_bo_vm.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
> index 08a3c324242e..60fcef1593dd 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
> @@ -316,7 +316,7 @@ static void ttm_bo_vm_close(struct vm_area_struct *vma)
>
> static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo,
> unsigned long offset,
> - void *buf, int len, int write)
> + uint8_t *buf, int len, int write)
> {
> unsigned long page = offset >> PAGE_SHIFT;
> unsigned long bytes_left = len;
> @@ -345,6 +345,7 @@ static int ttm_bo_vm_access_kmap(struct ttm_buffer_object *bo,
> ttm_bo_kunmap(&map);
>
> page++;
> + buf += bytes;
> bytes_left -= bytes;
> offset = 0;
> } while (bytes_left);
prev parent reply other threads:[~2018-01-29 14:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-29 14:34 [PATCH] drm/ttm: Fix 'buf' pointer update in ttm_bo_vm_access_kmap() (v2) Tom St Denis
2018-01-29 14:36 ` Christian König [this message]
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=190b12bd-cd5c-7ef3-50f1-5e80dd428ba6@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=stable@vger.kernel.org \
--cc=tom.stdenis@amd.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).