From patchwork Fri Mar 6 01:51:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ung X-Patchwork-Id: 446982 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E7952140134 for ; Fri, 6 Mar 2015 12:50:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754564AbbCFBu3 (ORCPT ); Thu, 5 Mar 2015 20:50:29 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:15178 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754550AbbCFBu2 (ORCPT ); Thu, 5 Mar 2015 20:50:28 -0500 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Thu, 05 Mar 2015 17:50:23 -0800 Received: from hqemhub02.nvidia.com ([172.20.150.31]) by hqnvupgp07.nvidia.com (PGP Universal service); Thu, 05 Mar 2015 17:49:09 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 05 Mar 2015 17:49:09 -0800 Received: from dung-P9X79.nvidia.com (172.20.144.16) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.342.0; Thu, 5 Mar 2015 17:50:27 -0800 From: David Ung To: airlied@linux.ie CC: linux-tegra@vger.kernel.org, thierry.reding@gmail.com, swarren@wwwdotorg.org, amerilainen@nvidia.com, tbergstrom@nvidia.com, gnurou@gmail.com, David Ung Subject: [PATCH V2 1/3] gpu: host1x: Reduce host1x job allocation size Date: Thu, 5 Mar 2015 17:51:50 -0800 Message-ID: <1425606712-15986-1-git-send-email-davidu@nvidia.com> X-Mailer: git-send-email 1.8.1.5 MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org There is 2 set of num_relocs * sizeof(*) array at the end of host1x job. Only the 1st set is really used and with job->gather_addr_phys pointing somewhere within the 1st set of reloc physical addresses. This patch removes the 2nd set of unused addresses. Signed-off-by: David Ung --- drivers/gpu/host1x/job.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 63bd63f..9c11265 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -46,8 +46,9 @@ struct host1x_job *host1x_job_alloc(struct host1x_channel *ch, (u64)num_unpins * sizeof(struct host1x_job_unpin_data) + (u64)num_waitchks * sizeof(struct host1x_waitchk) + (u64)num_cmdbufs * sizeof(struct host1x_job_gather) + - (u64)num_unpins * sizeof(dma_addr_t) + - (u64)num_unpins * sizeof(u32 *); + (u64)num_relocs * sizeof(dma_addr_t) + + (u64)num_cmdbufs * sizeof(dma_addr_t); + if (total > ULONG_MAX) return NULL;