public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Patrick Delaunay <patrick.delaunay@foss.st.com>, u-boot@lists.denx.de
Cc: Peng Fan <peng.fan@nxp.com>,
	U-Boot STM32 <uboot-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH 1/2] mmc: fix error message for unaligned erase request
Date: Wed, 16 Mar 2022 16:51:19 +0900	[thread overview]
Message-ID: <9490c25d-e9bf-e151-e8d7-fe0d23a07e2e@samsung.com> (raw)
In-Reply-To: <20220215162301.1.I5f92544259c3d1dad2df30c9d7762ec7860f07cf@changeid>

On 2/16/22 00:23, Patrick Delaunay wrote:
> Fix the end address in the message for unaligned erase request in
> mmc_berase() when start + blkcnt is aligned to erase_grp_size.
> 
> for example:
>   - start = 0x2000 - 26
>   - count = 26
>   - erase_grp_size = 0x400
> 
>   Caution! Your devices Erase group is 0x400
>   The erase range would be change to 0x2000~0x27ff
> 
> But no issue when the end address is not aligned, for example
>   - start = 0x2000 - 2 * 26
>   - count = 26
>   - erase_grp_size = 0x400
> 
>   Caution! Your devices Erase group is 0x400
>   The erase range would be change to 0x2000~0x23ff
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
> 
>  drivers/mmc/mmc_write.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
> index d23b7d9729..eab94c7b60 100644
> --- a/drivers/mmc/mmc_write.c
> +++ b/drivers/mmc/mmc_write.c
> @@ -102,7 +102,7 @@ ulong mmc_berase(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt)
>  		       "The erase range would be change to "
>  		       "0x" LBAF "~0x" LBAF "\n\n",
>  		       mmc->erase_grp_size, start & ~(mmc->erase_grp_size - 1),
> -		       ((start + blkcnt + mmc->erase_grp_size)
> +		       ((start + blkcnt + mmc->erase_grp_size - 1)
>  		       & ~(mmc->erase_grp_size - 1)) - 1);
>  
>  	while (blk < blkcnt) {


  parent reply	other threads:[~2022-03-16  7:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220215152338epcas1p2880ad243ab3e035ec077670cce6476ca@epcas1p2.samsung.com>
2022-02-15 15:23 ` [PATCH 1/2] mmc: fix error message for unaligned erase request Patrick Delaunay
2022-02-15 15:23   ` [PATCH 2/2] env: mmc : align erase address and size on erase_grp_size Patrick Delaunay
2022-03-23  8:49     ` [Uboot-stm32] " Patrice CHOTARD
2022-03-16  7:51   ` Jaehoon Chung [this message]
2022-03-23  8:43   ` [Uboot-stm32] [PATCH 1/2] mmc: fix error message for unaligned erase request Patrice CHOTARD

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=9490c25d-e9bf-e151-e8d7-fe0d23a07e2e@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-stm32@st-md-mailman.stormreply.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