From patchwork Fri Jun 27 08:51:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 4434141 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 D5AD89F758 for ; Fri, 27 Jun 2014 08:51:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06F8420379 for ; Fri, 27 Jun 2014 08:51:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD2B920384 for ; Fri, 27 Jun 2014 08:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbaF0Ivg (ORCPT ); Fri, 27 Jun 2014 04:51:36 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:35270 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753190AbaF0Ive (ORCPT ); Fri, 27 Jun 2014 04:51:34 -0400 Received: by mail-wg0-f51.google.com with SMTP id x12so4721894wgg.34 for ; Fri, 27 Jun 2014 01:51:33 -0700 (PDT) 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=LqOWO0UpZ5hP3jcKhKLqfAJ5+VCE8W9xc+QAgGyC3tk=; b=KI6ITmaJo9hEH46JrWhyyVi/BXabZWhSuaCen9tyWy0VeS1v2M5dZ3lv8WdIou8YdP Rl/zhxnrdG2zUJx3lOIoN+1YqZARBphyKqegthHp3lJhuaL0+NPjzQHqr81ux7nrQiZT TId/Szi8p1nvhmrTBda1/yeOmRQtHHJvCUR6jFkTpJBvBv5DfuTjFLnfK1VqjYy62WE3 fok2i3nAj7yPDRstMNG8LpYnkP7zcNm5KrRIvIh195yQbXe7Jx/HmJ89CJ95hpuFdxQa i7xNEDgVyzzhS7W7oSEJNzAHHzlP376fbJOn/M3VfZKeQf0QSYp/IPuvB+mgtu+gYSnL olew== X-Received: by 10.180.212.77 with SMTP id ni13mr10456363wic.5.1403859093129; Fri, 27 Jun 2014 01:51:33 -0700 (PDT) Received: from localhost.localdomain (ram94-11-88-187-113-157.fbx.proxad.net. [88.187.113.157]) by mx.google.com with ESMTPSA id fb15sm34056122wid.23.2014.06.27.01.51.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Jun 2014 01:51:32 -0700 (PDT) From: Romain Izard To: Chris Ball , Ulf Hansson , linux-mmc@vger.kernel.org, Derek Simkowiak Cc: Romain Izard Subject: [PATCH v2] =?UTF-8?q?mmc:=20Allow=20forward=20compatibility=20for?= =?UTF-8?q?=20e=E2=8B=85MMC?= Date: Fri, 27 Jun 2014 10:51:07 +0200 Message-Id: <1403859067-21142-1-git-send-email-romain.izard.pro@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <53AC65FF.1010301@webtuner.tv> References: <53AC65FF.1010301@webtuner.tv> 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, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 1ab5f3a0af5b..ac9b8232133c 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];