From patchwork Mon Oct 9 12:24:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 115205 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2494885qgn; Mon, 9 Oct 2017 05:25:25 -0700 (PDT) X-Received: by 10.84.234.198 with SMTP id i6mr2395968plt.410.1507551925771; Mon, 09 Oct 2017 05:25:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507551925; cv=none; d=google.com; s=arc-20160816; b=j54Dz2DqXatmFZLPECpWL09/1APmzdf5NbyJR2xoQBNKH1tUPSWbR/+DXZv4/gYVJ4 dtSfYRJM+W/5VFsPaQjynrwscwpI9qua93uB4HkFQS4QvZw+H++GsWBQaONbRFLAoDNk MmKQ/J+irYt2dRW41zUnEcXBRkGKJLjcwGowi4YGPvOhVIOvR3H5m4PJ5VKUV7XW84Oa K0qfyto29bQ6jFWPLUnv5saF+WckDYFKfufB5m5BqaSqVxISKiRsmj7OWxtS6/2x5crx LUKrg6TynDnbrFIWLQZxmmWVAjr5trLJZZKLGQNpBi9FQWeRzSvz73rZK/2SbtzOQGyO tSbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=TLVgaPzoq0zI1e0lFy9WCMUqVgthYSfbyQxDH2B1B8w=; b=EFC7agaWBQT8fUBgCPc2RBUET2hCsPFJJhOXRT3PSH9mLxMzpaNg3mdDdKDs7F+2mZ p+z3f09RsmahadHp10cAGKdLr5WlY3RenJ7IRi/xDshHJNLFSEwNKzxUYNt0jLQHZ/Lb Xn+9VaEu4I6h5P6hEWGi1tF9hrb/bQP3g7/8yFi9N51keB0k9QrJm3FTq7Lac6wvEeBR 2d4dm46LIeeo2knn8fhLpyQVqIJ7bz5x+cJtzJg3MQqv+uwevzSBN47hto1pzHWME9TD USbzjAo0YuWdo7WQwSvyeuS6SJ/G+8WsT7dbtHPc9DsOnqKu02S8g+Inv2nLhkF1Hm5h EaYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRtn1A9G; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si6908060plk.413.2017.10.09.05.25.25; Mon, 09 Oct 2017 05:25:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRtn1A9G; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754085AbdJIMZY (ORCPT + 4 others); Mon, 9 Oct 2017 08:25:24 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:47470 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751257AbdJIMZX (ORCPT ); Mon, 9 Oct 2017 08:25:23 -0400 Received: by mail-wm0-f41.google.com with SMTP id t69so22007390wmt.2 for ; Mon, 09 Oct 2017 05:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=TLVgaPzoq0zI1e0lFy9WCMUqVgthYSfbyQxDH2B1B8w=; b=FRtn1A9GHRgDuxl75pXxXTQggglWYo+paVkriNycw2EoD0AzfYuG5Hz3RsJA+7Ijux kZ/PYx91Ker+Sey8gn5SDyewqP0FVG9TCT3DhAb2SgVE2RhrS1LJbILxZUTMVxMZaLg8 6JYGe8J4QtBLD2apjjfSF9uWrTrmGLPuW8nC8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TLVgaPzoq0zI1e0lFy9WCMUqVgthYSfbyQxDH2B1B8w=; b=B0pHM2czyeK3eWQ4WdG3vR0yfJfkt/SVtnJGhj7bTQ3qPcMFzLjIjUrjWoz0UfACGD yN3Tykx/8HUZsKVpkAgXZ/R5KUlNSyjCevuYey71bbOrHFa79hbmGYIyNe6Em8yH60wc PQb6gP88LvSkyMs7FNEYrJND/wzrvGMkbIzP/29I9Bkw1Q4jTvBTGLZmA61rDs1AdMcm WNs2687OF4gi7+/DwtkV9o1R8uVjctwcKewvCSFS5lyaY42evF8zzK8stV2aT1KngWAU PDA1P9Np5dG0lD14Ze709mU/C73K/AAkM9EPC2H2Fr+e+wrKUfaOEezfzArhNMe8/Ym+ 4GKQ== X-Gm-Message-State: AMCzsaWzjA0l+utqU46Iz8UQ3eRFzfIil3TUaFkxfpuMOyq3GKesoPQY BQ4QqtUmujCP2PppdYhKJPpMqg== X-Google-Smtp-Source: AOwi7QD1B1V7aK4z3DvjniDtDedk142f2X6Cc1bBeGVQp3KDwhNHLWZajDBmF/7D38Tv/VR8ZMldUQ== X-Received: by 10.223.176.199 with SMTP id j7mr10161207wra.58.1507551922123; Mon, 09 Oct 2017 05:25:22 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id q188sm6679034wmb.43.2017.10.09.05.25.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 05:25:21 -0700 (PDT) From: Stanimir Varbanov To: Hans Verkuil Cc: Nicolas Dufresne , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH 1/2] media: venus: fix wrong size on dma_free Date: Mon, 9 Oct 2017 15:24:57 +0300 Message-Id: <20171009122458.3053-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This change will fix an issue with dma_free size found with DMA API debug enabled. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) -- 2.11.0 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 1caae8feaa36..734ce11b0ed0 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -344,7 +344,7 @@ static int venus_alloc(struct venus_hfi_device *hdev, struct mem_desc *desc, desc->attrs = DMA_ATTR_WRITE_COMBINE; desc->size = ALIGN(size, SZ_4K); - desc->kva = dma_alloc_attrs(dev, size, &desc->da, GFP_KERNEL, + desc->kva = dma_alloc_attrs(dev, desc->size, &desc->da, GFP_KERNEL, desc->attrs); if (!desc->kva) return -ENOMEM; @@ -710,10 +710,8 @@ static int venus_interface_queues_init(struct venus_hfi_device *hdev) if (ret) return ret; - hdev->ifaceq_table.kva = desc.kva; - hdev->ifaceq_table.da = desc.da; - hdev->ifaceq_table.size = IFACEQ_TABLE_SIZE; - offset = hdev->ifaceq_table.size; + hdev->ifaceq_table = desc; + offset = IFACEQ_TABLE_SIZE; for (i = 0; i < IFACEQ_NUM; i++) { queue = &hdev->queues[i]; @@ -755,9 +753,7 @@ static int venus_interface_queues_init(struct venus_hfi_device *hdev) if (ret) { hdev->sfr.da = 0; } else { - hdev->sfr.da = desc.da; - hdev->sfr.kva = desc.kva; - hdev->sfr.size = ALIGNED_SFR_SIZE; + hdev->sfr = desc; sfr = hdev->sfr.kva; sfr->buf_size = ALIGNED_SFR_SIZE; }