From patchwork Fri Mar 3 20:00:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9603455 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 B253560414 for ; Fri, 3 Mar 2017 20:01:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A442328631 for ; Fri, 3 Mar 2017 20:01:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9945328633; Fri, 3 Mar 2017 20:01:22 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5A80B28631 for ; Fri, 3 Mar 2017 20:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hwF7/G7o3nEJMuSaCVLyXrdYQtH79Y3kUX9/QY/eHg8=; b=nNxhIvhmSriD1W 6i7XXB/ZU+q4D58wAS9ZknlCszjBRPgBR2WD/iiycHz/gIJ6IT8y9AXBn6xtiHxsUwOxi6r4Z70CR ffMqHBZvPHsPjsFLGNw+QUYD2PbdI4kdlL2EqaWSH0krFa5O+solBsvYbWsXxBHr0g1H5nw501n4m Jn68N8C8Bx2pg6zdAUsQzkG8/d1Mi2RIJaBys6kpIBWoGh15bkvYOuh8t/lT8QbOXKl5lrYI2echq WDEUAGOlBVULH4hrHHQKvhGywSfBBo+eqJaBOAc7dZWX7+5Qn1Ltxb+u2JjL/XxHxGNo0vIKNR1DN CFqxZzZ0JnooCLCdjstg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cjtO9-0007j7-2W; Fri, 03 Mar 2017 20:01:17 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cjtO2-0007RI-D5 for linux-amlogic@lists.infradead.org; Fri, 03 Mar 2017 20:01:12 +0000 Received: by mail-wr0-x242.google.com with SMTP id l37so14500458wrc.3 for ; Fri, 03 Mar 2017 12:00:52 -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=wjh8QhMaU4pqJYlvI3yuRfEyr/RYmXxCsU+hZ0OCV+Q=; b=Zzlf1hZwhrAJPIYwQ6S7bdX6XIjqfSnrH475m8/iNpxVqJy/sAVyYMMbVfn9BBQ6P1 xi46gZfb2xrvJxEoglPYHZWfs/hCCfB5CloPS0lUC8rKcUZtx8/PoQJLhEJcWsUUJwuw FhgAyNkEVy0IVltvygMxkW/TXtadGpwCWBcb5H/y0tGIXqWdJSWujINrIVKeDTDjNjbW ubZfgkx9MXWuT23aTDzZlmuvzfs/hb/rV4AkJ8G9AyXLCHyOEhvYgjB7zMEMNdkpW/Zs VuCinlfPX0qsosYioQrvY/sencyotDa6mjFZW/LdV3zQFRXbhC1Lfwi+jv15CUlWYBeF 3HOA== 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=wjh8QhMaU4pqJYlvI3yuRfEyr/RYmXxCsU+hZ0OCV+Q=; b=A91jEbX02FLQRga8kt7PdWL3Eh00pG/vmIeEhKE6yrcWmtGnPBaYQnC3zJChIX7w0B wCuv9K2OW4XSuL8k5/u/jwbgPQMnOpoicbR0+UEapSHdpo1RUTgJuzIKv9cZ/E1bzNx4 an521lmapXPYoGAR9PxvnDowNnwlf2R6XSYqKERqdTT+iDeTuwkvy1giEWW9z+JXe/z/ mwI7bYSKVKs8Q2KDMAXGbWT4uvxqlvtgAabcealbfWR/dv0e8HLr7i5zWxJH11/SIVNU bjz6eBk9slbnFe9DeEdJrFNRDV8xXVQuPrOmg/FihmlMtb904c5/OfgJDCMNc6acMWHY xdHQ== X-Gm-Message-State: AMke39k/PH+pODd6ShBARDZDKq+l9n+mKb/hzKcTs49MFV4oT/QLBXrHCiJSGiRS00rY5A== X-Received: by 10.223.168.80 with SMTP id l74mr4229651wrc.184.1488571251294; Fri, 03 Mar 2017 12:00:51 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:f903:fe11:afad:80a0? (p200300C6EBDC4000F903FE11AFAD80A0.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:f903:fe11:afad:80a0]) by smtp.googlemail.com with ESMTPSA id w125sm4235898wme.27.2017.03.03.12.00.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2017 12:00:50 -0800 (PST) Subject: [PATCH v4 10/10] mmc: meson-gx: replace magic timeout numbers with constants To: Ulf Hansson , Kevin Hilman References: <62912f3d-2307-cfff-3c69-c8b8ffaeb474@gmail.com> From: Heiner Kallweit Message-ID: Date: Fri, 3 Mar 2017 21:00:22 +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: <62912f3d-2307-cfff-3c69-c8b8ffaeb474@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170303_120110_605276_14C3156D X-CRM114-Status: UNSURE ( 7.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, "linux-mmc@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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 --- 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 5281014e..f244fcf9 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;