From patchwork Thu Feb 8 12:21:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 127663 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1430977ljc; Thu, 8 Feb 2018 04:22:03 -0800 (PST) X-Google-Smtp-Source: AH8x224Be79GyW3CGy0BAQtUirrHma9K2srCtaVy7qN7p+NoNIhBDJ3+xXqIzZ27hzjytm3g1O2E X-Received: by 2002:a17:902:bd4b:: with SMTP id b11-v6mr476031plx.313.1518092522871; Thu, 08 Feb 2018 04:22:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518092522; cv=none; d=google.com; s=arc-20160816; b=AL1Bifj37GgDWG33ggd63SIAH16dmafbao9SrRhekR5Tke5+uoE+YzAjhhGo0VBWhY rHqMkYOyEqIvTC411zuhfr6fHhd7xocNOenq3mT54OGtqCoTmCvIVYVq4gMM+119kX5U kzcpecDkjOGG9cTumR/DfvGw47hnKmN9dDGVwu3x4C6iIrz8ciLRFGCzjVb+qi5ujvI2 B2x3VbiESrhRZJSp/hpUwq4FB0awBR/xXJ/SpiaJ8U9h871LdnGRaKFm92YWgShE7c4z 9wf23YeRa/vYh8uYY7K9etsLw9Z/KUfMtkljJq6/sKYwOcRcrYcvqJhBFGzVu2DliM/v d70A== 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=krOWNm6NUG998Jk1Rwvc7aCODG6B0Ec89NOqNItVeOE=; b=gIwU6eFF0XFaM6VNaaLZllGnosyuWenSPqOJDoY8y0tphx87daD7gGZrWs6b3GySCP ApgxML2ycIgN3aUit78Olh9j2TTb4I/McFmH/6FR9r+JL8QKVNSBaJ22XYdOqpFLHZqH BIiAVG5S6BNW7Gw9X1NK+2BsqhlXm+8bMp1CCtcChE7Wwj85mhpayYEI0ezvHRUhTGWd KcR9ISOW0TrS7qz2n9aBeMIfFh2JEsrRcOm9BeTh5UXTSACyqhn4IBM2ajgk0Q952Zss Sx4K1wjKzlBi9SVJ+EZgzZxjyopBqJFgV+hfYURueoIsjTfkg+2c/2zUeOYvSApPOyAP cJ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=J4yVHZKM; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 k21si2754183pfb.43.2018.02.08.04.22.02; Thu, 08 Feb 2018 04:22:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=J4yVHZKM; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751153AbeBHMWB (ORCPT + 10 others); Thu, 8 Feb 2018 07:22:01 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55118 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbeBHMWA (ORCPT ); Thu, 8 Feb 2018 07:22:00 -0500 Received: by mail-wm0-f65.google.com with SMTP id i186so9113437wmi.4 for ; Thu, 08 Feb 2018 04:21:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Tk+FSPIH72U9N3jJLa6aQ/m9SzpVZF/1P42RxZTz5SM=; b=J4yVHZKMLr6QV46vZdYsCZdyRIZw1VMcdjLmqd71mG4lUj9KIBVNAy21WRDJD574Kv 9pXAqkaJlgPtHEAkMn/mSe0Yq2GvaYlqWeshN9mXwOG3plRG5FQtNCyZt1sSlvu9Ne56 3JTenOMK+A/Fylu9FCNHWCTsyf74ZC3Sav0ps= 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=Tk+FSPIH72U9N3jJLa6aQ/m9SzpVZF/1P42RxZTz5SM=; b=dg2hzrNc1Z96drQf153hY0n0b0vPfgZz+Tmk2UDfnlrG4HY6P9t7uktq1B8C5ZHjf0 tJXJutnyg28yEcp7GDiES2noRtgC1xitvtyc2gVDmYFSuz8aHWyHaQaSYaztUEh/2w+c yfvWPxzPqBcwmEcc2+KGH03MH0TToBqz02yILjW+wPHBvII8qyxr+usEQWcaSSDgvwuv a54o1vie+ENUVZxQ4V/Ncpz2bqeGvO+zE8R7Wi8Sxj+uKxiyI9VJyRD8kA2MJBNRbnT0 G26xdPmCZAjiCN1Np9EQpb1CBP+Pox68nt1aCqbA8ER6CoIELxOFCcG1HrgzKpcukV1Y JAtg== X-Gm-Message-State: APf1xPBOByNJMEx2idU4E+TIgsGMEMMfLxIfiL2kAvJWVq057dJUUVKT MB2V564K9T0JTlT6cMdXhlpb2w== X-Received: by 10.28.141.144 with SMTP id p138mr972684wmd.58.1518092519075; Thu, 08 Feb 2018 04:21:59 -0800 (PST) Received: from lmecxl0911.lme.st.com ([80.214.64.213]) by smtp.gmail.com with ESMTPSA id v5sm145586wmb.19.2018.02.08.04.21.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Feb 2018 04:21:58 -0800 (PST) From: Benjamin Gaignard To: andy.gross@linaro.org, david.brown@linaro.org, bjorn.andersson@linaro.org, arnd@arndb.de Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.or, arnaud.pouliquen@st.com, Benjamin Gaignard Subject: [PATCH] firmware: qcom_scm: use correct parameter type for dma_alloc_coherent Date: Thu, 8 Feb 2018 13:21:46 +0100 Message-Id: <20180208122146.28399-1-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dma_alloc_coherent expects it third argument type to be dma_addr_t and not phys_addr_t. When phys_addr_t is defined as u32 and dma_addr_t as u64 that generate a compilation issue. Change the variable name because dma_alloc_coherent returns a bus address not a physical address. Signed-off-by: Benjamin Gaignard --- drivers/firmware/qcom_scm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index af4c75217ea6..a405a540c464 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -448,7 +448,7 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, struct qcom_scm_mem_map_info *mem_to_map; phys_addr_t mem_to_map_phys; phys_addr_t dest_phys; - phys_addr_t ptr_phys; + dma_addr_t handle; size_t mem_to_map_sz; size_t dest_sz; size_t src_sz; @@ -466,7 +466,7 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, ptr_sz = ALIGN(src_sz, SZ_64) + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(dest_sz, SZ_64); - ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &ptr_phys, GFP_KERNEL); + ptr = dma_alloc_coherent(__scm->dev, ptr_sz, &handle, GFP_KERNEL); if (!ptr) return -ENOMEM; @@ -480,14 +480,14 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, /* Fill details of mem buff to map */ mem_to_map = ptr + ALIGN(src_sz, SZ_64); - mem_to_map_phys = ptr_phys + ALIGN(src_sz, SZ_64); + mem_to_map_phys = handle + ALIGN(src_sz, SZ_64); mem_to_map[0].mem_addr = cpu_to_le64(mem_addr); mem_to_map[0].mem_size = cpu_to_le64(mem_sz); next_vm = 0; /* Fill details of next vmid detail */ destvm = ptr + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64); - dest_phys = ptr_phys + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64); + dest_phys = handle + ALIGN(mem_to_map_sz, SZ_64) + ALIGN(src_sz, SZ_64); for (i = 0; i < dest_cnt; i++) { destvm[i].vmid = cpu_to_le32(newvm[i].vmid); destvm[i].perm = cpu_to_le32(newvm[i].perm); @@ -497,8 +497,8 @@ int qcom_scm_assign_mem(phys_addr_t mem_addr, size_t mem_sz, } ret = __qcom_scm_assign_mem(__scm->dev, mem_to_map_phys, mem_to_map_sz, - ptr_phys, src_sz, dest_phys, dest_sz); - dma_free_coherent(__scm->dev, ALIGN(ptr_sz, SZ_64), ptr, ptr_phys); + handle, src_sz, dest_phys, dest_sz); + dma_free_coherent(__scm->dev, ALIGN(ptr_sz, SZ_64), ptr, handle); if (ret) { dev_err(__scm->dev, "Assign memory protection call failed %d.\n", ret);