Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp675878lqb; Fri, 24 May 2024 09:43:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEwnL5Wb7BHtI+X07u45Du7ExQpO3+fdkQaYClh53ZtYppWweX8eEZEIHbE8x7dAgMRA0bu0C1lgYVbMo/JSwS+lk+JsKsL1IL7ddd6A== X-Google-Smtp-Source: AGHT+IFV92iY0ZWjSad9mxVpnCSsvo/gYP/jtN6njE0NG4APagdMriYDn4iwIhy3y1d2k+kfh+mG X-Received: by 2002:a05:6e02:1d83:b0:36c:4d7d:26bf with SMTP id e9e14a558f8ab-3737b26aea8mr34518445ab.1.1716569032372; Fri, 24 May 2024 09:43:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716569032; cv=pass; d=google.com; s=arc-20160816; b=b+7jbkdw3FDlYGRBKx3gHDfeRdf+uKNRJa+9rwPJpVO9lcyNVa/Pn/E+dyM7OWKZfl PQG9QtjU2wcl/P0eK0xI9bV+bhr5NSxXLGQjN9Q6m17i3R1YUGFyjZX6rWbqxWeDkqQd M37sYuhTWutw62QLTYNws0yuRUJL739sCww5pGeuFslBRyKM2LZqL00bMEIK7glQkO5Z N2MFFqGWgE0Q2Ce8Y035fCGnudxuG9Fg0dfVlKqOOEgaGEWfRIh76qAaa6tN2Oa9Oieo AhPfIdqoYI/5QXo4l8LsHkjvCILmdW6v652pSanJKcf5Nf2+m1qetZY7Nh1SNlihrt7d ikkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6fL1tq5YHxeAA+CRy4r/mRxLDFZ+WeZfw73SYF9S1o8=; fh=mtXBjmywHSrwwqTwrs2PRZxISbTB/CbndFHA9O6afMs=; b=SSTtJR6Bx+jwJMXEiTQ/rSTdZgrH1Izalp6MlgJDuEZCslWYrCEyoGeM3epZuNQv48 M35RHKW44IyCv15j6hx4z5qrMAm6/PNHjaJ+TkoYOB6Af8UPdR6z/o6J5AHqN4lTs5Cj nN5HoZCPZTDx7+ZrZYLnqUp/Qb8oKNLVhYryuFzg34thxFPa8b5wIhMBwYN9nopIW7a5 V66pwRWUfPbqi3w1nm6LfWXzBHeEKExWt6yMdDvwe+Qjciwwqnp0aCp2nhH8rf6G6dkv jDjh9hj1dZ78tCrQ+oOos/oHTJ+9PicvaF6iyXQj+YKgmj21stBYsNR2IQlK1gZPphW/ EIIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=default2306 header.b="fIeNgb5/"; arc=pass (i=1 spf=pass spfdomain=dylanvanassche.be dkim=pass dkdomain=dylanvanassche.be dmarc=pass fromdomain=dylanvanassche.be); spf=pass (google.com: domain of linux-kernel+bounces-188940-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=dylanvanassche.be Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-68221b73f7bsi1526029a12.37.2024.05.24.09.43.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 09:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188940-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=default2306 header.b="fIeNgb5/"; arc=pass (i=1 spf=pass spfdomain=dylanvanassche.be dkim=pass dkdomain=dylanvanassche.be dmarc=pass fromdomain=dylanvanassche.be); spf=pass (google.com: domain of linux-kernel+bounces-188940-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=dylanvanassche.be 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DC612B2177A for ; Fri, 24 May 2024 16:43:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08161130484; Fri, 24 May 2024 16:43:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dylanvanassche.be header.i=@dylanvanassche.be header.b="fIeNgb5/" Received: from www316.your-server.de (www316.your-server.de [88.198.220.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C660312F59D; Fri, 24 May 2024 16:43:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=88.198.220.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716568986; cv=none; b=oSycB8rmEkZY7TOIXQNlZjU20SqLF0PPOyU6UcXJGwUzKoN9VT36uY88WnyTQNj6mNNIWoA1++qr2qJbKKvHTplmMSHqOcksdmk9fSGJ5XQxgXGVu1OS6axi36c2gY9GaFqumBPR5N/OzWDLTqY7IoY8/MUp6xy7dpssw/l1ZQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716568986; c=relaxed/simple; bh=kBGVY6CpHhaXJmaLY3ecr1SySiFvAY8aX82+3SK0Oig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aJClvQNB9485ziE3cRrzMqfntaoYiBv9phE2r8bhW9fS2/rUlPW/1+NOarb9Jih+eYSTaJXWkHpbro5yg/e3M0ep7ivZ80cyV2kkhNZYCH84wfSe6kjCukcJzjKmhbMcKyrku1Pvqbru049Gxg9OCvpNVr22DPl4t9L19I4SqeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=dylanvanassche.be; spf=pass smtp.mailfrom=dylanvanassche.be; dkim=pass (2048-bit key) header.d=dylanvanassche.be header.i=@dylanvanassche.be header.b=fIeNgb5/; arc=none smtp.client-ip=88.198.220.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=dylanvanassche.be Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dylanvanassche.be DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dylanvanassche.be; s=default2306; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=6fL1tq5YHxeAA+CRy4r/mRxLDFZ+WeZfw73SYF9S1o8=; b=fIeNgb5/aQGy0F4vl7Epu1fZZ9 CNd+F7myGRbzKMC1gvEm3TfcvUGp3kPHeAby0d2lRXglZ41AHBNRyHorse3Z4bVuWR4o7VJYcNX4w SUsfCSDtBqIA5n5qlZ36lpvSTfKmVk1mqihqYW3EMSbONg2XKVmh+2x6IEMqBYsVujud8u0HN4byP PZwqFXBDYJ4pPtCsoCZvft+p7sPm6zJgT6HyLEaVxYCnvLVyRT60yLGinjFs4AFNWPQMGSbZpfxYm 2DTU1FcJ87HLyWzStYo1wgxC42vFzyjeKMKO5gyjYiIHI9zw+4x2GQgKqbd8Sp5y/rIGZZXBD2SVF QrCGTxMQ==; Received: from sslproxy06.your-server.de ([78.46.172.3]) by www316.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sAXYq-000K0U-RS; Fri, 24 May 2024 18:14:28 +0200 Received: from [169.150.196.25] (helo=desktop.telenet.be) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sAXYp-0000gS-2w; Fri, 24 May 2024 18:14:28 +0200 From: Dylan Van Assche To: Srinivas Kandagatla , Amol Maheshwari , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Caleb Connolly , phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Dylan Van Assche Subject: [PATCH v5 2/2] misc: fastrpc: use coherent pool for untranslated Compute Banks Date: Fri, 24 May 2024 18:14:03 +0200 Message-ID: <20240524161423.15392-3-me@dylanvanassche.be> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240524161423.15392-1-me@dylanvanassche.be> References: <20240524161423.15392-1-me@dylanvanassche.be> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: me@dylanvanassche.be X-Virus-Scanned: Clear (ClamAV 0.103.10/27285/Fri May 24 10:30:55 2024) Use fastrpc_remote_heap_alloc to allocate from the FastRPC device instead of the Compute Bank when the session ID is 0. This ensures that the allocation is inside the coherent DMA pool which is already accessible to the DSP. This is necessary to support FastRPC devices which do not have dedicated Compute Banks such as the SLPI on the SDM845. The latter uses an allocated CMA region instead of FastRPC Compute Banks. Signed-off-by: Dylan Van Assche Reviewed-by: Caleb Connolly --- drivers/misc/fastrpc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index c06667b29055..f53d20e2e07e 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -953,7 +953,10 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) ctx->msg_sz = pkt_size; - err = fastrpc_buf_alloc(ctx->fl, dev, pkt_size, &ctx->buf); + if (ctx->fl->sctx->sid) + err = fastrpc_buf_alloc(ctx->fl, dev, pkt_size, &ctx->buf); + else + err = fastrpc_remote_heap_alloc(ctx->fl, dev, pkt_size, &ctx->buf); if (err) return err; -- 2.45.1