From patchwork Sat Mar 4 12:37:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9603927 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 17C37602B4 for ; Sat, 4 Mar 2017 12:39:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 080672843F for ; Sat, 4 Mar 2017 12:39:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F10312854F; Sat, 4 Mar 2017 12:39:07 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 ABB782843F for ; Sat, 4 Mar 2017 12:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751370AbdCDMjG (ORCPT ); Sat, 4 Mar 2017 07:39:06 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35309 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751972AbdCDMi5 (ORCPT ); Sat, 4 Mar 2017 07:38:57 -0500 Received: by mail-wm0-f68.google.com with SMTP id z63so4630274wmg.2 for ; Sat, 04 Mar 2017 04:38:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=ms6FYygS0IJxPZQvyyJLRx69SqSSCLmgf+F8pfOZ+BE=; b=jdP1kP4FKyNjmS0Y+Sbt6LT3b63j7wxwljJP7BzAdPlUR0nABfcX5+g7NF+ZFlWBQF ztOodZRPqHjuVC+Z62rcnYorHytqDxD5NTG2VUluT3D/aaHuD+i0KFadJFNUvTOR+IT9 I5hp6JdzQudCe/hhfYNr5pfvJkKL59iurGEGwMLEtMS4uxUKSrjnCttPA5pKirYjJGhG xAL7P7bTluo5yBOC9W8b/XHcL6UUgFxI3KG5fCkdrR3aDwAzZQkN3mrhQjVrzl8i0c6Q jkSnc0sqbLq0bLU4hbgzipaPZz+kBh06zxKmLMicQn73HznQgh2ZT9+mZNV3aD3M6Kjc GFtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ms6FYygS0IJxPZQvyyJLRx69SqSSCLmgf+F8pfOZ+BE=; b=JM8ozS8L9tb8Afx8xjliEGqHgpIWUPGcdClPd3RL5TzmdOULAxbvF4tIp7LhjqfQ8u 1tSh45qIiQ9Cscuq5jOwaXu1NGOdnjNCaT/0L92H8jkqDAjXlOp4J6c5K5QFzMlph1BE 7xdcYrw7X3wPRsDFH8RbuP9Gt/fxfQ+Xz6XcZ0I0R168M6pAjX8rmk8Is+dqxkVcPYbU azS31g8BpZ7+FqdIbIPXMY9WuJIQQGqwquae83x5BEZeZchNGAPgnZ00MWuNKFvBF0Ry /Hr6qcv16Vagl0X4X13N2Uy8o7b6zV36YtRoTlnN8qS/bVolWAz3NAjiAtHrz8pe8Xq+ wdgg== X-Gm-Message-State: AMke39n+J7UsXBeqpKe8vVfBgJj40lUMi8Z8Z1c4ib0JIoSWuT0bQYpjnTVAIVhK2DRoRw== X-Received: by 10.28.196.68 with SMTP id u65mr6860907wmf.8.1488631106029; Sat, 04 Mar 2017 04:38:26 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:98cd:c51c:6f4e:443? (p200300C6EBDC400098CDC51C6F4E0443.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:98cd:c51c:6f4e:443]) by smtp.googlemail.com with ESMTPSA id r82sm6909254wmd.32.2017.03.04.04.38.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Mar 2017 04:38:25 -0800 (PST) Subject: [PATCH v5 10/10] mmc: meson-gx: replace magic timeout numbers with constants To: Ulf Hansson , Kevin Hilman References: Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org From: Heiner Kallweit Message-ID: Date: Sat, 4 Mar 2017 13:37:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: 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 Replace timeout magic numbers with proper constants. Signed-off-by: Heiner Kallweit Acked-by: Kevin Hilman --- v3: - added to patch series v4: - added acked-by v5: - rebased --- drivers/mmc/host/meson-gx-mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index d1826cf8..62597638 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -116,6 +116,8 @@ #define SD_EMMC_CFG_BLK_SIZE 512 /* internal buffer max: 512 bytes */ #define SD_EMMC_CFG_RESP_TIMEOUT 256 /* in clock cycles */ +#define SD_EMMC_CMD_TIMEOUT 1024 /* in ms */ +#define SD_EMMC_CMD_TIMEOUT_DATA 4096 /* in ms */ #define SD_EMMC_CFG_CMD_GAP 16 /* in clock cycles */ #define MUX_CLK_NUM_PARENTS 2 @@ -498,10 +500,10 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) desc->cmd_data = host->bounce_dma_addr & CMD_DATA_MASK; - cmd_cfg_timeout = 12; + cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT_DATA); } else { desc->cmd_cfg &= ~CMD_CFG_DATA_IO; - cmd_cfg_timeout = 10; + cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT); } desc->cmd_cfg |= (cmd_cfg_timeout & CMD_CFG_TIMEOUT_MASK) << CMD_CFG_TIMEOUT_SHIFT;