From patchwork Wed Aug 2 03:12:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9875793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 92DAC60390 for ; Wed, 2 Aug 2017 03:13:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E6BC283C8 for ; Wed, 2 Aug 2017 03:13:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 822DD28703; Wed, 2 Aug 2017 03:13:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2403A283C8 for ; Wed, 2 Aug 2017 03:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751600AbdHBDNL (ORCPT ); Tue, 1 Aug 2017 23:13:11 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:44529 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751562AbdHBDNL (ORCPT ); Tue, 1 Aug 2017 23:13:11 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.193]) by lucky1.263xmail.com (Postfix) with ESMTP id 01DE3E69; Wed, 2 Aug 2017 11:13:09 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 8EBB43D9; Wed, 2 Aug 2017 11:13:07 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: ulf.hansson@linaro.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <7304fdd57ecf43e65c6c6e63b06c8be6> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from unknown (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith SMTP id 12991BVKCUR; Wed, 02 Aug 2017 11:13:08 +0800 (CST) From: Shawn Lin To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, Shawn Lin Subject: [PATCH 2/2] mmc: core: not need to check timeout for SDHC Date: Wed, 2 Aug 2017 11:12:43 +0800 Message-Id: <1501643563-16094-2-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501643563-16094-1-git-send-email-shawn.lin@rock-chips.com> References: <1501643563-16094-1-git-send-email-shawn.lin@rock-chips.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Per the SD physical layer simplified specification V4.10, section 4.6.2, the taac and nasc for SDHC are always fixed and the software should use the recommended value for timeout. When parsing the CSD, we sanely set them to zero for SDHC, the additional check of SDHC in mmc_set_data_timeout is bogus since all the calculation for timeout_ns and timeout_clk is zero as well, so the we could safely remove it and let the following check to cover it. Signed-off-by: Shawn Lin --- drivers/mmc/core/core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 6177eb0..bcd72b4 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -761,14 +761,10 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) limit_us = 100000; /* - * SDHC cards always use these fixed values. + * Assign limit value if invalid. Note that for the SDHC case, + * we set taac and nasc to zero when parsing CSD, so it's safe + * to fall through here. */ - if (timeout_us > limit_us || mmc_card_blockaddr(card)) { - data->timeout_ns = limit_us * 1000; - data->timeout_clks = 0; - } - - /* assign limit value if invalid */ if (timeout_us == 0) data->timeout_ns = limit_us * 1000; }