public inbox for linux-remoteproc@vger.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bod@kernel.org>
To: "Barnabás Czémán" <barnabas.czeman@mainlining.org>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Mathieu Poirier" <mathieu.poirier@linaro.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Stephan Gerhold" <stephan@gerhold.net>
Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/9] remoteproc: qcom_q6v5_mss: Add MDM9607
Date: Thu, 1 Jan 2026 13:19:55 +0000	[thread overview]
Message-ID: <39090d1c-06ee-4a74-acbb-e63d1b8bdef0@kernel.org> (raw)
In-Reply-To: <6bfc790d-b0da-4c5b-bd2d-ceed9a75bb24@kernel.org>

On 01/01/2026 13:13, Bryan O'Donoghue wrote:
> On 31/12/2025 16:30, Barnabás Czémán wrote:
>> From: Stephan Gerhold <stephan@gerhold.net>
>>
>> Add support for MDM9607 MSS it have different ACC settings
>> and it needs mitigation for inrush current issue.
>>
>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
>> [Reword the commit, add necessary flags, rework inrush current mitigation]
>> Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
>> ---
>>    drivers/remoteproc/qcom_q6v5_mss.c | 89 ++++++++++++++++++++++++++++++++------
>>    1 file changed, 75 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
>> index 3c404118b322..19863c576d72 100644
>> --- a/drivers/remoteproc/qcom_q6v5_mss.c
>> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
>> @@ -124,6 +124,7 @@
>>    #define QDSP6v56_CLAMP_QMC_MEM		BIT(22)
>>    #define QDSP6SS_XO_CBCR		0x0038
>>    #define QDSP6SS_ACC_OVERRIDE_VAL		0x20
>> +#define QDSP6SS_ACC_OVERRIDE_VAL_9607	0x80800000
>>    #define QDSP6v55_BHS_EN_REST_ACK	BIT(0)
>>
>>    /* QDSP6v65 parameters */
>> @@ -256,6 +257,7 @@ struct q6v5 {
>>    };
>>
>>    enum {
>> +	MSS_MDM9607,
>>    	MSS_MSM8226,
>>    	MSS_MSM8909,
>>    	MSS_MSM8916,
>> @@ -747,15 +749,19 @@ static int q6v5proc_reset(struct q6v5 *qproc)
>>    			return ret;
>>    		}
>>    		goto pbl_wait;
>> -	} else if (qproc->version == MSS_MSM8909 ||
>> +	} else if (qproc->version == MSS_MDM9607 ||
>> +		   qproc->version == MSS_MSM8909 ||
>>    		   qproc->version == MSS_MSM8953 ||
>>    		   qproc->version == MSS_MSM8996 ||
>>    		   qproc->version == MSS_MSM8998 ||
>>    		   qproc->version == MSS_SDM660) {
>>
>> -		if (qproc->version != MSS_MSM8909 &&
>> -		    qproc->version != MSS_MSM8953)
>> -			/* Override the ACC value if required */
>> +		/* Override the ACC value if required */
>> +		if (qproc->version == MSS_MDM9607)
>> +			writel(QDSP6SS_ACC_OVERRIDE_VAL_9607,
>> +			       qproc->reg_base + QDSP6SS_STRAP_ACC);
>> +		else if (qproc->version != MSS_MSM8909 &&
>> +			 qproc->version != MSS_MSM8953)
>>    			writel(QDSP6SS_ACC_OVERRIDE_VAL,
>>    			       qproc->reg_base + QDSP6SS_STRAP_ACC);
>>
>> @@ -800,7 +806,7 @@ static int q6v5proc_reset(struct q6v5 *qproc)
>>    		writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
>>
>>    		if (qproc->version != MSS_MSM8909) {
>> -			int mem_pwr_ctl;
>> +			int mem_pwr_ctl, reverse = 0;
>>
>>    			/* Deassert QDSP6 compiler memory clamp */
>>    			val = readl(qproc->reg_base + QDSP6SS_PWR_CTL_REG);
>> @@ -812,7 +818,8 @@ static int q6v5proc_reset(struct q6v5 *qproc)
>>    			writel(val, qproc->reg_base + QDSP6SS_PWR_CTL_REG);
>>
>>    			/* Turn on L1, L2, ETB and JU memories 1 at a time */
>> -			if (qproc->version == MSS_MSM8953 ||
>> +			if (qproc->version == MSS_MDM9607 ||
>> +			    qproc->version == MSS_MSM8953 ||
>>    			    qproc->version == MSS_MSM8996) {
>>    				mem_pwr_ctl = QDSP6SS_MEM_PWR_CTL;
>>    				i = 19;
>> @@ -822,16 +829,34 @@ static int q6v5proc_reset(struct q6v5 *qproc)
>>    				i = 28;
>>    			}
>>    			val = readl(qproc->reg_base + mem_pwr_ctl);
>> -			for (; i >= 0; i--) {
>> -				val |= BIT(i);
>> -				writel(val, qproc->reg_base + mem_pwr_ctl);
>> +			if (qproc->version == MSS_MDM9607) {
>>    				/*
>> -				 * Read back value to ensure the write is done then
>> -				 * wait for 1us for both memory peripheral and data
>> -				 * array to turn on.
>> +				 * Set first 5 bits in reverse to avoid
>> +				 * "inrush current" issues.
>>    				 */
>> -				val |= readl(qproc->reg_base + mem_pwr_ctl);
>> -				udelay(1);
>> +				reverse = 6;
>> +				for (; i >= reverse; i--) {
>> +					val |= BIT(i);
>> +					writel(val, qproc->reg_base + mem_pwr_ctl);
>> +					udelay(1);
>> +				}
>> +				for (i = 0; i < reverse; i++) {
>> +					val |= BIT(i);
>> +					writel(val, qproc->reg_base + mem_pwr_ctl);
>> +					udelay(1);
>> +				}
>> +			} else {
>> +				for (; i >= 0; i--) {
>> +					val |= BIT(i);
>> +					writel(val, qproc->reg_base + mem_pwr_ctl);
>> +					/*
>> +					 * Read back value to ensure the write is done then
>> +					 * wait for 1us for both memory peripheral and data
>> +					 * array to turn on.
>> +					 */
>> +					val |= readl(qproc->reg_base + mem_pwr_ctl);
>> +					udelay(1);
> 
> Isn't the logic here inverted ?
> 
> i.e. you've written a thing and ostensibly require a delay for that
> thing to take effect, the power to switch on in this case.
> 
> It makes more sense to write, delay and read back rather than write,
> readback and delay surely...
> 
Also now that I look at this, shouldn't you interrogate the bit gets set 
as per your write ?

Does this bit mean "yes I acknowledge your request" or "yes I carried 
out your request" ?

In the first case you care that the bit indicates something useful, in 
the second case it barely indicates anything at all.

---
bod

  reply	other threads:[~2026-01-01 13:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-31 16:30 [PATCH v3 0/9] MDM9607/MSM8917/MSM8937/MSM8940 MSS Barnabás Czémán
2025-12-31 16:30 ` [PATCH v3 1/9] remoteproc: qcom_q6v5_mss: Introduce need_pas_mem_setup Barnabás Czémán
2026-01-01 13:17   ` Bryan O'Donoghue
2025-12-31 16:30 ` [PATCH v3 2/9] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MDM9607 Barnabás Czémán
2026-01-02 10:58   ` Krzysztof Kozlowski
2025-12-31 16:30 ` [PATCH v3 3/9] remoteproc: qcom_q6v5_mss: " Barnabás Czémán
2026-01-01 13:13   ` Bryan O'Donoghue
2026-01-01 13:19     ` Bryan O'Donoghue [this message]
2026-01-01 13:23       ` Bryan O'Donoghue
2026-01-01 13:50     ` barnabas.czeman
2026-01-01 20:58       ` Bryan O'Donoghue
2026-01-01 21:57         ` barnabas.czeman
2026-01-02  9:55           ` Bryan O'Donoghue
2026-01-02 12:50             ` barnabas.czeman
2026-01-02 12:00         ` Konrad Dybcio
2026-01-02 12:59           ` Bryan O'Donoghue
2026-01-02 14:02             ` Konrad Dybcio
2026-01-02 13:00           ` Bryan O'Donoghue
2026-01-02 14:03             ` Konrad Dybcio
2026-01-03  7:41           ` barnabas.czeman
2025-12-31 16:30 ` [PATCH v3 4/9] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8917 Barnabás Czémán
2026-01-02 10:59   ` Krzysztof Kozlowski
2025-12-31 16:30 ` [PATCH v3 5/9] remoteproc: qcom_q6v5_mss: " Barnabás Czémán
2025-12-31 16:30 ` [PATCH v3 6/9] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8937 Barnabás Czémán
2026-01-02 11:00   ` Krzysztof Kozlowski
2025-12-31 16:30 ` [PATCH v3 7/9] remoteproc: qcom_q6v5_mss: " Barnabás Czémán
2025-12-31 16:30 ` [PATCH v3 8/9] dt-bindings: remoteproc: qcom,msm8916-mss-pil: Add MSM8940 Barnabás Czémán
2026-01-02 11:00   ` Krzysztof Kozlowski
2025-12-31 16:30 ` [PATCH v3 9/9] remoteproc: qcom_q6v5_mss: " Barnabás Czémán

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=39090d1c-06ee-4a74-acbb-e63d1b8bdef0@kernel.org \
    --to=bod@kernel.org \
    --cc=andersson@kernel.org \
    --cc=barnabas.czeman@mainlining.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=robh@kernel.org \
    --cc=stephan@gerhold.net \
    /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