Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Kathiravan T <quic_kathirav@quicinc.com>
To: Elliot Berman <quic_eberman@quicinc.com>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	"Mukesh Ojha" <quic_mojha@quicinc.com>,
	Kalle Valo <kvalo@kernel.org>,
	Loic Poulain <loic.poulain@linaro.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>
Cc: <quic_srichara@quicinc.com>, <quic_sjaganat@quicinc.com>,
	<quic_anusha@quicinc.com>, <quic_saahtoma@quicinc.com>,
	Poovendhan Selvaraj <quic_poovendh@quicinc.com>
Subject: Re: [PATCH V5 3/3] firmware: scm: Modify only the download bits in TCSR register
Date: Tue, 25 Jul 2023 15:54:17 +0530	[thread overview]
Message-ID: <6b6a383f-4a3a-e55b-dc86-b1abb8c7acab@quicinc.com> (raw)
In-Reply-To: <5c56cc3c-13d0-d9d8-0209-5b6e8d7a4dac@quicinc.com>


On 7/25/2023 12:35 AM, Elliot Berman wrote:
>
>
> On 7/20/2023 12:04 AM, Kathiravan T wrote:
>> From: Mukesh Ojha <quic_mojha@quicinc.com>
>>
>> CrashDump collection is based on the DLOAD bit of TCSR register. To 
>> retain
>> other bits, we read the register and modify only the DLOAD bit as the
>> other bits have their own significance.
>>
>> Co-developed-by: Poovendhan Selvaraj <quic_poovendh@quicinc.com>
>> Signed-off-by: Poovendhan Selvaraj <quic_poovendh@quicinc.com>
>> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
>> Signed-off-by: Kathiravan T <quic_kathirav@quicinc.com>
>> ---
>> Changes in V5:
>>     - Added the Signed-off-by tag for user Poovendhan
>>     - Dropped the macro QCOM_DOWNLOAD_MODE_SHIFT in the favor of
>>       PREP_FIELD
>>
>>   drivers/firmware/qcom_scm.c | 11 +++++++++--
>>   1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c
>> index 104d86e49b97..3830dcf14326 100644
>> --- a/drivers/firmware/qcom_scm.c
>> +++ b/drivers/firmware/qcom_scm.c
>> @@ -30,6 +30,10 @@ module_param(download_mode, bool, 0);
>>   #define SCM_HAS_IFACE_CLK    BIT(1)
>>   #define SCM_HAS_BUS_CLK        BIT(2)
>>   +#define QCOM_DOWNLOAD_FULLDUMP        0x1
>> +#define QCOM_DOWNLOAD_NODUMP        0x0
>> +#define QCOM_DOWNLOAD_MODE_MASK        BIT(4)
>> +
>
> Can you update __qcom_scm_set_dload_mode to use the FIELD_PREP bits as 
> well? Ideally, you should be able to have no duplicate logic in 
> __qcom_scm_set_dload_mode and in qcom_scm_set_download_mode. Before 
> your patch, it was duplicated and we probably should've had it 
> de-duplicated. With this patch, the logic and constants used have 
> diverged when they don't need to.


Sure, will check this.


>
>>   struct qcom_scm {
>>       struct device *dev;
>>       struct clk *core_clk;
>> @@ -440,6 +444,7 @@ static int __qcom_scm_set_dload_mode(struct 
>> device *dev, bool enable)
>>   static void qcom_scm_set_download_mode(bool enable)
>>   {
>>       bool avail;
>> +    int val;
>>       int ret = 0;
>>         avail = __qcom_scm_is_call_available(__scm->dev,
>> @@ -448,8 +453,10 @@ static void qcom_scm_set_download_mode(bool enable)
>>       if (avail) {
>>           ret = __qcom_scm_set_dload_mode(__scm->dev, enable);
>>       } else if (__scm->dload_mode_addr) {
>> -        ret = qcom_scm_io_writel(__scm->dload_mode_addr,
>> -                enable ? QCOM_SCM_BOOT_SET_DLOAD_MODE : 0);
>> +        val = enable ? QCOM_DOWNLOAD_FULLDUMP : QCOM_DOWNLOAD_NODUMP;
>> +        ret = qcom_scm_io_update_field(__scm->dload_mode_addr,
>> +                           QCOM_DOWNLOAD_MODE_MASK,
>> +                           FIELD_PREP(QCOM_DOWNLOAD_MODE_MASK, val));
>>       } else {
>>           dev_err(__scm->dev,
>>               "No available mechanism for setting download mode\n");

  reply	other threads:[~2023-07-25 10:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20  7:04 [PATCH V5 0/3] Introduce the read-modify-write API to collect Kathiravan T
2023-07-20  7:04 ` [PATCH V5 1/3] firmware: qcom_scm: provide a read-modify-write function Kathiravan T
2023-07-22  1:17   ` Trilok Soni
2023-07-23 13:55     ` Kathiravan T
2023-07-29  0:34       ` Guru Das Srinagesh
2023-07-24 19:05   ` Elliot Berman
2023-07-20  7:04 ` [PATCH V5 2/3] pinctrl: qcom: Use qcom_scm_io_update_field() Kathiravan T
2023-07-22  3:09   ` Bjorn Andersson
2023-07-23 13:48     ` Kathiravan T
2023-07-20  7:04 ` [PATCH V5 3/3] firmware: scm: Modify only the download bits in TCSR register Kathiravan T
2023-07-21 23:15   ` kernel test robot
2023-07-24 19:05   ` Elliot Berman
2023-07-25 10:24     ` Kathiravan T [this message]
2023-07-20  7:08 ` [PATCH V5 0/3] Introduce the read-modify-write API to collect Kathiravan T
2023-07-24 19:05 ` Elliot Berman
2023-07-25  9:55   ` Kathiravan T

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=6b6a383f-4a3a-e55b-dc86-b1abb8c7acab@quicinc.com \
    --to=quic_kathirav@quicinc.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=kvalo@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=quic_anusha@quicinc.com \
    --cc=quic_eberman@quicinc.com \
    --cc=quic_mojha@quicinc.com \
    --cc=quic_poovendh@quicinc.com \
    --cc=quic_saahtoma@quicinc.com \
    --cc=quic_sjaganat@quicinc.com \
    --cc=quic_srichara@quicinc.com \
    /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