Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp979375rdg; Fri, 11 Aug 2023 06:17:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHn07hca1GNUKNyXhj1tb933Q+6pPp42mDRbtYvodGwRDXrbEvjR67YR+U+DCyKNQDnzFgK X-Received: by 2002:a17:90a:6f65:b0:269:2356:19fb with SMTP id d92-20020a17090a6f6500b00269235619fbmr1158602pjk.15.1691759828311; Fri, 11 Aug 2023 06:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691759828; cv=none; d=google.com; s=arc-20160816; b=H8n2fO4xry5NeuGrsDN8cuoC319hx7UTbdPxjPe0hVn2DKsehdg6s4cyA6+ypE9a20 ky8LpUWmg+1Z4wv4/tpPuVQJj+G4QwwOaajl05Wpt8/qAglQwGTwR57EaO0NWyCfiwI4 XWiPYlrsUVf+pZ3U/LGSeZghOJ2mVHKaLHj2X8L1wFF9uveIVEGzcYgr2LAwc343UNlm /kHZJgtA/9sNW9+pQcb4TZ6ZBS4KTHurpgWwNZYPVOUQQxs3LLphWjWPpEm/eLlD1n/n 7FCM/h3d7gkAfW36nZB9vLkEk+17xUj9xYci9SAVUtZml19ptWfclOwtqEwrBseYKuaC lrEQ== 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=CcPdZ2nGxjXBiRr9VgUDUf+2/h+oYQAJVXrn/kAMSKY=; fh=CFwWa/wFi2T7MkQkyT3fgxbew9+oGKG8zaK55FnmIWo=; b=iU7M8R7IfGcqM17HK1a6eObbqwP2oKG6Thqtt986+L0JrwNZYgsQN9Xmp2dszYCvOO mG8I8zQAWVdFj/N/UpvvoE0fiX6ehKyzLL3NZJnCHUrHKw30cfgPEdmdhmImY4kDpgNQ zJiHUcA3jhi4BuHPdP5pgC7h9cragKCnnp2YQU6GkGrk3k+8OJ3ztsd+CFAjb+r7+k6Y l/ffeYCNCekQNvuQvSikH0UjnYEGlxnch0KBq9WHObKHyPbep1NLBi6P6vsjdyeOyKVW sJ67ieCJPOE4ULeuE3sWZUqLI3pdLrNPvCa6uELFSRFtxxzU20aYL8Hs1ujZ+7WWlFkR Pshw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mtbWXaTn; 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 me17-20020a17090b17d100b0025bdc2a0b15si5917415pjb.135.2023.08.11.06.16.55; Fri, 11 Aug 2023 06:17:08 -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=mtbWXaTn; 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 S235944AbjHKL46 (ORCPT + 99 others); Fri, 11 Aug 2023 07:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234015AbjHKL4y (ORCPT ); Fri, 11 Aug 2023 07:56:54 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7928120 for ; Fri, 11 Aug 2023 04:56:53 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-99bdcade7fbso261479666b.1 for ; Fri, 11 Aug 2023 04:56:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691755012; x=1692359812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CcPdZ2nGxjXBiRr9VgUDUf+2/h+oYQAJVXrn/kAMSKY=; b=mtbWXaTnOWz2UBNDIj7Py9lRxlm59CI8VyQAcyOT4mJ7ucw8tUxqjAbyGpvrEmDYRF fhF6IR20W9KSQZRlExFMEwdA7rfoX1o2PEo+ChUSQDsDQxJ/RFfzzI5ZZb3uY0Yqgh3i oLwfYJ6SppX6/IuzbQloo0bez+S7AnQCA5T92IwiRuqFDSpi+/n1ydumBMdS1e5T/Fvy ODJNch1RBOircYPR9/FGzFnCWvQLsRcE7MJNR1xH12IfqQUXKbOGrxTj0E6x2NWUCSEA ON5OmThwydny6yw4Sf3Ernz+HuyCQK/Jlqi4RYbBzryJ6mZkEwMGw7fgymH4LF4KafU9 L5PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691755012; x=1692359812; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CcPdZ2nGxjXBiRr9VgUDUf+2/h+oYQAJVXrn/kAMSKY=; b=bmLhBaLfmjKtjrfhd/dTPc5fGRGfr4KNq9yZ2l4rXq+6xZTLk5fh+l5JoSXlL6wZ48 nMPYo9yjOaryYk4HivG1WJqfCh4lklG75VBvdr9BYUmdCVbJWM4rWkQ4PoYTKZfdTXAh 1tq75wsZNGXqgMuDQqWnztwIK791swWyS1W1SrYGk+CGkyMFJxWAXTc7K/Se5Uz25wrv 9IFHmJOWX9Bn8W8XryTOWfxM2QW8YDU9P1aqlLWNgWNfWZOWiQ2kuvThOfXtTy2ROxIT ze6owuhPEciMhS5kjgp4ocWp3xXXEzsHwacgSvLNZ6mn3+YANCkytkwvFrWmMu+DGscO G9jw== X-Gm-Message-State: AOJu0YzvLmxsg3n+EJqTela+/+aw0AKNV6TBGykm0OdWzrdz+IvTaao/ 7aJOx/zPd6wtw7NIYrV+2pxwVw== X-Received: by 2002:a17:906:1db1:b0:997:deb1:ff6a with SMTP id u17-20020a1709061db100b00997deb1ff6amr1450934ejh.22.1691755012496; Fri, 11 Aug 2023 04:56:52 -0700 (PDT) Received: from localhost.localdomain ([5.133.47.210]) by smtp.gmail.com with ESMTPSA id f16-20020a170906561000b00992076f4a01sm2165395ejq.190.2023.08.11.04.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Aug 2023 04:56:51 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Ekansh Gupta , stable , Srinivas Kandagatla Subject: [PATCH 3/3] misc: fastrpc: Pass proper scm arguments for static process init Date: Fri, 11 Aug 2023 12:56:43 +0100 Message-Id: <20230811115643.38578-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230811115643.38578-1-srinivas.kandagatla@linaro.org> References: <20230811115643.38578-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 From: Ekansh Gupta Memory is allocated for dynamic loading when audio daemon is trying to attach to audioPD on DSP side. This memory is allocated from reserved CMA memory region and needs ownership assignment to new VMID in order to use it from audioPD. In the current implementation, arguments are not correctly passed to the scm call which might result in failure of dynamic loading on audioPD. Added changes to pass correct arguments during daemon attach request. Fixes: 0871561055e6 ("misc: fastrpc: Add support for audiopd") Cc: stable Tested-by: Ekansh Gupta Signed-off-by: Ekansh Gupta Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 8183c55283fb..42c4f603ec81 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1324,13 +1324,18 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, return 0; err_invoke: if (fl->cctx->vmcount) { - struct qcom_scm_vmperm perm; + u64 src_perms = 0; + struct qcom_scm_vmperm dst_perms; + u32 i; - perm.vmid = QCOM_SCM_VMID_HLOS; - perm.perm = QCOM_SCM_PERM_RWX; + for (i = 0; i < fl->cctx->vmcount; i++) + src_perms |= BIT(fl->cctx->vmperms[i].vmid); + + dst_perms.vmid = QCOM_SCM_VMID_HLOS; + dst_perms.perm = QCOM_SCM_PERM_RWX; err = qcom_scm_assign_mem(fl->cctx->remote_heap->phys, (u64)fl->cctx->remote_heap->size, - &fl->cctx->perms, &perm, 1); + &src_perms, &dst_perms, 1); if (err) dev_err(fl->sctx->dev, "Failed to assign memory phys 0x%llx size 0x%llx err %d", fl->cctx->remote_heap->phys, fl->cctx->remote_heap->size, err); -- 2.25.1