From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E53F3C48BD1 for ; Wed, 9 Jun 2021 16:16:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B607A610A2 for ; Wed, 9 Jun 2021 16:16:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B607A610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UWanGWhn0TwXKmzGXtFQRwCjvU+Fow1rTa3sWTtha+w=; b=FMcbKxnNJqt89x FlOxOnhruiwAjDuYOA8mAZjSKV0g1lXnYgWbNGyTEKLnb+Egt7AR9jM1oB56gKYRN0WC7mOGL6Urt OPRydWqFLuFxmm+lAy3+E/IVuMfsoXHDPl37byiYWG23NIN4QUq9doUSyc8dcazzykVUfnoWMc9VF eofh8StRMXJaUD2TCnjRPKnpQzswNwsOHrhJ/N2JajUb3uNp4mfp/dECeQGLFQZxZrhuAKWT0U2cd 3ZHfruQrMvlCHUeDeQ1pJHzEiQFQJl4+XZFOkT5SE0vITHRtz36O8o/31VSwNGQVALzpC5ZijcC5J e127AqcrAGJqcrnNo59w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lr0qV-00EpsI-6e; Wed, 09 Jun 2021 16:14:24 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqzes-00ESAK-HJ for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 14:58:19 +0000 Received: from sequoia (162-237-133-238.lightspeed.rcsntx.sbcglobal.net [162.237.133.238]) by linux.microsoft.com (Postfix) with ESMTPSA id 3A72220B7188; Wed, 9 Jun 2021 07:58:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3A72220B7188 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1623250697; bh=UJ8w+2UkCTqOO7t0THpVN1Z+lmRBpIYgm5bx/zHc61k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r+mbMmR7zBOFUPNpvddxTsw6rYp5Yv6seXHZlg4vEYBw9ut8QsoWzSVElTA2B1qBt i3XUSJI+6bmdMbHf9gmIoE2jI+7HErf1ru10WB8h/qqH811cZnhgtGYomhaHpfruRF sJcKGyf5IJP/CLii/BhpRrtqruuZu5KpPRaAqbrA= Date: Wed, 9 Jun 2021 09:58:11 -0500 From: Tyler Hicks To: Jens Wiklander Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org, Sumit Garg , Herbert Xu , Sakkinen , Sasha Levin , Thirupathaiah Annapureddy , Vikas Gupta , "David S . Miller" Subject: Re: [PATCH 6/7] firmware: tee_bnxt: use tee_shm_alloc_kernel_buf() Message-ID: <20210609145811.GJ4910@sequoia> References: <20210609102324.2222332-1-jens.wiklander@linaro.org> <20210609102324.2222332-7-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210609102324.2222332-7-jens.wiklander@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_075818_653925_3644B7A4 X-CRM114-Status: GOOD ( 19.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-06-09 12:23:23, Jens Wiklander wrote: > Uses the new simplified tee_shm_alloc_kernel_buf() function instead of > the old deprecated tee_shm_alloc() function which required specific > TEE_SHM-flags. > > Signed-off-by: Jens Wiklander Since this series is essentially a rewrite of the shm allocation logic, it is worth pointing out that the rewrite still uses contiguous allocations (from alloc_pages()). The tee_bnxt_fw driver is performing an order-10 allocation which is the max, by default. I've only tested tee_bnxt_fw when it was built-in to the kernel and tee_bnxt_fw_probe() was called early in boot but I suspect that it might not succeed when built as a module and loaded later after memory is segmented. I think this driver would benefit from being able to request a non-contiguous allocation. Is this rewrite a good time to offer drivers a way to perform a non-contiguous allocation? Tyler > --- > drivers/firmware/broadcom/tee_bnxt_fw.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/firmware/broadcom/tee_bnxt_fw.c b/drivers/firmware/broadcom/tee_bnxt_fw.c > index ed10da5313e8..56d00ddd4357 100644 > --- a/drivers/firmware/broadcom/tee_bnxt_fw.c > +++ b/drivers/firmware/broadcom/tee_bnxt_fw.c > @@ -212,10 +212,9 @@ static int tee_bnxt_fw_probe(struct device *dev) > > pvt_data.dev = dev; > > - fw_shm_pool = tee_shm_alloc(pvt_data.ctx, MAX_SHM_MEM_SZ, > - TEE_SHM_MAPPED | TEE_SHM_DMA_BUF); > + fw_shm_pool = tee_shm_alloc_kernel_buf(pvt_data.ctx, MAX_SHM_MEM_SZ); > if (IS_ERR(fw_shm_pool)) { > - dev_err(pvt_data.dev, "tee_shm_alloc failed\n"); > + dev_err(pvt_data.dev, "tee_shm_alloc_kernel_buf failed\n"); > err = PTR_ERR(fw_shm_pool); > goto out_sess; > } > -- > 2.31.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel