The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Yanxin Huang <yanxin.huang@unisoc.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Orson Zhai <orsonzhai@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	huang yanxin <yanxin.huang07@gmail.com>,
	Wenming Wu <wenming.wu@unisoc.com>
Subject: Re: [PATCH 2/3] nvmem: sprd: Fix programming errors in efuse caused by incorrect parameters
Date: Tue, 12 Dec 2023 11:28:45 +0800	[thread overview]
Message-ID: <3487700e-5a26-488b-b955-091661e8aa90@linux.alibaba.com> (raw)
In-Reply-To: <20231208061134.26354-2-yanxin.huang@unisoc.com>



On 12/8/2023 2:11 PM, Yanxin Huang wrote:
> The second argument to sprd_efuse_raw_prog() is the efuse index block
> data, but the data passed in is the efuse block offset, which can cause
> efuse to be programmed to the wrong block.
> 
> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> Signed-off-by: Yanxin Huang <yanxin.huang@unisoc.com>

Good catch.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   drivers/nvmem/sprd-efuse.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> index 24b63620d217..f0880f8fc56d 100644
> --- a/drivers/nvmem/sprd-efuse.c
> +++ b/drivers/nvmem/sprd-efuse.c
> @@ -326,6 +326,7 @@ static int sprd_efuse_write(void *context, u32 offset, void *val, size_t bytes)
>   {
>   	struct sprd_efuse *efuse = context;
>   	bool blk_double = efuse->data->blk_double;
> +	u32 index = offset / SPRD_EFUSE_BLOCK_WIDTH + efuse->data->blk_offset;
>   	bool lock;
>   	int ret;
>   
> @@ -350,7 +351,7 @@ static int sprd_efuse_write(void *context, u32 offset, void *val, size_t bytes)
>   	else
>   		lock = true;
>   
> -	ret = sprd_efuse_raw_prog(efuse, offset, blk_double, lock, val);
> +	ret = sprd_efuse_raw_prog(efuse, index, blk_double, lock, val);
>   
>   	clk_disable_unprepare(efuse->clk);
>   

  reply	other threads:[~2023-12-12  3:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08  6:11 [PATCH 1/3] nvmem: sprd: Fix memory overflow issue during memcpy operation in efuse driver Yanxin Huang
2023-12-08  6:11 ` [PATCH 2/3] nvmem: sprd: Fix programming errors in efuse caused by incorrect parameters Yanxin Huang
2023-12-12  3:28   ` Baolin Wang [this message]
2023-12-08  6:11 ` [PATCH 3/3] nvmem: sprd: Remove the lock operation to support customers being able to program efuse multiple times Yanxin Huang
2023-12-12  3:37   ` Baolin Wang
2023-12-08 11:41 ` [PATCH 1/3] nvmem: sprd: Fix memory overflow issue during memcpy operation in efuse driver Srinivas Kandagatla

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=3487700e-5a26-488b-b955-091661e8aa90@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=wenming.wu@unisoc.com \
    --cc=yanxin.huang07@gmail.com \
    --cc=yanxin.huang@unisoc.com \
    --cc=zhang.lyra@gmail.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