Linux-MIPS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context
@ 2020-01-06  6:24 Vikas Gupta
  2020-01-06  6:24 ` [PATCH v1] firmware: tee_bnxt: Reduce shm mem size to 4K Vikas Gupta
  2020-01-06 21:52 ` [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Vikas Gupta @ 2020-01-06  6:24 UTC (permalink / raw)
  To: Rafał Miłecki, David S. Miller, Sheetal Tigadoli,
	netdev, linux-mips, linux-kernel, Sumit Garg
  Cc: vikram.prakash, vasundhara-v.volam, Vikas Gupta

Fix calling multiple tee_client_close_context in case of shm allocation
fails.

Fixes: 246880958ac9 (“firmware: broadcom: add OP-TEE based BNXT f/w manager”)
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
---
 drivers/firmware/broadcom/tee_bnxt_fw.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/firmware/broadcom/tee_bnxt_fw.c b/drivers/firmware/broadcom/tee_bnxt_fw.c
index 5b7ef89..ed10da5 100644
--- a/drivers/firmware/broadcom/tee_bnxt_fw.c
+++ b/drivers/firmware/broadcom/tee_bnxt_fw.c
@@ -215,7 +215,6 @@ static int tee_bnxt_fw_probe(struct device *dev)
 	fw_shm_pool = tee_shm_alloc(pvt_data.ctx, MAX_SHM_MEM_SZ,
 				    TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
 	if (IS_ERR(fw_shm_pool)) {
-		tee_client_close_context(pvt_data.ctx);
 		dev_err(pvt_data.dev, "tee_shm_alloc failed\n");
 		err = PTR_ERR(fw_shm_pool);
 		goto out_sess;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1] firmware: tee_bnxt: Reduce shm mem size to 4K
  2020-01-06  6:24 [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context Vikas Gupta
@ 2020-01-06  6:24 ` Vikas Gupta
  2020-01-06  7:04   ` Sumit Garg
  2020-01-06 21:52 ` [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Vikas Gupta @ 2020-01-06  6:24 UTC (permalink / raw)
  To: Rafał Miłecki, David S. Miller, Sheetal Tigadoli,
	netdev, linux-mips, linux-kernel, Sumit Garg
  Cc: vikram.prakash, vasundhara-v.volam, Vikas Gupta

Reduce shm memory size as maximum size supported by optee_shm_register
API is 4K.

Fixes: 246880958ac9 (“firmware: broadcom: add OP-TEE based BNXT f/w manager”)
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
---
 drivers/firmware/broadcom/tee_bnxt_fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/broadcom/tee_bnxt_fw.c b/drivers/firmware/broadcom/tee_bnxt_fw.c
index 5b7ef89..8f0c61c6 100644
--- a/drivers/firmware/broadcom/tee_bnxt_fw.c
+++ b/drivers/firmware/broadcom/tee_bnxt_fw.c
@@ -12,7 +12,7 @@
 
 #include <linux/firmware/broadcom/tee_bnxt_fw.h>
 
-#define MAX_SHM_MEM_SZ	SZ_4M
+#define MAX_SHM_MEM_SZ	SZ_4K
 
 #define MAX_TEE_PARAM_ARRY_MEMB		4
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] firmware: tee_bnxt: Reduce shm mem size to 4K
  2020-01-06  6:24 ` [PATCH v1] firmware: tee_bnxt: Reduce shm mem size to 4K Vikas Gupta
@ 2020-01-06  7:04   ` Sumit Garg
  0 siblings, 0 replies; 4+ messages in thread
From: Sumit Garg @ 2020-01-06  7:04 UTC (permalink / raw)
  To: Vikas Gupta
  Cc: Rafał Miłecki, David S. Miller, Sheetal Tigadoli,
	netdev, linux-mips, Linux Kernel Mailing List, Vikram Prakash,
	Vasundhara Volam, Jens Wiklander

+ Jens

Hi Vikas,

On Mon, 6 Jan 2020 at 11:56, Vikas Gupta <vikas.gupta@broadcom.com> wrote:
>
> Reduce shm memory size as maximum size supported by optee_shm_register
> API is 4K.
>

There isn't any 4K size limitation with optee_shm_register() but
rather its an issue in upstream that is fixed via this patch [1]. Give
it a try and let me know if it works for you.

[1] https://lkml.org/lkml/2019/12/30/189

-Sumit

> Fixes: 246880958ac9 (“firmware: broadcom: add OP-TEE based BNXT f/w manager”)
> Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
> ---
>  drivers/firmware/broadcom/tee_bnxt_fw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/broadcom/tee_bnxt_fw.c b/drivers/firmware/broadcom/tee_bnxt_fw.c
> index 5b7ef89..8f0c61c6 100644
> --- a/drivers/firmware/broadcom/tee_bnxt_fw.c
> +++ b/drivers/firmware/broadcom/tee_bnxt_fw.c
> @@ -12,7 +12,7 @@
>
>  #include <linux/firmware/broadcom/tee_bnxt_fw.h>
>
> -#define MAX_SHM_MEM_SZ SZ_4M
> +#define MAX_SHM_MEM_SZ SZ_4K
>
>  #define MAX_TEE_PARAM_ARRY_MEMB                4
>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context
  2020-01-06  6:24 [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context Vikas Gupta
  2020-01-06  6:24 ` [PATCH v1] firmware: tee_bnxt: Reduce shm mem size to 4K Vikas Gupta
@ 2020-01-06 21:52 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2020-01-06 21:52 UTC (permalink / raw)
  To: vikas.gupta
  Cc: zajec5, sheetal.tigadoli, netdev, linux-mips, linux-kernel,
	sumit.garg, vikram.prakash, vasundhara-v.volam

From: Vikas Gupta <vikas.gupta@broadcom.com>
Date: Mon,  6 Jan 2020 11:54:02 +0530

> Fix calling multiple tee_client_close_context in case of shm allocation
> fails.
> 
> Fixes: 246880958ac9 (“firmware: broadcom: add OP-TEE based BNXT f/w manager”)
> Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>

Applied.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06  6:24 [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context Vikas Gupta
2020-01-06  6:24 ` [PATCH v1] firmware: tee_bnxt: Reduce shm mem size to 4K Vikas Gupta
2020-01-06  7:04   ` Sumit Garg
2020-01-06 21:52 ` [PATCH v1] firmware: tee_bnxt: Fix multiple call to tee_client_close_context David Miller

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org
	public-inbox-index linux-mips

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git