Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1717923

Re: [PATCH 1/3] soc: qcom: smem: Support global partition

From Bjorn Andersson <bjorn.andersson@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] soc: qcom: smem: Support global partition
Date 2017-08-23 02:40 +0200
Message-ID <uhrSa-1HS-19@gated-at.bofh.it> (permalink)
References <ufE78-4zk-11@gated-at.bofh.it> <ufE79-4zk-21@gated-at.bofh.it> <ugYwO-7cM-13@gated-at.bofh.it> <uhrIu-1Ej-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue 22 Aug 17:28 PDT 2017, Chris Lew wrote:
> On 8/21/2017 10:17 AM, Bjorn Andersson wrote:
[..]
> > > +static int qcom_smem_set_global_partition(struct qcom_smem *smem,
> > > +				struct smem_ptable_entry *entry)
> > > +{
[..]
> > > +	if (header->size != entry->size) {
> > 
> > This happens to work, because they are both in the same endian. But
> > please sprinkle some le32_to_cpu() here as well.
> > 
> 
> 
> These checks mimic the sanity checks being done in enumerate_partitions.
> Should I create a patch to increase le32_to_cpu usage in
> qcom_smem_enumerate_partitions?
> 

Oops, yeah please do, just for completeness sake.

[..]
> > > @@ -647,6 +714,12 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
> > >   		host0 = le16_to_cpu(entry->host0);
> > >   		host1 = le16_to_cpu(entry->host1);
> > > +		if (host0 == SMEM_GLOBAL_HOST && host0 == host1) {
> > > +			if (qcom_smem_set_global_partition(smem, entry))
> > > +				return -EINVAL;
> > > +			continue;
> > > +		}
> > > +
> > 
> > As you're not able to leverage any of the checks from this loop I think
> > it's cleaner to duplicate the traversal of the partition table in both
> > functions and call the "search for global partition" directly from
> > probe - if the version indicates there should be one.
> > 
> 
> 
> Ok, will set the global partition in the version case statement and error
> out of the probe if finding the global partition fails since it is not
> optional in the new version.
> 

Sounds good.

Regards,
Bjorn

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Qualcomm SMEM V12 Support Chris Lew <clew@codeaurora.org> - 2017-08-18 03:20 +0200
  [PATCH 3/3] soc: qcom: smem: Increase the number of hosts Chris Lew <clew@codeaurora.org> - 2017-08-18 03:20 +0200
    Re: [PATCH 3/3] soc: qcom: smem: Increase the number of hosts Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-08-21 19:40 +0200
  [PATCH 2/3] soc: qcom: smem: Support dynamic item limit Chris Lew <clew@codeaurora.org> - 2017-08-18 03:20 +0200
    Re: [PATCH 2/3] soc: qcom: smem: Support dynamic item limit Arun Kumar Neelakantam <aneela@codeaurora.org> - 2017-08-21 11:00 +0200
    Re: [PATCH 2/3] soc: qcom: smem: Support dynamic item limit Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-08-21 19:40 +0200
  [PATCH 1/3] soc: qcom: smem: Support global partition Chris Lew <clew@codeaurora.org> - 2017-08-18 03:20 +0200
    Re: [PATCH 1/3] soc: qcom: smem: Support global partition Arun Kumar Neelakantam <aneela@codeaurora.org> - 2017-08-21 08:10 +0200
    Re: [PATCH 1/3] soc: qcom: smem: Support global partition Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-08-21 19:20 +0200
      Re: [PATCH 1/3] soc: qcom: smem: Support global partition Chris Lew <clew@codeaurora.org> - 2017-08-23 02:30 +0200
        Re: [PATCH 1/3] soc: qcom: smem: Support global partition Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-08-23 02:40 +0200

csiph-web