From patchwork Mon May 4 17:58:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 11527337 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B76F915AB for ; Mon, 4 May 2020 18:15:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BD3924959 for ; Mon, 4 May 2020 18:15:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nKm/NU/E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730851AbgEDSP5 (ORCPT ); Mon, 4 May 2020 14:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730708AbgEDR7J (ORCPT ); Mon, 4 May 2020 13:59:09 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56924C061A41 for ; Mon, 4 May 2020 10:59:09 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id k81so463180qke.5 for ; Mon, 04 May 2020 10:59:09 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=hmchGPRatpHGz7FXodcq0SJqPYC5mC9nnx68TlaFw4w=; b=nKm/NU/E8zknhGFBOyhBDH4qXUn8D776cT5h6JHftF4GhhDK6x9ry2rz/3390vKj+L tN2liW5eIzpYXyOpEagl2/5lPJmBZ/VQImzT4IVSWB4A1XwFTg5LAMBg+Y79lMTvnRbz fqUzQGcouFhzr7nhC+k8ZJKatIpZACKQ5KsgukU8IdQ4ybdM5qw3Q2p8bw7XJfI58Ne8 d+GGbZTZ274frK+wfzNePMwxV38lK3jsUAI762x47ra+I05WuZNE7YyUGRj4Ej2dR8IG Zvj23kfA5xhRNdBa/Sm5jyZbT83OnNaTEKCCSmD7asI0QyaFyDOXBFhqBZG9KzBxltEi hTnA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hmchGPRatpHGz7FXodcq0SJqPYC5mC9nnx68TlaFw4w=; b=P3Ean+0IGeVNz2d5Di04OCQzHwLeJktrBgCYRPOa8l8/U498GtFDoQq+zlk8vZA3kC 92wnrwrXDp0nHlcJ5XJRco1IULu7I/BQi3P+/SBTqGyMcDZKXPqhbsXjjE1OOTRZ6J4p cyOQl5dQN7cQ/n8w+4LaMc/pCsz7KSBeCgN2h3ahVCKM0XWY+95+QkrhTWqFkMCgsphK phV1FCwkPF0fv5gnfiXPxv+c0crKXxVYna/j0VWaTUcW6tza+6N5PMGYk0K1J0BajxFB xHpjTNsjiPr7dpOfx2jFAEhxwMofVEou8Jn/hludgJDIlawHORlKR4lu2JdxRNk2ECCq 7THg== X-Gm-Message-State: AGi0PuZqPPGKWl8hQL07xp8d4P2gOI4nz57EfLLr8wdwJgrsifhDZZyZ SJ8un892y/O+Rwe/l80r3ow8jg== X-Google-Smtp-Source: APiQypKHzejQhJPuhrRIg5ZslvlTZGo4JtzrXdUU6lsW+xZU4Q0pY9zUQ7/oIZ0C/MMhJDrMkTTBcg== X-Received: by 2002:a05:620a:15c1:: with SMTP id o1mr387681qkm.187.1588615148533; Mon, 04 May 2020 10:59:08 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id h19sm11271088qtk.78.2020.05.04.10.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:59:08 -0700 (PDT) From: Alex Elder To: robh+dt@kernel.org, davem@davemloft.net Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, agross@kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 1/4] dt-bindings: net: add IPA iommus property Date: Mon, 4 May 2020 12:58:56 -0500 Message-Id: <20200504175859.22606-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504175859.22606-1-elder@linaro.org> References: <20200504175859.22606-1-elder@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The IPA accesses "IMEM" and main system memory through an SMMU, so its DT node requires an iommus property to define range of stream IDs it uses. Signed-off-by: Alex Elder Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/net/qcom,ipa.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/qcom,ipa.yaml b/Documentation/devicetree/bindings/net/qcom,ipa.yaml index 140f15245654..7b749fc04c32 100644 --- a/Documentation/devicetree/bindings/net/qcom,ipa.yaml +++ b/Documentation/devicetree/bindings/net/qcom,ipa.yaml @@ -20,7 +20,10 @@ description: The GSI is an integral part of the IPA, but it is logically isolated and has a distinct interrupt and a separately-defined address space. - See also soc/qcom/qcom,smp2p.txt and interconnect/interconnect.txt. + See also soc/qcom/qcom,smp2p.txt and interconnect/interconnect.txt. See + iommu/iommu.txt and iommu/arm,smmu.yaml for more information about SMMU + bindings. + - | -------- --------- @@ -54,6 +57,9 @@ properties: - const: ipa-shared - const: gsi + iommus: + maxItems: 1 + clocks: maxItems: 1 @@ -126,6 +132,7 @@ properties: required: - compatible + - iommus - reg - clocks - interrupts @@ -164,6 +171,7 @@ examples: modem-init; modem-remoteproc = <&mss_pil>; + iommus = <&apps_smmu 0x720 0x3>; reg = <0 0x1e40000 0 0x7000>, <0 0x1e47000 0 0x2000>, <0 0x1e04000 0 0x2c000>; From patchwork Mon May 4 17:58:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 11527335 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89F9C15AB for ; Mon, 4 May 2020 18:15:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 709282078C for ; Mon, 4 May 2020 18:15:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="OwZdX3Tx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732360AbgEDSPu (ORCPT ); Mon, 4 May 2020 14:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730534AbgEDR7M (ORCPT ); Mon, 4 May 2020 13:59:12 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2943BC03C1A6 for ; Mon, 4 May 2020 10:59:11 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id p13so74475qvt.12 for ; Mon, 04 May 2020 10:59:11 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=8gxTSUogDwuGLJulsmZ9RxF75CEfaqEdykWJgqsyHRs=; b=OwZdX3Txd5nO1MJ8o7w20jwhXHetRlVr8p7/VGHyslIBBaeEF7sceCz68NtQQ89+Cr lhXLQ5mfhmohwoD/EmcLUx/FSsIQx92OL9Q0kR759CbaR1Qu/MNxLsoFvCf1RVDU2sIh Ea41bkZzHr0bxJejmL2UG7CJbuQl1I8w6sC151Gp3UH6x/0eWdzf2KiRgq605Mhadk02 cuHz1I4exDdbSCnE3WaRqVfblXSi96CdvH6UQrWRvIWgpr5IO9R8RQkbdTn8tvISXF1p djDHF99CDnVRCzcLY4wCMkKi53ywORMqvsouKLbEo4YZtgnvx1iI2JJgczPDS7AAVQnv 4YAw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=8gxTSUogDwuGLJulsmZ9RxF75CEfaqEdykWJgqsyHRs=; b=r7cAfNuSWsSapFCMxpMGMhxfBeyMhvAkhmQ80VP7iyDfNNBmJ7+mzlH8N0az7HMFOl LLHF46G4MeTAzcOCPqbA4Xc5Am5QGTtJXVrk9oOyrE/6BMQ8Zdg3VNgF4qxmL4jGTE54 +TCrGC3drMpQilAar5EmSTduTpq1xNYU1yuLFwAM145fDGrtYxPu32QE80CKUiyca/Qv tjUdyUckYBvwP+mT99Fq6AYTnDW+05rdP9MhyheLUFtzqCnBldDUyRXqPNciE5parg3/ /5LUmYfa0YpRwYKSvAxKqbfJz6nvSSzMHGQ5hRQF0lGkRsS4/Z5giecifJ4+Z3GTGMhU Bx5w== X-Gm-Message-State: AGi0PuZwH0aQKqRtLSwyRYkfS9yqbmhKUw7EVKv5L3+v7T8jrH43EyZ0 9eWc/rGB7Hhrt/5f9OjMF2uGag== X-Google-Smtp-Source: APiQypJJlTfHZSWjQgiuQR2FVZJgBO7pVAzG4ZkwpIMBMU8ZxPIJg4YBiCxzNzaXyVvJ3r0OQfOy0g== X-Received: by 2002:ad4:5a06:: with SMTP id ei6mr329705qvb.70.1588615150228; Mon, 04 May 2020 10:59:10 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id h19sm11271088qtk.78.2020.05.04.10.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:59:09 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, agross@kernel.org, robh+dt@kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 2/4] net: ipa: redefine struct ipa_mem_data Date: Mon, 4 May 2020 12:58:57 -0500 Message-Id: <20200504175859.22606-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504175859.22606-1-elder@linaro.org> References: <20200504175859.22606-1-elder@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The ipa_mem_data structure type was never actually used. Instead, the IPA memory regions were defined using the ipa_mem structure. Redefine struct ipa_mem_data so it encapsulates the array of IPA-local memory region descriptors along with the count of entries in that array. Pass just an ipa_mem structure pointer to ipa_mem_init(). Rename the ipa_mem_data[] array ipa_mem_local_data[] to emphasize that the memory regions it defines are IPA-local memory. Signed-off-by: Alex Elder Reviewed-by: Bjorn Andersson --- drivers/net/ipa/ipa_data-sc7180.c | 10 +++++++--- drivers/net/ipa/ipa_data-sdm845.c | 10 +++++++--- drivers/net/ipa/ipa_data.h | 13 +++++-------- drivers/net/ipa/ipa_main.c | 2 +- drivers/net/ipa/ipa_mem.c | 9 +++++---- drivers/net/ipa/ipa_mem.h | 3 ++- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-sc7180.c index 042b5fc3c135..f97e7e4e61c1 100644 --- a/drivers/net/ipa/ipa_data-sc7180.c +++ b/drivers/net/ipa/ipa_data-sc7180.c @@ -193,7 +193,7 @@ static const struct ipa_resource_data ipa_resource_data = { }; /* IPA-resident memory region configuration for the SC7180 SoC. */ -static const struct ipa_mem ipa_mem_data[] = { +static const struct ipa_mem ipa_mem_local_data[] = { [IPA_MEM_UC_SHARED] = { .offset = 0x0000, .size = 0x0080, @@ -296,12 +296,16 @@ static const struct ipa_mem ipa_mem_data[] = { }, }; +static struct ipa_mem_data ipa_mem_data = { + .local_count = ARRAY_SIZE(ipa_mem_local_data), + .local = ipa_mem_local_data, +}; + /* Configuration data for the SC7180 SoC. */ const struct ipa_data ipa_data_sc7180 = { .version = IPA_VERSION_4_2, .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data), .endpoint_data = ipa_gsi_endpoint_data, .resource_data = &ipa_resource_data, - .mem_count = ARRAY_SIZE(ipa_mem_data), - .mem_data = ipa_mem_data, + .mem_data = &ipa_mem_data, }; diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c index 0d9c36e1e806..c55507e94559 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-sdm845.c @@ -235,7 +235,7 @@ static const struct ipa_resource_data ipa_resource_data = { }; /* IPA-resident memory region configuration for the SDM845 SoC. */ -static const struct ipa_mem ipa_mem_data[] = { +static const struct ipa_mem ipa_mem_local_data[] = { [IPA_MEM_UC_SHARED] = { .offset = 0x0000, .size = 0x0080, @@ -318,12 +318,16 @@ static const struct ipa_mem ipa_mem_data[] = { }, }; +static struct ipa_mem_data ipa_mem_data = { + .local_count = ARRAY_SIZE(ipa_mem_local_data), + .local = ipa_mem_local_data, +}; + /* Configuration data for the SDM845 SoC. */ const struct ipa_data ipa_data_sdm845 = { .version = IPA_VERSION_3_5_1, .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data), .endpoint_data = ipa_gsi_endpoint_data, .resource_data = &ipa_resource_data, - .mem_count = ARRAY_SIZE(ipa_mem_data), - .mem_data = ipa_mem_data, + .mem_data = &ipa_mem_data, }; diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 7110de2de817..51d8e5a6f23a 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -246,14 +246,12 @@ struct ipa_resource_data { /** * struct ipa_mem - IPA-local memory region description - * @offset: offset in IPA memory space to base of the region - * @size: size in bytes base of the region - * @canary_count: number of 32-bit "canary" values that precede region + * @local_count: number of regions defined in the local[] array + * @local: array of IPA-local memory region descriptors */ struct ipa_mem_data { - u32 offset; - u16 size; - u16 canary_count; + u32 local_count; + const struct ipa_mem *local; }; /** @@ -270,8 +268,7 @@ struct ipa_data { u32 endpoint_count; /* # entries in endpoint_data[] */ const struct ipa_gsi_endpoint_data *endpoint_data; const struct ipa_resource_data *resource_data; - u32 mem_count; /* # entries in mem_data[] */ - const struct ipa_mem *mem_data; + const struct ipa_mem_data *mem_data; }; extern const struct ipa_data ipa_data_sdm845; diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index 28998dcce3d2..9295a9122e8e 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -778,7 +778,7 @@ static int ipa_probe(struct platform_device *pdev) if (ret) goto err_kfree_ipa; - ret = ipa_mem_init(ipa, data->mem_count, data->mem_data); + ret = ipa_mem_init(ipa, data->mem_data); if (ret) goto err_reg_exit; diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c index 42d2c29d9f0c..fb4de2a12796 100644 --- a/drivers/net/ipa/ipa_mem.c +++ b/drivers/net/ipa/ipa_mem.c @@ -12,6 +12,7 @@ #include "ipa.h" #include "ipa_reg.h" +#include "ipa_data.h" #include "ipa_cmd.h" #include "ipa_mem.h" #include "ipa_data.h" @@ -266,15 +267,15 @@ int ipa_mem_zero_modem(struct ipa *ipa) } /* Perform memory region-related initialization */ -int ipa_mem_init(struct ipa *ipa, u32 count, const struct ipa_mem *mem) +int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) { struct device *dev = &ipa->pdev->dev; struct resource *res; int ret; - if (count > IPA_MEM_COUNT) { + if (mem_data->local_count > IPA_MEM_COUNT) { dev_err(dev, "to many memory regions (%u > %u)\n", - count, IPA_MEM_COUNT); + mem_data->local_count, IPA_MEM_COUNT); return -EINVAL; } @@ -302,7 +303,7 @@ int ipa_mem_init(struct ipa *ipa, u32 count, const struct ipa_mem *mem) ipa->mem_size = resource_size(res); /* The ipa->mem[] array is indexed by enum ipa_mem_id values */ - ipa->mem = mem; + ipa->mem = mem_data->local; return 0; } diff --git a/drivers/net/ipa/ipa_mem.h b/drivers/net/ipa/ipa_mem.h index 065cb499ebe5..f99180f84f0d 100644 --- a/drivers/net/ipa/ipa_mem.h +++ b/drivers/net/ipa/ipa_mem.h @@ -7,6 +7,7 @@ #define _IPA_MEM_H_ struct ipa; +struct ipa_mem_data; /** * DOC: IPA Local Memory @@ -84,7 +85,7 @@ void ipa_mem_teardown(struct ipa *ipa); int ipa_mem_zero_modem(struct ipa *ipa); -int ipa_mem_init(struct ipa *ipa, u32 count, const struct ipa_mem *mem); +int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data); void ipa_mem_exit(struct ipa *ipa); #endif /* _IPA_MEM_H_ */ From patchwork Mon May 4 17:58:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 11527333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7583E1668 for ; Mon, 4 May 2020 18:15:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58ACB24965 for ; Mon, 4 May 2020 18:15:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NVt8Dwh4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731507AbgEDSPo (ORCPT ); Mon, 4 May 2020 14:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730723AbgEDR7N (ORCPT ); Mon, 4 May 2020 13:59:13 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4F14C061A0F for ; Mon, 4 May 2020 10:59:12 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id ck5so78199qvb.11 for ; Mon, 04 May 2020 10:59:12 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=kIcOiZ/oPstJ19Kfdf6vLqJLoLSUMaJLmWxn/KilYeo=; b=NVt8Dwh4+CTyP1vo2RSASr1fPyWYfMxcIzj+ZPt5qqtg5YrS2p+IKWrWj42OcUyh+5 OzO1UvF03v5eU3rMG3Lpl7aJBApAulWfu0cozycioqpalvngqKk3NQ7wlTTXwmZfjTEV zLbsv3kUjst2El8qwm0HxHz0Gb15uuskdtfIQ3rtbgx8OYSZ8+ZPPsrXOlJKyVCFs3qH ue4WgIbWDEjUMtMVYkBdJ4qDcHUzE1APvKcUZenGeFa71p/zHB3pr2dYuoGsOk9MF/QB gL/LzWdnjgcA026ni4Tur2igitqX6bbHMR9yEc2hwI6tvgYzNhZJb4JHW8WmIihR3Qsu dZoQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=kIcOiZ/oPstJ19Kfdf6vLqJLoLSUMaJLmWxn/KilYeo=; b=RjLHeeP0RP+3rNKVMhSpDDGyaRJ1ShSTLZNtR0irOTXxPYgqkONTnjO9ZeCftjNZtY OqP9yXFiVqDn3+ouz8DWipYtj/00Ho0zIPJcmEnZidJO9mjxV6r5MNg48TH+8t5WTiiQ 4CO2Sck/Kpcrm6u8EV1XXj4d7NTsdcxvSoTV/q/V6TlN/hKIpCKy+IR71g4SgJ57Tt5Y MA5nIIkv6jb6ctecjjrxh1gxrD4QsmKMQuIrexYkgaWwU//1i3Cg/UMY5k5fM+TcGfCK pzp7U4qlKQe/hRaF1hXTevkZ+ZulrajjMv69OjUvPc1E09vsea82KzkpNo3NK6db+mO4 0vIQ== X-Gm-Message-State: AGi0PuaHwXEyo2FWwtqPSc0rIZsuzs/94umJSa9nzy+wI8tmS/0vh2zT WPb4o3pEL4nv8V4DAHZXYnIiyg== X-Google-Smtp-Source: APiQypKwlFzf3a5OW4qNpEvJrr8gPZ9dkd0M9EM8AjzM6n1GJsuVm8Mc14EGeBeLg0ARGw3GoPVGPg== X-Received: by 2002:a0c:da87:: with SMTP id z7mr269986qvj.141.1588615151983; Mon, 04 May 2020 10:59:11 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id h19sm11271088qtk.78.2020.05.04.10.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:59:11 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, agross@kernel.org, robh+dt@kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 3/4] net: ipa: define IMEM memory region for IPA Date: Mon, 4 May 2020 12:58:58 -0500 Message-Id: <20200504175859.22606-4-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504175859.22606-1-elder@linaro.org> References: <20200504175859.22606-1-elder@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Define a region of IMEM memory available for use by IPA in the platform configuration data. Initialize it from ipa_mem_init(). The memory must be mapped for access through an SMMU. Signed-off-by: Alex Elder Reviewed-by: Bjorn Andersson --- drivers/net/ipa/ipa.h | 5 ++ drivers/net/ipa/ipa_data-sc7180.c | 2 + drivers/net/ipa/ipa_data-sdm845.c | 2 + drivers/net/ipa/ipa_data.h | 6 ++- drivers/net/ipa/ipa_mem.c | 84 +++++++++++++++++++++++++++++++ 5 files changed, 98 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h index 23fb29889e5a..32f6dfafdb05 100644 --- a/drivers/net/ipa/ipa.h +++ b/drivers/net/ipa/ipa.h @@ -47,6 +47,8 @@ struct ipa_interrupt; * @mem_offset: Offset from @mem_virt used for access to IPA memory * @mem_size: Total size (bytes) of memory at @mem_virt * @mem: Array of IPA-local memory region descriptors + * @imem_iova: I/O virtual address of IPA region in IMEM + * @imem_size; Size of IMEM region * @zero_addr: DMA address of preallocated zero-filled memory * @zero_virt: Virtual address of preallocated zero-filled memory * @zero_size: Size (bytes) of preallocated zero-filled memory @@ -88,6 +90,9 @@ struct ipa { u32 mem_size; const struct ipa_mem *mem; + unsigned long imem_iova; + size_t imem_size; + dma_addr_t zero_addr; void *zero_virt; size_t zero_size; diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-sc7180.c index f97e7e4e61c1..e9007d151c68 100644 --- a/drivers/net/ipa/ipa_data-sc7180.c +++ b/drivers/net/ipa/ipa_data-sc7180.c @@ -299,6 +299,8 @@ static const struct ipa_mem ipa_mem_local_data[] = { static struct ipa_mem_data ipa_mem_data = { .local_count = ARRAY_SIZE(ipa_mem_local_data), .local = ipa_mem_local_data, + .imem_addr = 0x146a8000, + .imem_size = 0x00002000, }; /* Configuration data for the SC7180 SoC. */ diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c index c55507e94559..c0e207085550 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-sdm845.c @@ -321,6 +321,8 @@ static const struct ipa_mem ipa_mem_local_data[] = { static struct ipa_mem_data ipa_mem_data = { .local_count = ARRAY_SIZE(ipa_mem_local_data), .local = ipa_mem_local_data, + .imem_addr = 0x146bd000, + .imem_size = 0x00002000, }; /* Configuration data for the SDM845 SoC. */ diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 51d8e5a6f23a..69957af56ccd 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -245,13 +245,17 @@ struct ipa_resource_data { }; /** - * struct ipa_mem - IPA-local memory region description + * struct ipa_mem - description of IPA memory regions * @local_count: number of regions defined in the local[] array * @local: array of IPA-local memory region descriptors + * @imem_addr: physical address of IPA region within IMEM + * @imem_size: size in bytes of IPA IMEM region */ struct ipa_mem_data { u32 local_count; const struct ipa_mem *local; + u32 imem_addr; + u32 imem_size; }; /** diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c index fb4de2a12796..3c0916597fe1 100644 --- a/drivers/net/ipa/ipa_mem.c +++ b/drivers/net/ipa/ipa_mem.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "ipa.h" @@ -266,6 +267,79 @@ int ipa_mem_zero_modem(struct ipa *ipa) return 0; } +/** + * ipa_imem_init() - Initialize IMEM memory used by the IPA + * @ipa: IPA pointer + * @addr: Physical address of the IPA region in IMEM + * @size: Size (bytes) of the IPA region in IMEM + * + * IMEM is a block of shared memory separate from system DRAM, and + * a portion of this memory is available for the IPA to use. The + * modem accesses this memory directly, but the IPA accesses it + * via the IOMMU, using the AP's credentials. + * + * If this region exists (size > 0) we map it for read/write access + * through the IOMMU using the IPA device. + * + * Note: @addr and @size are not guaranteed to be page-aligned. + */ +static int ipa_imem_init(struct ipa *ipa, unsigned long addr, size_t size) +{ + struct device *dev = &ipa->pdev->dev; + struct iommu_domain *domain; + unsigned long iova; + phys_addr_t phys; + int ret; + + if (!size) + return 0; /* IMEM memory not used */ + + domain = iommu_get_domain_for_dev(dev); + if (!domain) { + dev_err(dev, "no IOMMU domain found for IMEM\n"); + return -EINVAL; + } + + /* Align the address down and the size up to page boundaries */ + phys = addr & PAGE_MASK; + size = PAGE_ALIGN(size + addr - phys); + iova = phys; /* We just want a direct mapping */ + + ret = iommu_map(domain, iova, phys, size, IOMMU_READ | IOMMU_WRITE); + if (ret) + return ret; + + ipa->imem_iova = iova; + ipa->imem_size = size; + + return 0; +} + +static void ipa_imem_exit(struct ipa *ipa) +{ + struct iommu_domain *domain; + struct device *dev; + + if (!ipa->imem_size) + return; + + dev = &ipa->pdev->dev; + domain = iommu_get_domain_for_dev(dev); + if (domain) { + size_t size; + + size = iommu_unmap(domain, ipa->imem_iova, ipa->imem_size); + if (size != ipa->imem_size) + dev_warn(dev, "unmapped %zu IMEM bytes, expected %lu\n", + size, ipa->imem_size); + } else { + dev_err(dev, "couldn't get IPA IOMMU domain for IMEM\n"); + } + + ipa->imem_size = 0; + ipa->imem_iova = 0; +} + /* Perform memory region-related initialization */ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) { @@ -305,11 +379,21 @@ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) /* The ipa->mem[] array is indexed by enum ipa_mem_id values */ ipa->mem = mem_data->local; + ret = ipa_imem_init(ipa, mem_data->imem_addr, mem_data->imem_size); + if (ret) + goto err_unmap; + return 0; + +err_unmap: + memunmap(ipa->mem_virt); + + return ret; } /* Inverse of ipa_mem_init() */ void ipa_mem_exit(struct ipa *ipa) { + ipa_imem_exit(ipa); memunmap(ipa->mem_virt); } From patchwork Mon May 4 17:58:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 11527331 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42E3E1668 for ; Mon, 4 May 2020 18:15:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 215BD2192A for ; Mon, 4 May 2020 18:15:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YZxhexqn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730651AbgEDSPk (ORCPT ); Mon, 4 May 2020 14:15:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730735AbgEDR7O (ORCPT ); Mon, 4 May 2020 13:59:14 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 939DEC03C1A7 for ; Mon, 4 May 2020 10:59:14 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id ep1so117170qvb.0 for ; Mon, 04 May 2020 10:59:14 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=+uxv+I2/FTJBYBAjECwblv3RDhMku6JWKomQ4Y91nmM=; b=YZxhexqnPFjsUEno3wMFzz4uVv+T4dxyAFeY8zRX7vCaz6sBXdDQUCmQ4q4+Zdr8Fs nJ+u+TO9wxbFzHeqT5YpvrhrM6gTVYVpq2+ew0kco14IskiOwmTxKMELMjjJrhMKaRCZ oTbnfu5g+N5cyKttHJ7A6OnutV1gpDOofKj+eS3sespsP96LK32wdd3O/24AHvsfQLHb S8/V4CCeqEY3hKAUn43D+ZozDTjNEXTbBeTa5e4Bo1e4PkS6rrc+1uRx+foinVGa8neg 19EW+9gD3O/wQ3ODKFRpodOzmDSOsYILowzUJ9XvRIoygeMH66g9JNnCKk7ZDAIgXvbg 1Y3g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=+uxv+I2/FTJBYBAjECwblv3RDhMku6JWKomQ4Y91nmM=; b=b/aBjqUoKSt5sOQYdkprRRiDBOGAE+nByhG99PfZ+Ff2kBGsAvyRuqn3Vj2fIf+Fj0 Fq6RFgNfZqf/uLoY79pR8Q86schizj2diDfTr2CgbgNWeIonSz2S7pFFLWgIsNotf1Sm cW2bTnxC5A+NOuCWSdAaIT0fLxZiJyorTlvAUBe//JA9b8gPJHrXPAGW9PMu4Mv7uNfu MiJoXCAaJfdEAU4hkvORy61ui+4+X1XKyKZpxLRzdGYxUZm0463ZNeEHjhnIyLefBkvP S5z/7kCS3xRXh8PtkNtR24IJeURvT//GvteoJO7/VwtqdxPu26HmS/IE9ceGPzNhKOSu gbCw== X-Gm-Message-State: AGi0PuYgSPOaxm7iujGm7XwrPnKUuIUi5J8sH1a6wRJUkWSd4dy/WUs8 FNKhLeaZgruDRD1RIdqRKnyTsw== X-Google-Smtp-Source: APiQypLuVrnV3ZDvw7O4IZoTWS+ToIcDG607sBfijdqyvv4NaLIkmIIsBRXBk4CLkgTxX/FaxrjefQ== X-Received: by 2002:a0c:ba17:: with SMTP id w23mr319531qvf.176.1588615153711; Mon, 04 May 2020 10:59:13 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id h19sm11271088qtk.78.2020.05.04.10.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 10:59:13 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, agross@kernel.org, robh+dt@kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 4/4] net: ipa: define SMEM memory region for IPA Date: Mon, 4 May 2020 12:58:59 -0500 Message-Id: <20200504175859.22606-5-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504175859.22606-1-elder@linaro.org> References: <20200504175859.22606-1-elder@linaro.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Arrange to use an item from SMEM memory for IPA. SMEM item number 497 is designated to be used by the IPA. Specify the item ID and size of the region in platform configuration data. Allocate and get a pointer to this region from ipa_mem_init(). The memory must be mapped for access through an SMMU. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa.h | 5 ++ drivers/net/ipa/ipa_data-sc7180.c | 2 + drivers/net/ipa/ipa_data-sdm845.c | 2 + drivers/net/ipa/ipa_data.h | 4 ++ drivers/net/ipa/ipa_mem.c | 116 ++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+) diff --git a/drivers/net/ipa/ipa.h b/drivers/net/ipa/ipa.h index 32f6dfafdb05..b10a85392952 100644 --- a/drivers/net/ipa/ipa.h +++ b/drivers/net/ipa/ipa.h @@ -49,6 +49,8 @@ struct ipa_interrupt; * @mem: Array of IPA-local memory region descriptors * @imem_iova: I/O virtual address of IPA region in IMEM * @imem_size; Size of IMEM region + * @smem_iova: I/O virtual address of IPA region in SMEM + * @smem_size; Size of SMEM region * @zero_addr: DMA address of preallocated zero-filled memory * @zero_virt: Virtual address of preallocated zero-filled memory * @zero_size: Size (bytes) of preallocated zero-filled memory @@ -93,6 +95,9 @@ struct ipa { unsigned long imem_iova; size_t imem_size; + unsigned long smem_iova; + size_t smem_size; + dma_addr_t zero_addr; void *zero_virt; size_t zero_size; diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-sc7180.c index e9007d151c68..43faa35ae726 100644 --- a/drivers/net/ipa/ipa_data-sc7180.c +++ b/drivers/net/ipa/ipa_data-sc7180.c @@ -301,6 +301,8 @@ static struct ipa_mem_data ipa_mem_data = { .local = ipa_mem_local_data, .imem_addr = 0x146a8000, .imem_size = 0x00002000, + .smem_id = 497, + .smem_size = 0x00002000, }; /* Configuration data for the SC7180 SoC. */ diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c index c0e207085550..f7ba85717edf 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-sdm845.c @@ -323,6 +323,8 @@ static struct ipa_mem_data ipa_mem_data = { .local = ipa_mem_local_data, .imem_addr = 0x146bd000, .imem_size = 0x00002000, + .smem_id = 497, + .smem_size = 0x00002000, }; /* Configuration data for the SDM845 SoC. */ diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index 69957af56ccd..16dfd74717b1 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -250,12 +250,16 @@ struct ipa_resource_data { * @local: array of IPA-local memory region descriptors * @imem_addr: physical address of IPA region within IMEM * @imem_size: size in bytes of IPA IMEM region + * @smem_id: item identifier for IPA region within SMEM memory + * @imem_size: size in bytes of the IPA SMEM region */ struct ipa_mem_data { u32 local_count; const struct ipa_mem *local; u32 imem_addr; u32 imem_size; + u32 smem_id; + u32 smem_size; }; /** diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c index 3c0916597fe1..aa8f6b0f3d50 100644 --- a/drivers/net/ipa/ipa_mem.c +++ b/drivers/net/ipa/ipa_mem.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "ipa.h" #include "ipa_reg.h" @@ -23,6 +24,9 @@ /* "Canary" value placed between memory regions to detect overflow */ #define IPA_MEM_CANARY_VAL cpu_to_le32(0xdeadbeef) +/* SMEM host id representing the modem. */ +#define QCOM_SMEM_HOST_MODEM 1 + /* Add an immediate command to a transaction that zeroes a memory region */ static void ipa_mem_zero_region_add(struct gsi_trans *trans, const struct ipa_mem *mem) @@ -340,6 +344,111 @@ static void ipa_imem_exit(struct ipa *ipa) ipa->imem_iova = 0; } +/** + * ipa_smem_init() - Initialize SMEM memory used by the IPA + * @ipa: IPA pointer + * @item: Item ID of SMEM memory + * @size: Size (bytes) of SMEM memory region + * + * SMEM is a managed block of shared DRAM, from which numbered "items" + * can be allocated. One item is designated for use by the IPA. + * + * The modem accesses SMEM memory directly, but the IPA accesses it + * via the IOMMU, using the AP's credentials. + * + * If size provided is non-zero, we allocate it and map it for + * access through the IOMMU. + * + * Note: @size and the item address are is not guaranteed to be page-aligned. + */ +static int ipa_smem_init(struct ipa *ipa, u32 item, size_t size) +{ + struct device *dev = &ipa->pdev->dev; + struct iommu_domain *domain; + unsigned long iova; + phys_addr_t phys; + phys_addr_t addr; + size_t actual; + void *virt; + int ret; + + if (!size) + return 0; /* SMEM memory not used */ + + /* SMEM is memory shared between the AP and another system entity + * (in this case, the modem). An allocation from SMEM is persistent + * until the AP reboots; there is no way to free an allocated SMEM + * region. Allocation only reserves the space; to use it you need + * to "get" a pointer it (this implies no reference counting). + * The item might have already been allocated, in which case we + * use it unless the size isn't what we expect. + */ + ret = qcom_smem_alloc(QCOM_SMEM_HOST_MODEM, item, size); + if (ret && ret != -EEXIST) { + dev_err(dev, "error %d allocating size %zu SMEM item %u\n", + ret, size, item); + return ret; + } + + /* Now get the address of the SMEM memory region */ + virt = qcom_smem_get(QCOM_SMEM_HOST_MODEM, item, &actual); + if (IS_ERR(virt)) { + ret = PTR_ERR(virt); + dev_err(dev, "error %d getting SMEM item %u\n", ret, item); + return ret; + } + + /* In case the region was already allocated, verify the size */ + if (ret && actual != size) { + dev_err(dev, "SMEM item %u has size %zu, expected %zu\n", + item, actual, size); + return -EINVAL; + } + + domain = iommu_get_domain_for_dev(dev); + if (!domain) { + dev_err(dev, "no IOMMU domain found for SMEM\n"); + return -EINVAL; + } + + /* Align the address down and the size up to a page boundary */ + addr = qcom_smem_virt_to_phys(virt) & PAGE_MASK; + phys = addr & PAGE_MASK; + size = PAGE_ALIGN(size + addr - phys); + iova = phys; /* We just want a direct mapping */ + + ret = iommu_map(domain, iova, phys, size, IOMMU_READ | IOMMU_WRITE); + if (ret) + return ret; + + ipa->smem_iova = iova; + ipa->smem_size = size; + + return 0; +} + +static void ipa_smem_exit(struct ipa *ipa) +{ + struct device *dev = &ipa->pdev->dev; + struct iommu_domain *domain; + + domain = iommu_get_domain_for_dev(dev); + if (domain) { + size_t size; + + size = iommu_unmap(domain, ipa->smem_iova, ipa->smem_size); + if (size != ipa->smem_size) + dev_warn(dev, "unmapped %zu SMEM bytes, expected %lu\n", + size, ipa->smem_size); + + } else { + dev_err(dev, "couldn't get IPA IOMMU domain for SMEM\n"); + } + + ipa->smem_size = 0; + ipa->smem_iova = 0; +} + /* Perform memory region-related initialization */ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) { @@ -383,8 +492,14 @@ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) if (ret) goto err_unmap; + ret = ipa_smem_init(ipa, mem_data->smem_id, mem_data->smem_size); + if (ret) + goto err_imem_exit; + return 0; +err_imem_exit: + ipa_imem_exit(ipa); err_unmap: memunmap(ipa->mem_virt); @@ -394,6 +509,7 @@ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) /* Inverse of ipa_mem_init() */ void ipa_mem_exit(struct ipa *ipa) { + ipa_smem_exit(ipa); ipa_imem_exit(ipa); memunmap(ipa->mem_virt); }