Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbdHKXgs (ORCPT ); Fri, 11 Aug 2017 19:36:48 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:54900 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbdHKXgq (ORCPT ); Fri, 11 Aug 2017 19:36:46 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 35DC5601D8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sboyd@codeaurora.org Subject: Re: [PATCH 2/2] soc: qcom: smem: Support getting cached entries To: Bjorn Andersson , Andy Gross , David Brown Cc: Arun Kumar Neelakantam , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170810193757.9136-1-bjorn.andersson@linaro.org> <20170810193757.9136-3-bjorn.andersson@linaro.org> From: Stephen Boyd Message-ID: <4bd2d474-ad5a-d7ea-c667-fa5a716fc115@codeaurora.org> Date: Fri, 11 Aug 2017 16:36:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170810193757.9136-3-bjorn.andersson@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1366 Lines: 49 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