All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Bjorn Andersson <quic_bjorande@quicinc.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] soc: qcom: rmtfs: Support dynamic placement of region
Date: Tue, 30 May 2023 21:48:46 +0200	[thread overview]
Message-ID: <ZHZTHlfDsngUrTRX@gerhold.net> (raw)
In-Reply-To: <20230530193436.3833889-3-quic_bjorande@quicinc.com>

On Tue, May 30, 2023 at 12:34:36PM -0700, Bjorn Andersson wrote:
> In some configurations, the exact placement of the rmtfs shared memory
> region isn't so strict. In the current implementation the author of the
> DeviceTree source is forced to make up a memory region.
> 
> Extend the rmtfs memory driver to relieve the author of this
> responsibility by introducing support for using dynamic allocation in
> the driver.
> 
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---
>  arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 10 ++++
>  drivers/soc/qcom/rmtfs_mem.c            | 66 +++++++++++++++++++------
>  2 files changed, 61 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> index d1440b790fa6..e6191b8ba4c6 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> @@ -12,6 +12,8 @@
>  #include "pm8998.dtsi"
>  #include "pmi8998.dtsi"
>  
> +/delete-node/ &rmtfs_mem;
> +
>  / {
>  	model = "Qualcomm Technologies, Inc. SDM845 MTP";
>  	compatible = "qcom,sdm845-mtp", "qcom,sdm845";
> @@ -48,6 +50,14 @@ vreg_s4a_1p8: pm8998-smps4 {
>  		vin-supply = <&vph_pwr>;
>  	};
>  
> +	rmtfs {
> +		compatible = "qcom,rmtfs-mem";
> +
> +		qcom,alloc-size = <(2*1024*1024)>;
> +		qcom,client-id = <1>;
> +		qcom,vmid = <15>;
> +	};
> +

Couldn't you just use the existing dynamic allocation of
reserved-memory, without any driver changes?

/ {
	reserved-memory {
		rmtfs {
			compatible = "qcom,rmtfs-mem";
			size = <0x0 (2*1024*1024)>;
			alignment = <0x0 ...>; // if you want a special one
			no-map; // don't we want to map this actually?

			qcom,client-id = <1>;
			qcom,vmid = <15>;
		};
	};
};

You won't get the 4K empty pages but I guess you just have them because
you allocate the memory without proper alignment?

Related patch series where I propose using it for most firmware memory
regions:
https://lore.kernel.org/linux-arm-msm/20230510-dt-resv-bottom-up-v1-5-3bf68873dbed@gerhold.net/

Thanks,
Stephan

  parent reply	other threads:[~2023-05-30 19:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 19:34 [PATCH 0/2] soc: qcom: rmtfs: Support dynamic allocation Bjorn Andersson
2023-05-30 19:34 ` [PATCH 1/2] dt-bindings: reserved-memory: rmtfs: Allow " Bjorn Andersson
2023-05-30 19:37   ` Konrad Dybcio
2023-05-31  8:05   ` Krzysztof Kozlowski
2023-05-31 17:44     ` Bjorn Andersson
2023-05-30 19:34 ` [PATCH 2/2] soc: qcom: rmtfs: Support dynamic placement of region Bjorn Andersson
2023-05-30 19:45   ` Konrad Dybcio
2023-05-30 21:31     ` Bjorn Andersson
2023-05-30 19:48   ` Stephan Gerhold [this message]
2023-05-30 21:39     ` Bjorn Andersson

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=ZHZTHlfDsngUrTRX@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_bjorande@quicinc.com \
    --cc=robh+dt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.