linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: smem: Fix errant private access
@ 2015-08-15  3:56 Andy Gross
  2015-08-15  4:50 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Gross @ 2015-08-15  3:56 UTC (permalink / raw)
  To: linux-arm-kernel

This patch corrects private partition item access.  Instead of falling back to
global for instances where we have an actual host and remote partition existing,
return the results of the private lookup.

Signed-off-by: Andy Gross <agross@codeaurora.org>
---
 drivers/soc/qcom/smem.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
index 7c2c324c..6603201d 100644
--- a/drivers/soc/qcom/smem.c
+++ b/drivers/soc/qcom/smem.c
@@ -484,8 +484,9 @@ int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
 	if (ret)
 		return ret;
 
-	ret = qcom_smem_get_private(__smem, host, item, ptr, size);
-	if (ret == -ENOENT)
+	if (host < SMEM_HOST_COUNT && __smem->partitions[host])
+		ret = qcom_smem_get_private(__smem, host, item, ptr, size);
+	else
 		ret = qcom_smem_get_global(__smem, item, ptr, size);
 
 	hwspin_unlock_irqrestore(__smem->hwlock, &flags);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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

* [PATCH] soc: qcom: smem: Fix errant private access
  2015-08-15  3:56 [PATCH] soc: qcom: smem: Fix errant private access Andy Gross
@ 2015-08-15  4:50 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2015-08-15  4:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri 14 Aug 20:56 PDT 2015, Andy Gross wrote:

> This patch corrects private partition item access.  Instead of falling back to
> global for instances where we have an actual host and remote partition existing,
> return the results of the private lookup.
> 
> Signed-off-by: Andy Gross <agross@codeaurora.org>
> ---
>  drivers/soc/qcom/smem.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
> index 7c2c324c..6603201d 100644
> --- a/drivers/soc/qcom/smem.c
> +++ b/drivers/soc/qcom/smem.c
> @@ -484,8 +484,9 @@ int qcom_smem_get(unsigned host, unsigned item, void **ptr, size_t *size)
>  	if (ret)
>  		return ret;
>  
> -	ret = qcom_smem_get_private(__smem, host, item, ptr, size);
> -	if (ret == -ENOENT)
> +	if (host < SMEM_HOST_COUNT && __smem->partitions[host])
> +		ret = qcom_smem_get_private(__smem, host, item, ptr, size);
> +	else
>  		ret = qcom_smem_get_global(__smem, item, ptr, size);

Looks good, but you can drop the if statement in the beginning of the
qcom_smem_get_private() now.

Can you please also do the same change in the alloc path, to keep them
consistent?

Regards,
Bjorn

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

end of thread, other threads:[~2015-08-15  4:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-15  3:56 [PATCH] soc: qcom: smem: Fix errant private access Andy Gross
2015-08-15  4:50 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).