From patchwork Tue Oct 14 16:39:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 5081031 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3E878C11AC for ; Tue, 14 Oct 2014 16:40:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DE1720154 for ; Tue, 14 Oct 2014 16:39:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8699F20127 for ; Tue, 14 Oct 2014 16:39:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xe58f-0004gI-Qf; Tue, 14 Oct 2014 16:39:57 +0000 Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xe58P-0004Tj-B5 for linux-rockchip@lists.infradead.org; Tue, 14 Oct 2014 16:39:42 +0000 Received: by mail-pd0-f176.google.com with SMTP id fp1so7734188pdb.21 for ; Tue, 14 Oct 2014 09:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=yRPhIVyDoBIFcpTKHoKmP2SVjmUvDY8CXPtbPGvKSNg=; b=b0kguFYmKJjkVysfQ19tBmY4TkVaRBDE4xq1nI7CAnlU8O8iPY3YSC24Us1QbNeQYr bg3j9pMK7Y9cqEsMI/bM7oaL5rUw9vbeR0CmJpOMGOOxC9MFatscevM2YbKOxUjhCZoV s1mn5Gg4kRRoo6bKZvhIcECfYl9p9c9dhmTb4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yRPhIVyDoBIFcpTKHoKmP2SVjmUvDY8CXPtbPGvKSNg=; b=TUIHaL8lBdwiDS4lIR06JWuYUGBBb5ylnBR0BgxX8JNanR4zb/LgeuW8IwDLSj/Ul9 6j+J0dlwSiztpdPp/KQKjqQ0DBnL4W/RrMU3gksymjCtSKgsUBkCRj2IRj/mmLCqHJ5M GMsvwPSwISMrPUUmJTStbccqjuzNrWUdhof0bMwCA8/h12ujxFIzZ1ChZVu/NUUd9O14 cJjbgyIziBhPngi00KB8f2jHMjr903WOUu++aAHX8aJxnOZD+katl506gdacf2pAj+yN HhwOQlpW67e3WVHcJLDWYcbFQYKkaWL0KvGZ7cvRyaMSFRgcsgr+/5hY3aYF0IYY45bI qGeA== X-Gm-Message-State: ALoCoQmAbr8BNf4yLRzIS/lOybamZWlR2mN/moKq+hDlfWO6kYIL6J8GLD3er/lvk/gp2zgYR1mk X-Received: by 10.70.38.165 with SMTP id h5mr6171550pdk.121.1413304759410; Tue, 14 Oct 2014 09:39:19 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.162.15]) by mx.google.com with ESMTPSA id db7sm14718599pdb.27.2014.10.14.09.39.17 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 14 Oct 2014 09:39:18 -0700 (PDT) From: Doug Anderson To: Ulf Hansson , Seungwon Jeon , Jaehoon Chung Subject: [PATCH] mmc: dw_mmc: rockchip: Don't recalc the clock when it goes off Date: Tue, 14 Oct 2014 09:39:12 -0700 Message-Id: <1413304752-7823-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141014_093941_415596_5800C0E8 X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Addy Ke , heiko@sntech.de, Andrew Bresticker , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, Doug Anderson , chris@printf.net, linux-rockchip@lists.infradead.org, Alim Akhtar , Sonny Rao , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The "set_ios" function is called with a clock of 0 when the clock is turning off. There's no reason to go through all the extra Rockchip logic (whose goal is to make sure DIV is 0 or 1) in that case. The Rockchip logic happened to work because the CCF will pick the lowest possible rate when you ask it for a clock of 0, but it's silly to go through all the remuxing and adjusting for no reason. Signed-off-by: Doug Anderson Acked-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc-rockchip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index f0c2cb1..bbb4ec3 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -37,6 +37,9 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios) unsigned int cclkin; u32 bus_hz; + if (ios->clock == 0) + return; + /* * cclkin: source clock of mmc controller * bus_hz: card interface clock generated by CLKGEN