diff mbox

mmc: core: Fix the incorrect calculation for erase unit size.

Message ID 1315461565-16009-1-git-send-email-tgih.jun@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Seungwon Jeon Sept. 8, 2011, 5:59 a.m. UTC
Erase unit size of high capacity is multiple of 512KiB not 1024KiB.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
 drivers/mmc/core/mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Kyungmin Park Sept. 8, 2011, 6:39 a.m. UTC | #1
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>

On Thu, Sep 8, 2011 at 2:59 PM, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> Erase unit size of high capacity is multiple of 512KiB not 1024KiB.
>
> Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
> ---
>  drivers/mmc/core/mmc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index b148bb1..7991ecf 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -332,7 +332,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
>                card->ext_csd.hc_erase_timeout = 300 *
>                        ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT];
>                card->ext_csd.hc_erase_size =
> -                       ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 10;
> +                       ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 9;
>
>                card->ext_csd.rel_sectors = ext_csd[EXT_CSD_REL_WR_SEC_C];
>
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chris Ball Sept. 8, 2011, 1:19 p.m. UTC | #2
Hi,

On Thu, Sep 08 2011, Seungwon Jeon wrote:
> Erase unit size of high capacity is multiple of 512KiB not 1024KiB.

Could we have some more info, please?  What are the visible symptoms
of the erase unit size being incorrect, how did you realize this was
a problem, should this patch be applied to stable@, etc.

Thanks,

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index b148bb1..7991ecf 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -332,7 +332,7 @@  static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 		card->ext_csd.hc_erase_timeout = 300 *
 			ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT];
 		card->ext_csd.hc_erase_size =
-			ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 10;
+			ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] << 9;

 		card->ext_csd.rel_sectors = ext_csd[EXT_CSD_REL_WR_SEC_C];