From patchwork Mon Oct 2 12:27:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 114595 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp622731qgn; Mon, 2 Oct 2017 05:28:30 -0700 (PDT) X-Received: by 10.98.26.74 with SMTP id a71mr14404907pfa.286.1506947310403; Mon, 02 Oct 2017 05:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506947310; cv=none; d=google.com; s=arc-20160816; b=yCczoe7AQavWhrNaQ5WrhvIVn19jQqQxwCOwvs4piZXpLgwne+z4iGCIKOgOYsJDgG nVTsj/WHI26lbXSQmPiJgeBtCM+fdZNc4v6hXZcA820D0GcJZIK+y23LgT/ZAA/uKZpr wluBz9p70wWBV4aS9c3wp63CwCypZAexKV4AUIRf5ZKjtnFR2cbL+vNSpX/gPHJOMFk2 fZ2jRuQcWxFQ/dN40sNEyWuFkgK+u8c8S+EW41jrqVzNftZmojWRMeOi2EnKuQ9KneZr d1joh3zxIU5DdSjPWmbLTEGmy7Xy2GCVM6nzH7sQD5EEQ9sXPZwSW4PQ4QvkeWSLRrPt Z/JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=S3Fb2IzOMUS8golrDA/aizqMgvi2hQ3w1E2UZawwU5s=; b=SU9yqK1puJGIhYUxkkaDkxM+SdRh26PexJMFu3FwNjhHXTax4BPfCQYXia79Xnj5qM Bt6Pfsdjhi5Rk4Cq72ZHweCG0+CNdbvqrAL3lay5cUB8FOU6AVHBSe/njFG/d2EtxHEj 3eM3ggnupQd0jXBTavVFgpaKY7s/nK79ELW7zo8ak0x5sfBtgSzueAW22ZI4cRx1uxwm hFikUjGXSkc7VMtv+bqm9ywLd3tpkysr9HPmStz5PCVjdNJSCVAQO1NUNOQ9gyJMzX+8 ydOu5bmD2mCPS9wWSnHsi6N8rjBQesvbz50q94Ih2kLi9dlnpfnBgvZgbcSXKNWCPfgh 66ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=c5dW8o8t; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si7605150pgp.757.2017.10.02.05.28.30; Mon, 02 Oct 2017 05:28:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=c5dW8o8t; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751162AbdJBM22 (ORCPT + 6 others); Mon, 2 Oct 2017 08:28:28 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:55708 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750978AbdJBM1w (ORCPT ); Mon, 2 Oct 2017 08:27:52 -0400 Received: by mail-wm0-f49.google.com with SMTP id u138so10228173wmu.4 for ; Mon, 02 Oct 2017 05:27:52 -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=EbXsKbLEj+gX7fv0Fug+KXdSgEQtEkMRgq9xyeaDprM=; b=c5dW8o8tw/c+b+AADPAnVCaNObYtLj8rW0FEy4uf7OP3KT2E2YlZuhBGWCJ08MX2Tn JI0J9fSM6Xj7ElWwYq64OAph/QHeg/qYYHVrGGL7rCF08yzew0lVWJP277WpV5WA9GHG dxqoFDkl76LLsL0B6VGbZg/KSJc2F0RM/6FeJFHFJQdJ42EEyf/RfYT5RBjDiHX8mFyB QH/6E2ZbJ5oC4tncmiy5j7EA2e+qp3LilpjX+rUmjbZWN32/0TRdevvChHclyItW5CmX 480nT2ApF0rolh2joC7rNNeutPrsvvWU2g2K66KJSlfg2ARcP8GJmDWMgcFms3uB1LKC k5+Q== 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=EbXsKbLEj+gX7fv0Fug+KXdSgEQtEkMRgq9xyeaDprM=; b=AZa37rzUvkSsfRyllJ21j9OLcwnQLarPgQFknpM5AiZkYuVjhbVJgL86DWsr+HlqlB /jvQhm3tI9FPkF9x6NRMYBKn7nO1aBNloEIEMw/tX3JSKTDPzQvh4DfIX4uXRXiFn8F0 Hip7URYLWeTUtwA6jYMWbbbwupLqdWV8ZYs0bjEN8UcF6hV89t6jIaux13IvxxrJZdyx aSHNI4XVnWOzoThIZXtAhi+gF0HswnlFnZyOuMG7RSz//sU3iftIxYCBn6BZObc06cWA hQLcH6eeOUPfoc/nFMFYWWQ82sucZwrATZ4VlnhXuWlwqxMKU+HSsIWgv6h1F8vGHhpg WDOw== X-Gm-Message-State: AHPjjUihUBGIs9jmTTCSCiANSRp1Yd6fcaTeREYzi/E7iUfQdh8wXY4p 4EAzOnKoD1+mbNMsz2j30dPSRg== X-Google-Smtp-Source: AOwi7QAg71ZC3QpQFjuNOewv9Iw2wZxkxE1YzJksR8x/DQpgjwStRYOO9ymJGPT2XofxtNSniM7frA== X-Received: by 10.28.109.77 with SMTP id i74mr11344297wmc.67.1506947271073; Mon, 02 Oct 2017 05:27:51 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id u96sm14354287wrc.68.2017.10.02.05.27.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Oct 2017 05:27:50 -0700 (PDT) From: Jerome Brunet To: Ulf Hansson , Carlo Caione , Kevin Hilman Cc: Jerome Brunet , Heiner Kallweit , linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] mmc: meson-gx: make sure the clock is rounded down Date: Mon, 2 Oct 2017 14:27:41 +0200 Message-Id: <20171002122743.32334-2-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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Using CLK_DIVIDER_ROUND_CLOSEST is unsafe as the mmc clock could be rounded to a rate higher the specified rate. Removing this flag ensure that, if the rate needs to be rounded, it will be rounded down. Fixes: 51c5d8447bd7 ("MMC: meson: initial support for GX platforms") Signed-off-by: Jerome Brunet --- drivers/mmc/host/meson-gx-mmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index c885c2d4b904..421c8719c202 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -531,8 +531,7 @@ static int meson_mmc_clk_init(struct meson_host *host) div->shift = __ffs(CLK_DIV_MASK); div->width = __builtin_popcountl(CLK_DIV_MASK); div->hw.init = &init; - div->flags = (CLK_DIVIDER_ONE_BASED | - CLK_DIVIDER_ROUND_CLOSEST); + div->flags = CLK_DIVIDER_ONE_BASED; clk = devm_clk_register(host->dev, &div->hw); if (WARN_ON(IS_ERR(clk)))