mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>
Cc: Arun Kumar Neelakantam <aneela@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] soc: qcom: smem: Support getting cached entries
Date: Fri, 11 Aug 2017 16:36:44 -0700	[thread overview]
Message-ID: <4bd2d474-ad5a-d7ea-c667-fa5a716fc115@codeaurora.org> (raw)
In-Reply-To: <20170810193757.9136-3-bjorn.andersson@linaro.org>

On 08/10/2017 12:37 PM, Bjorn Andersson wrote:
> @@ -252,6 +257,14 @@ phdr_to_last_uncached_entry(struct smem_partition_header *phdr)
>  	return p + le32_to_cpu(phdr->offset_free_uncached);
>  }
>  
> +static void *phdr_to_first_cached_entry(struct smem_partition_header *phdr,
> +					size_t cacheline)
> +{
> +	void *p = phdr;
> +
> +	return p + phdr->size - ALIGN(sizeof(*phdr), cacheline);

le32_to_cpu(phrd->size) ?

> +}
> +
>  static void *phdr_to_last_cached_entry(struct smem_partition_header *phdr)
>  {
>  	void *p = phdr;
> @@ -276,6 +289,14 @@ uncached_entry_next(struct smem_private_entry *e)
>  	       le32_to_cpu(e->size);
>  }
>  
> +static struct smem_private_entry *
> +cached_entry_next(struct smem_private_entry *e, size_t cacheline)
> +{
> +	void *p = e;
> +
> +	return p - le32_to_cpu(e->size) - ALIGN(sizeof(*e), cacheline);
> +}
> +
>  static void *uncached_entry_to_item(struct smem_private_entry *e)
>  {
>  	void *p = e;
> @@ -283,6 +304,13 @@ static void *uncached_entry_to_item(struct smem_private_entry *e)
>  	return p + sizeof(*e) + le16_to_cpu(e->padding_hdr);
>  }
>  
> +static void *cached_entry_to_item(struct smem_private_entry *e)
> +{
> +	void *p = e;
> +
> +	return p - le16_to_cpu(e->size);

But it's a le32?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

      reply	other threads:[~2017-08-11 23:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 19:37 [PATCH 0/2] Qualcomm SMEM cached item support Bjorn Andersson
2017-08-10 19:37 ` [PATCH 1/2] soc: qcom: smem: Rename "uncached" accessors Bjorn Andersson
2017-08-10 19:37 ` [PATCH 2/2] soc: qcom: smem: Support getting cached entries Bjorn Andersson
2017-08-11 23:36   ` Stephen Boyd [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4bd2d474-ad5a-d7ea-c667-fa5a716fc115@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=aneela@codeaurora.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome