diff mbox

mmc: Allow forward compatibility for e?MMC

Message ID 1385714317-28911-1-git-send-email-romain.izard.pro@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Romain Izard Nov. 29, 2013, 8:38 a.m. UTC
As stated by the e?MMC 5.0 specification, a chip should not be rejected
only because of the revision stated in the EXT_CSD_REV field of the
EXT_CSD register.

Remove the control on this value, the control of the CSD_STRUCTURE field
should be sufficient to reject future incompatible changes.

Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
---
 drivers/mmc/core/mmc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Ulf Hansson Nov. 29, 2013, 9:55 a.m. UTC | #1
On 29 November 2013 09:38, Romain Izard <romain.izard.pro@gmail.com> wrote:
> As stated by the e?MMC 5.0 specification, a chip should not be rejected
> only because of the revision stated in the EXT_CSD_REV field of the
> EXT_CSD register.
>
> Remove the control on this value, the control of the CSD_STRUCTURE field
> should be sufficient to reject future incompatible changes.
>
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
>  drivers/mmc/core/mmc.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index f631f5a9bf79..73b43574e1b4 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -293,13 +293,12 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
>                 }
>         }
>
> +       /*
> +        * The EXT_CSD format is meant to be forward compatible. As long
> +        * as CSD_STRUCTURE does not change, all values for EXT_CSD_REV
> +        * are authorized, see JEDEC JESD84-B50 section B.8.
> +        */
>         card->ext_csd.rev = ext_csd[EXT_CSD_REV];
> -       if (card->ext_csd.rev > 7) {
> -               pr_err("%s: unrecognised EXT_CSD revision %d\n",
> -                       mmc_hostname(card->host), card->ext_csd.rev);
> -               err = -EINVAL;
> -               goto out;
> -       }
>
>         card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0];
>         card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1];
> --
> 1.8.3.2
>
--
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
diff mbox

Patch

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index f631f5a9bf79..73b43574e1b4 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -293,13 +293,12 @@  static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
 		}
 	}
 
+	/*
+	 * The EXT_CSD format is meant to be forward compatible. As long
+	 * as CSD_STRUCTURE does not change, all values for EXT_CSD_REV
+	 * are authorized, see JEDEC JESD84-B50 section B.8.
+	 */
 	card->ext_csd.rev = ext_csd[EXT_CSD_REV];
-	if (card->ext_csd.rev > 7) {
-		pr_err("%s: unrecognised EXT_CSD revision %d\n",
-			mmc_hostname(card->host), card->ext_csd.rev);
-		err = -EINVAL;
-		goto out;
-	}
 
 	card->ext_csd.raw_sectors[0] = ext_csd[EXT_CSD_SEC_CNT + 0];
 	card->ext_csd.raw_sectors[1] = ext_csd[EXT_CSD_SEC_CNT + 1];