From patchwork Mon Feb 12 13:13:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10212745 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 3F94260236 for ; Mon, 12 Feb 2018 13:14:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3649A2094F for ; Mon, 12 Feb 2018 13:14:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B09F280CF; Mon, 12 Feb 2018 13:14:23 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 CB29C2094F for ; Mon, 12 Feb 2018 13:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933886AbeBLNOI (ORCPT ); Mon, 12 Feb 2018 08:14:08 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:38623 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933884AbeBLNOG (ORCPT ); Mon, 12 Feb 2018 08:14:06 -0500 Received: by mail-wr0-f195.google.com with SMTP id t94so15121715wrc.5 for ; Mon, 12 Feb 2018 05:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=I9ARiRZjJe4w3Dvm+SaFssVf41svhxCNZAdY0Ruj7jg=; b=od32XmaDNJOw1n82+sfIga6Zgb2Vj8haTbfNU0KsJByjccxhHVYLi3FltIK7M0QQak m7UMGbDBCvDKa+gNxc3qie1SLcZGiTPkr/6kMiz9Va+SkVfGiL05bt0ujhifl9rQTWKF hYKw/+JZzU3rNY9SJ2iS03LxE56oxUM1z207a5TKcq+WKoX5SWZtxfWHgRMfDFFo+4Jg i96hlX3A8XrEmTT1UaLPqXqM+42bqfCNNp0kDHYVDfduDjmY8glRDOPSq4YZI88b81Ve 2JXg80x72005RVlJBn8O8j5BgxVeDh5vDruuA42zop3X5285GYVIZycFfgJjAas/cWmt FgxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=I9ARiRZjJe4w3Dvm+SaFssVf41svhxCNZAdY0Ruj7jg=; b=OKhzcfWSLMXmDlL0p5ag9T3IJbBhw4MA6GM5oXfhg5+soVILhN4y3IafDNixsNwgM6 imo/0ApjUGgp2K7jGtaarS6KRpXBjZ7QV5GbKRKtA0IIViGo8R14vox5dErw/w7WjjX3 JT7sL1GqGIOk1GkX3nRB2vyv8AdV/2ugMh0VHXaQ4k3c2ASv+g0FbObhT1Pg30ogMdOk 5cDG6M2IQ2fJQuaJ7bOOgbpL8kpwGO3IERvd+G0dh2yfkYEdsz09knaasBRKPy9rRvUu E03U5pdbdGp8TJWbkUWDX+uAVrVG7X/LrTB/Tg1aF3n38uj7v3OhyKjnt0Hu+wyYLLyx /jhg== X-Gm-Message-State: APf1xPDHHfiOeJJsNBrm4i+bfgkn7FPWcHDhubCm6JMf3D2yKGbiLRcu ZgOHNP2Q36ho6gUpcTG7TVHE0w== X-Google-Smtp-Source: AH8x227xL7tBB7RNBuTePngsKhgdrH5/hDXAYH71+NzsuNnBQzCKMOJ0ntMT/YwpN+BU3Sq9pKn8+Q== X-Received: by 10.223.197.13 with SMTP id q13mr9150534wrf.235.1518441245280; Mon, 12 Feb 2018 05:14:05 -0800 (PST) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id r189sm9187580wmd.39.2018.02.12.05.14.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 05:14:04 -0800 (PST) From: Jerome Brunet To: Ulf Hansson , Kevin Hilman , Carlo Caione Cc: Jerome Brunet , linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] Revert "mmc: meson-gx: include tx phase in the tuning process" Date: Mon, 12 Feb 2018 14:13:59 +0100 Message-Id: <20180212131359.7741-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 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 This reverts commit 0a44697627d17a66d7dc98f17aeca07ca79c5c20. This commit was initially intended to fix problems with hs200 and hs400 on some boards, mainly the odroid-c2. The OC2 (Rev 0.2) I have performs well in this modes, so I could not confirm these issues. We've had several reports about the issues being still present on (some) OC2, so apparently, this change does not do what it was supposed to do. Maybe the eMMC signal quality is on the edge on the board. This may explain the variability we see in term of stability, but this is just a guess. Lowering the max_frequency to 100Mhz seems to do trick for those affected by the issue Worse, the commit created new issues (CRC errors and hangs) on other boards, such as the kvim 1 and 2, the p200 or the libretech-cc. According to amlogic, the Tx phase should not be tuned and left in its default configuration, so it is best to just revert the commit. Signed-off-by: Jerome Brunet --- drivers/mmc/host/meson-gx-mmc.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 22438ebfe4e6..4f972b879fe6 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -717,22 +717,6 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode, static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) { struct meson_host *host = mmc_priv(mmc); - int ret; - - /* - * If this is the initial tuning, try to get a sane Rx starting - * phase before doing the actual tuning. - */ - if (!mmc->doing_retune) { - ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); - - if (ret) - return ret; - } - - ret = meson_mmc_clk_phase_tuning(mmc, opcode, host->tx_clk); - if (ret) - return ret; return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); } @@ -763,9 +747,8 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); - /* Reset phases */ + /* Reset rx phase */ clk_set_phase(host->rx_clk, 0); - clk_set_phase(host->tx_clk, 270); break;