From patchwork Fri Nov 29 08:38:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 3256741 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1FDF89F384 for ; Fri, 29 Nov 2013 08:39:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D132F2065B for ; Fri, 29 Nov 2013 08:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5BF02065A for ; Fri, 29 Nov 2013 08:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273Ab3K2IjH (ORCPT ); Fri, 29 Nov 2013 03:39:07 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:47832 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751136Ab3K2IjG (ORCPT ); Fri, 29 Nov 2013 03:39:06 -0500 Received: by mail-wi0-f178.google.com with SMTP id ca18so1755145wib.5 for ; Fri, 29 Nov 2013 00:39:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=ofzBJz/WidMOaYEO/Ay8OIZ40g3YtTxd5MM7m5yqWZA=; b=gQ+pfbCOay0ruMgfe1sVtDs93c68fWowf4DnwFODS5o6zHlKq0m0ZegcX/Crh858BU TYz6Re73N1QynBsOFzJPIGwsN0vFtr+P5NTr0Gq9ZbIZZU/Sm3ThiBpbhZBSUAOENK6S X5EgaB2q07JFFKx5gf5MYlWH1lOqRJ8gC9TPJhsvjzYbh3L9tvZ50mu0jl4LRi6khN5i TXKWc4pwkjQ4IAAB0hNH2ZFnOaL8zHxN0fTLfwsrxMPFZibauahow1z/GWaF2gKncUvz JPfFra7GbqX4KmFN6WtR/ZM7DeSYgj+cMTeV/gptzLDjsikt3DLARpRWvwNnj/AqRXKt 1yIQ== X-Received: by 10.180.185.101 with SMTP id fb5mr5802156wic.11.1385714344970; Fri, 29 Nov 2013 00:39:04 -0800 (PST) Received: from localhost.localdomain (ram94-11-88-187-113-157.fbx.proxad.net. [88.187.113.157]) by mx.google.com with ESMTPSA id y20sm5072996wib.0.2013.11.29.00.39.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Nov 2013 00:39:04 -0800 (PST) From: Romain Izard To: Chris Ball Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Romain Izard Subject: [PATCH] =?UTF-8?q?mmc:=20Allow=20forward=20compatibility=20for=20?= =?UTF-8?q?e=E2=8B=85MMC?= Date: Fri, 29 Nov 2013 09:38:37 +0100 Message-Id: <1385714317-28911-1-git-send-email-romain.izard.pro@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <867gbsjzmf.fsf@void.printf.net> References: <867gbsjzmf.fsf@void.printf.net> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Ulf Hansson --- 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];