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: 9992833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 987BD60230 for ; Mon, 9 Oct 2017 12:25:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AC2228606 for ; Mon, 9 Oct 2017 12:25:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FAC8287BF; Mon, 9 Oct 2017 12:25:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12C1728606 for ; Mon, 9 Oct 2017 12:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754085AbdJIMZY (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; }