From patchwork Tue Jan 14 21:03:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 3488081 Return-Path: X-Original-To: patchwork-linux-arm@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 758A8C02DC for ; Tue, 14 Jan 2014 21:04:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC10F20221 for ; Tue, 14 Jan 2014 21:04:32 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 9E69E2021E for ; Tue, 14 Jan 2014 21:04:31 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3B9Y-0004hi-3K; Tue, 14 Jan 2014 21:04:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3B9P-0000cO-QD; Tue, 14 Jan 2014 21:03:55 +0000 Received: from mail-qc0-f169.google.com ([209.85.216.169]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3B9N-0000af-81 for linux-arm-kernel@lists.infradead.org; Tue, 14 Jan 2014 21:03:53 +0000 Received: by mail-qc0-f169.google.com with SMTP id w7so185582qcr.0 for ; Tue, 14 Jan 2014 13:03:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version :content-transfer-encoding:to:from:in-reply-to:cc:references :message-id:user-agent:subject:date; bh=0qtDYydMFAB1jBK6O0k07coy9O+HK4sL5dU6PJWV52Y=; b=Ih5qq72S3648sU44ro/LAkb6pJ9nJ0Qcz4saJ4aJeUrXYdhTOf6jwFNDKCwNkr4G4S +TM2Mw9Q8ous7uU0RTg+A+4ffWFhK7NAp5Doj72bPpbuRjkgDKnXrGAfpCBk8Hhot1mF Ycc5stKuSRToE4DsMAMLLrOzYCNcRsdlsaWMouFFzDuvf8jPOwFAaCoaKX2+8LZPk1kW hSiH5mY+46D5MIj4B22fDcKDgey+1kpcK0nzBNYcaxb85lFvSqviUbHrthHjjjcQydYT UKCRD3QV0iaghgEMCsTZvN/ClDcQK8KIy6kv2W+qI/o4b3rzfXqBTCzvLq48WVewDQy/ UnyA== X-Gm-Message-State: ALoCoQlZoL3op/rqwd6xPq8upfYXzvvY2Y29xFJAYeQ8AyhPyel4rB70r8/Bho2gBYz4GbtankaT X-Received: by 10.224.80.8 with SMTP id r8mr6758627qak.88.1389733407516; Tue, 14 Jan 2014 13:03:27 -0800 (PST) Received: from localhost ([2601:9:5900:1fe:80dc:349d:f8d2:35dc]) by mx.google.com with ESMTPSA id w7sm2492745qaj.23.2014.01.14.13.03.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 14 Jan 2014 13:03:26 -0800 (PST) MIME-Version: 1.0 To: Lemon Dai , "Maxime Ripard" From: Mike Turquette In-Reply-To: References: <20140111102843.GU2941@lukather> Message-ID: <20140114210319.4167.62163@quantum> User-Agent: alot/0.3.5 Subject: Re: Add .determine_rate to composite clk Date: Tue, 14 Jan 2014 13:03:19 -0800 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140114_160353_342553_36718976 X-CRM114-Status: GOOD ( 14.67 ) X-Spam-Score: -2.6 (--) Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Quoting Lemon Dai (2014-01-14 06:08:44) > Hi Maxime, > > The commit 107f3198 in Mike's clk-next branch shows that: > (about line 72 in drivers/clk/clk-composite.c) > > } else if (mux_hw && mux_ops && mux_ops->determine_rate) { > mux_hw->clk = hw->clk; > return mux_ops->determine_rate(rate_hw, rate, best_parent_rate, > best_parent_p); > > > It should be fixed as follows, at least for reason that NULL rate_hw > may be used in the old code, > > } else if (mux_hw && mux_ops && mux_ops->determine_rate) { > mux_hw->clk = hw->clk; > - return mux_ops->determine_rate(rate_hw, rate, best_parent_rate, > + return mux_ops->determine_rate(mux_hw, rate, best_parent_rate, > best_parent_p); Hi Lemon Dai, I have applied this fix to clk-next. The patch is below: From ca01f3f60aa864d7ee8124ca597d4010378926b5 Mon Sep 17 00:00:00 2001 From: Mike Turquette Date: Tue, 14 Jan 2014 12:56:01 -0800 Subject: [PATCH] clk: composite: pass mux_hw into determine_rate The composite clock's .determine_rate implementation can call the underyling .determine_rate callback corresponding to rate_hw or the underlying .determine_rate callback corresponding to mux_hw. In both cases we pass in rate_hw, which is wrong. Fixed by passing mux_hw into the correct callback. Reported-by: Lemon Dai Signed-off-by: Mike Turquette --- drivers/clk/clk-composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c index 753d0b7..57a078e 100644 --- a/drivers/clk/clk-composite.c +++ b/drivers/clk/clk-composite.c @@ -71,7 +71,7 @@ static long clk_composite_determine_rate(struct clk_hw *hw, unsigned long rate, best_parent_p); } else if (mux_hw && mux_ops && mux_ops->determine_rate) { mux_hw->clk = hw->clk; - return mux_ops->determine_rate(rate_hw, rate, best_parent_rate, + return mux_ops->determine_rate(mux_hw, rate, best_parent_rate, best_parent_p); } else { pr_err("clk: clk_composite_determine_rate function called, but no mux or rate callback set!\n");