From patchwork Tue Nov 4 12:26:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 40138 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8FE8B240A6 for ; Tue, 4 Nov 2014 12:28:15 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id f15sf7572418lbj.11 for ; Tue, 04 Nov 2014 04:28:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:date :message-id:subject:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=B6ws1nCPsTQ4WrIAeRGmb2lG6ArjaRR2gIVa2UaVF0E=; b=a0Dko9H/6AZB1bduxfdmEfRyM9+UW/0mCADZZ3CcgGq2BQf66GyqViKlEltsHdC7vr xMYBEjFoYDFqj1gKMqWLVeZMjCtBvYiFuVSBPwPPdJjGc7eYcTmCgFKAsL3Wbme8XBvC Os1GJMAw/xHbg5KmK8vWIF/NUtC1DveSz/7WrfYZGGCwmdI6hl66W+pVFyi1HmvIqjlF iea1LqvzUwxJfSN24u/SEqAD0h6zW3/S51EpfUgQxFJnPqzqcXmBytjMdgkSbg4ygwZE OTstNKAevuyryKCP09eFG1j37wpw+tvTE1G09VJ+QKnAmUk1CSDT/rKfYulMHQ3pHjpO 82GA== X-Gm-Message-State: ALoCoQmpu0VewoZRDllt/NoFvGDkS28WbtsqhplsEY5elhskaS4yyWS0n5kTQbuQ8xA6kb0M8GDY X-Received: by 10.180.101.202 with SMTP id fi10mr4122908wib.7.1415104094416; Tue, 04 Nov 2014 04:28:14 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.5 with SMTP id w5ls889273law.71.gmail; Tue, 04 Nov 2014 04:28:14 -0800 (PST) X-Received: by 10.152.43.97 with SMTP id v1mr58995106lal.3.1415104094255; Tue, 04 Nov 2014 04:28:14 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id 8si433977las.83.2014.11.04.04.28.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 04:28:14 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id ge10so743392lab.8 for ; Tue, 04 Nov 2014 04:28:14 -0800 (PST) X-Received: by 10.152.29.8 with SMTP id f8mr59010002lah.56.1415104094015; Tue, 04 Nov 2014 04:28:14 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp106812lbc; Tue, 4 Nov 2014 04:28:13 -0800 (PST) X-Received: by 10.69.0.230 with SMTP id bb6mr1307099pbd.165.1415104092481; Tue, 04 Nov 2014 04:28:12 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wn5si185502pbc.94.2014.11.04.04.28.10 for ; Tue, 04 Nov 2014 04:28:12 -0800 (PST) Received-SPF: none (google.com: linux-mmc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169AbaKDM2J (ORCPT + 3 others); Tue, 4 Nov 2014 07:28:09 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:37234 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752039AbaKDM2J (ORCPT ); Tue, 4 Nov 2014 07:28:09 -0500 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1XldDG-0004Oh-Ad; Tue, 04 Nov 2014 12:27:58 +0000 Received: from broonie by debutante with local (Exim 4.84) (envelope-from ) id 1XldC7-0000Q7-Bc; Tue, 04 Nov 2014 12:26:43 +0000 From: Mark Brown To: Ben Dooks , Chris Ball , Ulf Hansson Cc: linux-mmc@vger.kernel.org, Mark Brown Date: Tue, 4 Nov 2014 12:26:42 +0000 Message-Id: <1415104002-1580-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.1.1 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mezzanine.sirena.org.uk X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 Subject: [PATCH] mmc: sdhci-s3c: Check if clk_set_rate() succeeds X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: broonie@kernel.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Mark Brown It is possible that we may fail to set the clock rate, if we do so then log the failure and don't bother reprogramming the IP. Signed-off-by: Mark Brown Acked-by: Jaehoon Chung --- drivers/mmc/host/sdhci-s3c.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 0ce6eb17deaf..4f7a63213b33 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -300,6 +300,7 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock) struct device *dev = &ourhost->pdev->dev; unsigned long timeout; u16 clk = 0; + int ret; host->mmc->actual_clock = 0; @@ -311,7 +312,12 @@ static void sdhci_cmu_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_s3c_set_clock(host, clock); - clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock); + ret = clk_set_rate(ourhost->clk_bus[ourhost->cur_clk], clock); + if (ret != 0) { + dev_err(dev, "%s: failed to set clock rate %uHz\n", + mmc_hostname(host->mmc), clock); + return; + } clk = SDHCI_CLOCK_INT_EN; sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);