From patchwork Thu May 11 14:11:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Van Assche X-Patchwork-Id: 92641 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp4472211rwl; Thu, 11 May 2023 07:18:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Zw1SeIWu4DiKjY2IyB5t2Ab/wAjW8B4jsVio0TAnJBWZSO10Nf7pUGA0OwwEunfeoatK5 X-Received: by 2002:a05:6a20:1610:b0:f0:6f7f:4f2b with SMTP id l16-20020a056a20161000b000f06f7f4f2bmr26522630pzj.1.1683814729138; Thu, 11 May 2023 07:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683814729; cv=none; d=google.com; s=arc-20160816; b=Hv+XBvepGWLcliKD8waKDEYjXDTXpjvBLYYK9byFY1wvtB44ZhnBX9Nxa4TEGoeCoV 0qLAQdV2cjoV+v81RLDlikJoO0+ppz+0tMnjGCIY1D9iSe+R7f70tkKFXyJiQO2DyBgq H+XSd6Z1+w5MLA6wulGufiObc9rQaFNn59ZY15LqxjYjqxVrpBowrFohSrlBTHxNAIoO JO/oNTNSc34vJqCp6lPOeNDyr+rPlMAkmxpEn8iLcZAbr0GCeB8YpY/c+N5Amwitcwkl c6ZIVB2vYYnddjFDXYGBehngnQzJGIMdLuFCRCnODbMxwvELmTVlqeM+E2jg/42NMXCR fo5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JNzwKONia1evLN1QC2vRkbgu3RwkxcMWK2mRFNmiqkc=; b=tPcAmCtbkH6dX+SJbtMLVWbkJQ42JrSqVL8TckevtdgzfcpSqQFS0LXuUNjWiLYjR3 NbzWt6fKZ9s1tRjVLC43UmIrmf798eeb0WmNrIGSGCkvIdKIMGwO0hNvjjNQ0d6f7h1q 8tWjbVnYOsSpxssh+q59vHMeJKb9C2wyIEZ09A7wl6i/h0lJy0bsjiRy5A7PtqXIsFM4 6l5ib9n7xyKPGAhgl/B1qXYlMQ2K7iSr4RnP5sZG5Mq23rT8ZTu2iADTQHyYYYq1L5FO R06666XQpCK8iKDgco+S83qyUIRyhuMyPp/ozsxlftCROInHPEkz7n69hIvCxnkKwpx4 sTLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dylanvanassche.be header.s=MBO0001 header.b=0R1IkmfT; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o19-20020a637313000000b0051b37c000dcsi1661679pgc.81.2023.05.11.07.18.33; Thu, 11 May 2023 07:18:49 -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=@dylanvanassche.be header.s=MBO0001 header.b=0R1IkmfT; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=dylanvanassche.be Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237987AbjEKONa (ORCPT + 99 others); Thu, 11 May 2023 10:13:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237802AbjEKON0 (ORCPT ); Thu, 11 May 2023 10:13:26 -0400 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050:0:465::102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 271F55BA6; Thu, 11 May 2023 07:12:36 -0700 (PDT) Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4QHDNg08npz9sbY; Thu, 11 May 2023 16:12:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dylanvanassche.be; s=MBO0001; t=1683814323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JNzwKONia1evLN1QC2vRkbgu3RwkxcMWK2mRFNmiqkc=; b=0R1IkmfTtjAXvzhnxT6uWWUGAQ8226GDi5Ej/uL8kAhPBhdvZh+Gnk9pDcL9v4LfLG7hVW cCAEyk54g0Iy8uv0ueo3YLKu+1V7+7ioMbxpN1s3fUxKH2OPMF4GmS8/ladZVHYNTCC1Tp RDai893sH8EM4ZIkBqL71rqcR7Bm8K3yNQoR1tRh0OCIBJapGb7Oc0clSAJ88YrqNmQxeQ XP4xWVJA8lnF7VFYVq8yaCKNPGQ5PMkszfF8FaCYpQmSS2VzXcZUYrd3KASsReg24ABYHc iEDVhn8z9Joj50fap0GG4enynhpnCS049ClijCGwg0vCgIiQxDFzUuPstyh/5A== From: Dylan Van Assche To: srinivas.kandagatla@linaro.org, amahesh@qti.qualcomm.com, arnd@arndb.de, gregkh@linuxfoundation.org Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, dan.carpenter@linaro.org, Dylan Van Assche , Caleb Connolly Subject: [PATCH v4 2/2] misc: fastrpc: use coherent pool for untranslated Compute Banks Date: Thu, 11 May 2023 16:11:46 +0200 Message-Id: <20230511141146.30465-3-me@dylanvanassche.be> In-Reply-To: <20230511141146.30465-1-me@dylanvanassche.be> References: <20230511141146.30465-1-me@dylanvanassche.be> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765607713241851614?= X-GMAIL-MSGID: =?utf-8?q?1765607713241851614?= 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 1ced553ae959..3d47d3d13b5d 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -939,7 +939,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;