Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2423169rwr; Sat, 6 May 2023 10:34:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YSpHHmKGzL38wXgISkOnnUQNvsK38F8cgruvhG51vCmuIDfoK+Vu0J2czcKh3w8/5MmI8 X-Received: by 2002:a17:902:d3c6:b0:1a9:7e44:17 with SMTP id w6-20020a170902d3c600b001a97e440017mr4534212plb.17.1683394456065; Sat, 06 May 2023 10:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683394456; cv=none; d=google.com; s=arc-20160816; b=lgW0fc7Becicp/PqaFCcdnIWcLhroKcP0Fit4sF93hlRftdPldDCpCL/xSeKrmq/zH jutCvT/XpUA4p1EKOMxHtbOjcyVX62n9Br22EWwVnQ054AH50jXi2xcP13lP8kl1gQOC o+u9GArucTeudqtCYDp9+OCZOJa48HVMCVAEeUHaSiWNoYF3E1fKMg3XdrlYEAhVHDEi 3WBzJK0SHUxn1Z4zYfD9j6APiqPsUOz9+lr0i59jhISrfxLXE5//wTS98HERG6S+7GhV ocSLbdh2fm8gIN91FdsGNgLBOvfUhN/MeRmFmukvA5QLDIGiA34bZL+jiSVLo8PEyyKj QXJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=FVlxfK3vFWYI8LD3VoVtUvMrMTf1h6eea1g6keWggg8=; b=ziZKly9S3vHlwJOPiE63eXyYKX9a08/vPsMQ7/HY3Sr7n8G4SPh/Mnfs6rkvcCl5+Y V6G5twUFxNxQQYhrbtXygpFtLw7ZjA/AV7WjOJxHVSO6a7YvoRlnaBwfe/M0SHSiyVOm u20blL4LsKnluGcb2xSCi7FjvqSQ/UvNvzMD5q/1APUE/ytiy00RIVBTg0A70KwgeeX3 2hluB67j/TyE1S7aY7vcIyo2iroRZTEzVXBxG13tqF48APXnv+Tm8/20MFqQMdp1SzD9 +a0uTncSfRos8CA3TxobuQ5OTE5dcOO8102ct6avSKCFO7LbYeLI0/bxLEyfMICX89xs m7mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ig/Zou6B"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c8-20020a170902848800b001a1deff6062si3951112plo.281.2023.05.06.10.33.59; Sat, 06 May 2023 10:34:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ig/Zou6B"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S229816AbjEFR17 (ORCPT + 99 others); Sat, 6 May 2023 13:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjEFR15 (ORCPT ); Sat, 6 May 2023 13:27:57 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68E0E160B4 for ; Sat, 6 May 2023 10:27:56 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f37a36b713so30261005e9.1 for ; Sat, 06 May 2023 10:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683394073; x=1685986073; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=FVlxfK3vFWYI8LD3VoVtUvMrMTf1h6eea1g6keWggg8=; b=Ig/Zou6BcNAblJ2ANEVxgOVxIXtHvMqyVNXQonmbHbO+1Zimv8q2GDL+pZZiHX4qQZ vN8rRfzQsg33ezgbuj1OCrFI6URrg2O22t5311bxXmz/qpALoB52f0mzVL7ITCfSUVt9 pF52hW6vxQ5DGXwPpmCsbv4jXhcgpu0gwaZlMFKPMMT6O2ItWEAg0HS3aMbifJvDtcIE srJgLa3ND1GQ3KMeLZCpf6hokZA8GhCUVt2/8X1GrcxvvTAhJPsjKaoraorSpm5TK22P fO/TJip/Z8519/tJ9d3pZQcWlheLdtVY0entZtE0G1hZW7ANJ9KfLnpXtRbOweRYaCX/ uBeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683394073; x=1685986073; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FVlxfK3vFWYI8LD3VoVtUvMrMTf1h6eea1g6keWggg8=; b=iaU0gFWVfV/ljFRksR/ob7lECHUfUSeuMotq7j9sqdbyPt4hdWVvwp2ueQrCnzQaAK xCkNrBnvNPfCEGmpPfipzOonDlVtpBLP1OgIHxeN8sB1vGosvFQWg06Pa9iNCz4qFmDa Byy9/Kex0WLrIGhYzukI+j5/8YbVRlmjbIjDT7egc8f/19NCBST6N0OMWjnNUL4pyVAp e26U1XJfZmvd4TCaa5VWHGp0+7npipbQnirTLQRQj2b/z8Fdw9R3omiuMJQwbyQOsGsi bsrlMQ5jQj5RPywNIkSLKWp+z0XKLxqei6QgVc7h0l4Ptdszqmp0cENz4ZB0R5DGsAad TY8g== X-Gm-Message-State: AC+VfDzrZ2i9xN0uwH3J7Q/YsmP7cZR/vrbXD9jjYJwkcjBoIBP0SN84 vACKhfFQgH7zSD6YSuO5vxETCQ== X-Received: by 2002:a7b:cb58:0:b0:3eb:39e0:3530 with SMTP id v24-20020a7bcb58000000b003eb39e03530mr3172709wmj.41.1683394073222; Sat, 06 May 2023 10:27:53 -0700 (PDT) Received: from [192.168.0.15] (cpc76484-cwma10-2-0-cust274.7-3.cable.virginm.net. [82.31.201.19]) by smtp.gmail.com with ESMTPSA id g8-20020adff3c8000000b003078354f774sm4245037wrp.36.2023.05.06.10.27.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 May 2023 10:27:52 -0700 (PDT) Message-ID: <6fd44dd0-db11-6592-6670-2364af6ffdc6@linaro.org> Date: Sat, 6 May 2023 18:27:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v2 1/2] misc: fastrpc: support complete DMA pool access to the DSP Content-Language: en-US To: Dylan Van Assche , Srinivas Kandagatla , Amol Maheshwari Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org References: <20230327184204.498032-1-me@dylanvanassche.be> <20230327184204.498032-2-me@dylanvanassche.be> From: Caleb Connolly In-Reply-To: <20230327184204.498032-2-me@dylanvanassche.be> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/03/2023 19:42, Dylan Van Assche wrote: > To support FastRPC Context Banks which aren't mapped via the SMMU, > make the whole reserved memory region available to the DSP to allow > access to coherent buffers. > > This is performed by assigning the memory to the DSP via a hypervisor > call to set the correct permissions for the Virtual Machines on the DSP. > This is only necessary when a memory region is provided for SLPI DSPs > so guard this with a domain ID check. > > Signed-off-by: Dylan Van Assche Hi Dylan! Personally pretty excited to LGTM. Please drop the noisy debug prints. With those fixed Reviewed-by: Caleb Connolly > --- > drivers/misc/fastrpc.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c > index f48466960f1b..caf2ae556956 100644 > --- a/drivers/misc/fastrpc.c > +++ b/drivers/misc/fastrpc.c > @@ -2231,6 +2231,8 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) > int i, err, domain_id = -1, vmcount; > const char *domain; > bool secure_dsp; > + struct device_node *rmem_node; > + struct reserved_mem *rmem; > unsigned int vmids[FASTRPC_MAX_VMIDS]; > > err = of_property_read_string(rdev->of_node, "label", &domain); > @@ -2274,6 +2276,20 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) > } > } > > + rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0); > + dev_info(rdev, "ASSIGNING MEMORY\n"); ^^ > + if (domain_id == SDSP_DOMAIN_ID && rmem_node) { > + rmem = of_reserved_mem_lookup(rmem_node); > + if (!rmem) > + return -EINVAL; > + > + dev_info(rdev, "ASSIGNING MEMORY START\n"); ^^ > + qcom_scm_assign_mem(rmem->base, rmem->size, &data->perms, > + data->vmperms, data->vmcount); > + > + dev_info(rdev, "ASSIGNING MEMORY END\n"); ^^ > + } > + > secure_dsp = !(of_property_read_bool(rdev->of_node, "qcom,non-secure-domain")); > data->secure = secure_dsp; > -- Kind Regards, Caleb (they/them)