[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181106165242.GA27851@jcrouse-lnx.qualcomm.com>
Date: Tue, 6 Nov 2018 09:52:42 -0700
From: Jordan Crouse <jcrouse@...eaurora.org>
To: Sharat Masetty <smasetty@...eaurora.org>
Cc: freedreno@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-arm-msm@...r.kernel.org, chris@...is-wilson.co.uk,
robdclark@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] drm/msm: use kvmalloc for ring data in gpu crashstate
On Tue, Nov 06, 2018 at 11:40:04AM +0530, Sharat Masetty wrote:
> The ringbuffer data to capture at crashtime can end up being large
> sometimes, and the size can vary from being less than a page to the
> full size of 32KB. So use the kvmalloc variant that perfectly fits the bill.
>
> Signed-off-by: Sharat Masetty <smasetty@...eaurora.org>
Reviewed-by: Jordan Crouse <jcrouse@...eaurora.org>
> ---
> drivers/gpu/drm/msm/adreno/adreno_gpu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> index 141062f..c93702d 100644
> --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> @@ -406,7 +406,7 @@ int adreno_gpu_state_get(struct msm_gpu *gpu, struct msm_gpu_state *state)
> size = j + 1;
>
> if (size) {
> - state->ring[i].data = kmalloc(size << 2, GFP_KERNEL);
> + state->ring[i].data = kvmalloc(size << 2, GFP_KERNEL);
> if (state->ring[i].data) {
> memcpy(state->ring[i].data, gpu->rb[i]->start, size << 2);
> state->ring[i].data_size = size << 2;
> @@ -445,7 +445,7 @@ void adreno_gpu_state_destroy(struct msm_gpu_state *state)
> int i;
>
> for (i = 0; i < ARRAY_SIZE(state->ring); i++)
> - kfree(state->ring[i].data);
> + kvfree(state->ring[i].data);
>
> for (i = 0; state->bos && i < state->nr_bos; i++)
> kvfree(state->bos[i].data);
> --
> 1.9.1
>
--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Powered by blists - more mailing lists