Message ID | 20220215162301.1.I5f92544259c3d1dad2df30c9d7762ec7860f07cf@changeid |
---|---|
State | Accepted |
Commit | 212875e707b6bc75780386c2cb28fbac7e2ab8f3 |
Delegated to: | Jaehoon Chung |
Headers | show |
Series | [1/2] mmc: fix error message for unaligned erase request | expand |
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) {
Hi Patrick On 2/15/22 16: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> > --- > > 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) { Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Thanks
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) {
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> --- drivers/mmc/mmc_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)