Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp16602lqp; Tue, 11 Jun 2024 12:58:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFwBPKcAJsDxFJmTdwuBp5oq2tuKogIyoVbgLsz0MF1tZgAQ+SZnx+bWDiMKOmkA4/+D3gn0ba8mzf5+o4luB2IdN053HoGPCxtqvWzQ== X-Google-Smtp-Source: AGHT+IFkUFmMU84J106LA2PPMELj/W7axhwLo+nbLvJOWzBtSw0XxicZpuL2MKYtCzq95/3qTBpC X-Received: by 2002:a05:6a20:3ca4:b0:1b6:5b3a:9a55 with SMTP id adf61e73a8af0-1b8a9b487ccmr3227637.14.1718135885287; Tue, 11 Jun 2024 12:58:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718135885; cv=pass; d=google.com; s=arc-20160816; b=BAUwOYvMCo+phhb9r9r/00xhp/cuB6BUffLXcoX5YzUwDCUrh12stWtV1zQdZ3jLs2 YLEgPPBwGJfEf7bjWIJvkV9XnzWO1dBhsd3/rGYcV0JOiIZfxoNCNrh/R+5MFUhqxOM4 cZ0+Sr74SCCfX2DSAM0s58y9/zymis8aImsItxuiyybCtZlFgvuewxGwKs0TRZFeojXH AHm1/3SE5+6W94RxdWoZU7tkO4/YKfA990G3XRb0+gq/4nIrlmTn0mJjeWFZ+jwvtCSW GhiRXLSV46RhpynlweCl1cQgiUhtWZze0aBmsIOJYrPtvjORzULeHPI9WleD4m7P2REl JU8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EEPghwR2XmpVCR3o/1blYpkcLH7773zRI7ZULoFlz0s=; fh=vn9KG2QLniPY90CxBF9PIwZhKSstxCLwL82qXvXfAwQ=; b=trCI5/Zb4F33eihGFq5HPxZifrXauRfrSp8OZvpiNENOeutIripMeVTCk7lggTlSrw xEfu0bRJnR0g9hjgTuzOrvd7mNF0IKdN7mhD7fTr6yomOmYDhrFxOPn/ZN2z28dmScu4 +rqqAAOevpoKC1M54pdu8jWmClrjctVrSGJZsVx74a1zS0U5i4YbvFnr/6L/vFg4T2zC M4QrM1oNsDUq2NPfvQKbFbXYXLO0bIXtVF8YK5g4lgF9eirtkTFC3/fmxbRLn/74Hsm8 MKJqTIieTK0bd+cEcK31O4v1Dhn3MjkB4Wi8ATbwMdY9YYnxRLryUZCILoqkTQjNI1WD 6sDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PxG1MlA+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-210546-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de2ae10e2bsi6000840a12.883.2024.06.11.12.58.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:58:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210546-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PxG1MlA+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-210546-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210546-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 845D128167A for ; Tue, 11 Jun 2024 19:57:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C47FE147C86; Tue, 11 Jun 2024 19:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PxG1MlA+" Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 331E382490 for ; Tue, 11 Jun 2024 19:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135813; cv=none; b=C60ONA6xpBNPtkaGG9GIvokuEfhPt0IgQzS7MvIl7AY2PmZzgvSElV9SfiFbeIIhMiuHuUj697quvdVjEUqpfXGVdiZR4TqVpJLYbnZ4c1d8OGN/p6MdsTHbhF6IWTf2IsKZRKMA6cMnY9O/b4um5wu+tUejpeKg/x+w0axlMf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135813; c=relaxed/simple; bh=f52ZfaDJyYfE45I/t8usiFuaWQE/tHK60yXBoddILOM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XRXsm24jJsPeLlvt6yntKktLLkdMUTRJ5mxohaF/2KMdbBd+4J6sXSleGvgJesFAIADkovIrlkU2bzP9Lp0/gyG4AdtOpzZEBlYO/w9z5ZDNpCqyknlJxpnXcAbU31MUtKyvvY5lIWut6J4j6oTyw+Qp8wgYjD8OQRAeuP8g+0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=PxG1MlA+; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2eaa89464a3so66026251fa.3 for ; Tue, 11 Jun 2024 12:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718135809; x=1718740609; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EEPghwR2XmpVCR3o/1blYpkcLH7773zRI7ZULoFlz0s=; b=PxG1MlA+qIMQ2WxfHlqOv20aeM7F5dXXlKw/cC8lS7S66c9psN7hNEcrZQ99hWWnUZ lFWQycq1NoarAHLiCyVw7iA5SRSNk7qfgMIIjnHsMKM+hiDnLt3OYkA6pkdia+lxZvJO y8KIRa7NPRy/tOUGbVHNasMT+ybir6qc26UAEJt5pIHxdVCLMm++SYuUMPwwS2J/CUGE D+bWVaZr4b0C/3Q+PjAl0weqnF6EfAAQjCfAGuDT1yg5nE4uqywdUPLAFjvHl8UqiCyV ULSbjc1EsciQlwzl4GGbZGqV8ncU9aTwPfu5MEYl3gKohVGSCHnTH1aA48hzFGbMMbsF bBqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718135809; x=1718740609; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EEPghwR2XmpVCR3o/1blYpkcLH7773zRI7ZULoFlz0s=; b=ddk+lLaa1ONi7PTvx0Zzz2aB2XpMEbHy6ZP/f2BvagIlxfNC9uPx8DOUx9+15Nu2sm Mwpcl8xQo19nb7QJOP6uN46QPs47hJxm1M/h6nnuGmOn7469wAiFHN9e2YZfHnUsG08E UNLoL2/U+YBBF0TWnaKrdapYw4r5Bp4B9pa1g9Vrq93H2xEkrhDXIqgAdMBqD2sT00Gl 7AaBEsgv3YvAO/WvNA5QKGblNY8/kx3iYghV34S1KZ9rd5Ex/IBMbE8Hqp/Oom3KiYsR g4hL3hEV/aBMivCYCOR/m+FcDDB6twIOGEdUrdW2qPwNsN28xl1WtwfP4pXQIKzmSLKp su3w== X-Forwarded-Encrypted: i=1; AJvYcCXxwLu5PATI4j/sK6HptMfI5c3nBbLQfgkzhx9osH9UlAtX3jt/GWYIjtHcfvaL0z2SCt+ZVhD+KZMhMXRcDF01vw2CSLHlzvD2in31 X-Gm-Message-State: AOJu0YzsfZflZw360EZfxbjW+H/qAaaGAEaevzg5R4/L/1/QQoBYl+Tk ggB6X49pVlef9lDIl4U4L9n2gxpO0Y7g9cHuoOUJJGPbvLApKHz3MgoEZKBYOKhiJYAka7aROEW 8 X-Received: by 2002:a2e:be04:0:b0:2eb:e365:f191 with SMTP id 38308e7fff4ca-2ebe365f2bamr53815041fa.15.1718135809150; Tue, 11 Jun 2024 12:56:49 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyybrhy-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::b8c]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ebdaeac43esm15379711fa.24.2024.06.11.12.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:56:48 -0700 (PDT) Date: Tue, 11 Jun 2024 22:56:47 +0300 From: Dmitry Baryshkov To: Dylan Van Assche Cc: Srinivas Kandagatla , Amol Maheshwari , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Connolly , phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [PATCH v5 1/2] misc: fastrpc: support complete DMA pool access to the DSP Message-ID: References: <20240524161423.15392-1-me@dylanvanassche.be> <20240524161423.15392-2-me@dylanvanassche.be> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240524161423.15392-2-me@dylanvanassche.be> On Fri, May 24, 2024 at 06:14:02PM +0200, 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 > Reviewed-by: Caleb Connolly > --- > drivers/misc/fastrpc.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c > index 4c67e2c5a82e..c06667b29055 100644 > --- a/drivers/misc/fastrpc.c > +++ b/drivers/misc/fastrpc.c > @@ -2255,6 +2255,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); > @@ -2297,6 +2299,23 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev) > } > } > > + rmem_node = of_parse_phandle(rdev->of_node, "memory-region", 0); > + if (domain_id == SDSP_DOMAIN_ID && rmem_node) { I think we can drop the domain_id check here. The rest looks good to me. Reviewed-by: Dmitry Baryshkov > + u64 src_perms; > + > + rmem = of_reserved_mem_lookup(rmem_node); > + if (!rmem) { > + err = -EINVAL; > + goto fdev_error; > + } > + > + src_perms = BIT(QCOM_SCM_VMID_HLOS); > + > + qcom_scm_assign_mem(rmem->base, rmem->size, &src_perms, > + data->vmperms, data->vmcount); > + > + } > + > secure_dsp = !(of_property_read_bool(rdev->of_node, "qcom,non-secure-domain")); > data->secure = secure_dsp; > > -- > 2.45.1 > -- With best wishes Dmitry