From patchwork Mon Oct 2 12:27:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 9980785 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 BBFD460365 for ; Mon, 2 Oct 2017 12:29:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADD2B1FFAD for ; Mon, 2 Oct 2017 12:29:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A29882018F; Mon, 2 Oct 2017 12:29:04 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED 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 455531FFAD for ; Mon, 2 Oct 2017 12:29:04 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=q+xOYaUcagefzoqSzcRCsMgqy1k7byotVjecjYn1Dls=; b=Y8euRXLUbj1GyqsPj4u/U6AaiV g+fimI/9E1YQVysD943yNYapDUNcr3W7KWwZQUXygfluTIwRWOWctmCIa1afEAnYAAp5HvgD2fa7L HS4zP6RgRnxbnw35DZQboODbwic+D+TgOevhRYT7/3mQ/NsZ4FPZubNcPB88lSvjjc7YKiCklBYM/ Eaw7Z6EBdsUFeyGvPM+1VaA/GcmnPkhhHBfr5TBdQaW85tN0SRxpPuXQ8luPOJAZgRE+naIFaMhpp ip2nrnImVDdQI2wYvIPhnnm3V6uN90oUmT3UmZZeMBjfFqOoRpyfzoww1q6QTgNpNYtx0BJB3y42X SaRiitnw==; 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 1dyzqD-00019F-3x; Mon, 02 Oct 2017 12:28:57 +0000 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dyzpW-0000PE-3O for linux-amlogic@lists.infradead.org; Mon, 02 Oct 2017 12:28:18 +0000 Received: by mail-wm0-x22e.google.com with SMTP id q124so10266684wmb.0 for ; Mon, 02 Oct 2017 05:27:53 -0700 (PDT) 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:in-reply-to:references; bh=B5aNHi8LR4Wf2/fXrjR5+cPr5lKC5mPx5dEboI9Wmvo=; b=lnBi7lU3WI+0GRXMWHYo074p53OPMfuMvoykDJba4U/EIP2fDOIaaM+Mq8s78vlwrN 90bD5mkEnF5T0pTlfPX4wot+Daui54D9hmtJZtphvSEejswFsHoa8dHILBbof974mATO o6LwrDj2UYUwBTWt7dSJs7+e0/Bhi80h0C5s7yPTh6GLch30lhe37keERTjLrNOXj6ZN BiK1PuLYklPkLUrAppMj/e5XbXSvVAHExC0UI+ObONxjlGwfPaVoICujF0DrTfA3eFR/ tktqll26HTFbcEsACzpHUaEutf2yOdGLotpAgXUo0vbGC0H/f26p3lrNakdPR1DIYdc/ uOvw== 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:in-reply-to :references; bh=B5aNHi8LR4Wf2/fXrjR5+cPr5lKC5mPx5dEboI9Wmvo=; b=WJg4o87n/b/hcsXTNir8DPh7O6/0akcAJTs7XwYh5JCszY7qdXpN5Meo2qOlXe8LXp /0inK1Tc5byJFlLQDivr7bC98HAx/fIiTLm9QhNf8h0emhOKV0o0UVrjzeU5YT1PMsQY j/m0BgqFkgz6hckXSSZwbuW3LhETUSLBy8hZ93pn7AAEt6tL3cIDeMLKbAfnfwGjUfoo njKGDvXbptDuOm1z283ZuKWAEUmMI6/hJp9muZFLYVlSOdf+xeIgNMj3R41aSzzVKeFj HfEwVZE0IH3nnwDE/oxb7xwz8eHN9L6rThTnMY43La1BLKHjKFsxveab+/AG8AK2Lvt7 BSiA== X-Gm-Message-State: AHPjjUh9SVQFUZbqt36+Q1TLaJHgA+O4713eitvG1GKNet1mIeZZul+F 78cmaZLxcPHPVGLB8LUWevaopw== X-Google-Smtp-Source: AOwi7QCNp0fPjCLDY9b/z8ssOqetHUDVDxYTPrgF4hpJmXD2en0HxRpmZHDJb9WwMsgCavBY8nj2Rg== X-Received: by 10.28.103.195 with SMTP id b186mr11211301wmc.86.1506947272271; Mon, 02 Oct 2017 05:27:52 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id u96sm14354287wrc.68.2017.10.02.05.27.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Oct 2017 05:27:51 -0700 (PDT) From: Jerome Brunet To: Ulf Hansson , Carlo Caione , Kevin Hilman Subject: [PATCH 2/3] mmc: meson-gx: fix rx phase reset Date: Mon, 2 Oct 2017 14:27:42 +0200 Message-Id: <20171002122743.32334-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20171002122743.32334-1-jbrunet@baylibre.com> References: <20171002122743.32334-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171002_052814_321308_8FE2DBFF X-CRM114-Status: GOOD ( 10.59 ) 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-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Jerome Brunet , linux-arm-kernel@lists.infradead.org, Heiner Kallweit MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Resetting the phase when POWER_ON is set the set_ios() call means that the phase is reset almost every time the set_ios() is called, while the expected behavior was to reset the phase on a power cycle. This had gone unnoticed until now because in all mode (except hs400) the tuning is done after the last to set_ios(). In such case, the tuning result is used anyway. In HS400, there are a few calls to set_ios() after the tuning is done, overwriting the tuning result. Resetting the phase on POWER_UP instead of POWER_ON solve the problem. Fixes: d341ca88eead ("mmc: meson-gx: rework tuning function") Signed-off-by: Jerome Brunet --- 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 421c8719c202..08a55c2e96e1 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -745,6 +745,10 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) case MMC_POWER_UP: if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); + + /* Reset rx phase */ + clk_set_phase(host->rx_clk, 0); + break; case MMC_POWER_ON: @@ -758,8 +762,6 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) host->vqmmc_enabled = true; } - /* Reset rx phase */ - clk_set_phase(host->rx_clk, 0); break; }