From: Robin Murphy <robin.murphy@arm.com>
To: Sinan Kaya <okaya@codeaurora.org>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: alexander.deucher@amd.com, christian.koenig@amd.com
Subject: Re: [PATCH v2 2/3] drm/amdgpu: Allow dma_map_sg() coalescing
Date: Mon, 30 Apr 2018 14:00:20 +0100 [thread overview]
Message-ID: <dd4897fc-e19a-313b-3d5b-c6e54bd081dc@arm.com> (raw)
In-Reply-To: <438346cf-274f-3ff7-34e9-9ab1440fb26f@codeaurora.org>
On 27/04/18 20:42, Sinan Kaya wrote:
> On 4/27/2018 11:54 AM, Robin Murphy wrote:
>>
>>> ubuntu@ubuntu:~/amdgpu$_./vectoradd_hip.exe
>>> [ 834.002206] create_process:620
>>> [ 837.413021] Unable to handle kernel NULL pointer dereference at virtual address 00000018
>>
>> £5 says that's sg_dma_len(NULL), which implies either that something's gone horribly wrong with the scatterlist DMA mapping such that the lengths don't match, or much more likely that ttm.dma_address is NULL and I've missed the tiny subtlety below. Does that fix matters?
>
> Turned out to be a null pointer problem after sg_next(). The following helped.
Ugh, right, the whole thing's in the wrong place such that when addrs is
valid we can dereference junk on the way out of the loop (entirely
needlessly)... v3 coming up.
Robin.
>
> + if (addrs && (dma_len == 0)) {
> dma_sg = sg_next(dma_sg);
> - dma_len = sg_dma_len(dma_sg);
> - addr = sg_dma_address(dma_sg);
> + if (dma_sg) {
> + dma_len = sg_dma_len(dma_sg);
> + addr = sg_dma_address(dma_sg);
> + }
> }
>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-04-30 13:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 15:58 [PATCH v2 1/3] drm/prime: Iterate SG DMA addresses separately Robin Murphy
2018-04-17 15:58 ` [PATCH v2 2/3] drm/amdgpu: Allow dma_map_sg() coalescing Robin Murphy
[not found] ` <622c9ac3784170880dbde6900146e68631df958a.1523977133.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2018-04-17 21:13 ` Sinan Kaya
[not found] ` <59bb29d9-da0c-1542-88bf-71bed96f3ed2-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-04-25 20:44 ` Sinan Kaya
2018-04-27 15:54 ` Robin Murphy
2018-04-27 16:20 ` Sinan Kaya
2018-04-27 19:42 ` Sinan Kaya
2018-04-30 13:00 ` Robin Murphy [this message]
2018-04-17 15:58 ` [PATCH v2 3/3] drm/radeon: " Robin Murphy
2018-04-17 16:29 ` [PATCH v2 1/3] drm/prime: Iterate SG DMA addresses separately Christian König
2018-04-17 18:22 ` Robin Murphy
[not found] ` <73ac5c65-1dbd-8711-5770-75d79389bf44-5wv7dgnIgG8@public.gmane.org>
2018-04-17 18:25 ` Deucher, Alexander
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=dd4897fc-e19a-313b-3d5b-c6e54bd081dc@arm.com \
--to=robin.murphy@arm.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=okaya@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox