From patchwork Thu Apr 12 01:02:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 7753 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A974D23E29 for ; Thu, 12 Apr 2012 01:07:50 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 72098A18142 for ; Thu, 12 Apr 2012 01:07:50 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so2812921iag.11 for ; Wed, 11 Apr 2012 18:07:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:x-gm-message-state; bh=ojNzDBMs6EJ2busL7267Wz/weW1+uUNWC4RQ0N2LCYA=; b=pKeu8XS6wIkGz96SmBVtrGdQKf7kuQZADRAcmIvL7YVvUlM7oZIRWkqQk1qlHdYF6i rvpNTtnMnvJrPCdI8c7zvOAHTXbdVWY1ApS8vTbzwbiHXVNYJy9XbOXMtXMS36VNfyP6 9ksNcVIPIBAZ9duzyWAJOVWzJmCP+pFLpgULLK2wwmB5ogwlk1Y3Jaivbk5Th4jUmSiP 9t4etj7tDhagGXF3cr+kb04gD/OUB4NGijwvt5izc2ntosZp1TRl7+Kr0R2yG6IAjN8Z SLG0QPMbIRWh8Qa//+OnnHSPhOWrbMzOOlcKTeDwlMfH3jr1G9PGpfnTiuNascoCGQfg DSdw== Received: by 10.50.168.67 with SMTP id zu3mr333015igb.28.1334192870175; Wed, 11 Apr 2012 18:07:50 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.164.217 with SMTP id f25csp161864iby; Wed, 11 Apr 2012 18:07:49 -0700 (PDT) Received: by 10.182.232.38 with SMTP id tl6mr720929obc.16.1334192868946; Wed, 11 Apr 2012 18:07:48 -0700 (PDT) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com. [192.94.94.40]) by mx.google.com with ESMTPS id ip10si1784579obb.72.2012.04.11.18.07.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Apr 2012 18:07:48 -0700 (PDT) Received-SPF: neutral (google.com: 192.94.94.40 is neither permitted nor denied by best guess record for domain of mturquette@linaro.org) client-ip=192.94.94.40; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.94.94.40 is neither permitted nor denied by best guess record for domain of mturquette@linaro.org) smtp.mail=mturquette@linaro.org Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q3C17WBI018228; Wed, 11 Apr 2012 20:07:32 -0500 Received: from DFLE70.ent.ti.com (dfle70.ent.ti.com [128.247.5.40]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q3C17Wq5002578; Wed, 11 Apr 2012 20:07:32 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle70.ent.ti.com (128.247.5.40) with Microsoft SMTP Server id 14.1.323.3; Wed, 11 Apr 2012 20:07:32 -0500 Received: from nucleus.nsc.com (nucleus.nsc.com [10.188.36.112]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id q3C17Pn2005839; Wed, 11 Apr 2012 20:07:30 -0500 From: Mike Turquette To: CC: , , , , Mike Turquette , Olof Johansson , Russell King , Sascha Hauer , Shawn Guo , Richard Zhao , Saravana Kannan , Mark Brown , Andrew Lunn , Rajendra Nayak , Viresh Kumar Subject: [PATCH 01/13] clk: core: correct clk_set_rate kerneldoc Date: Wed, 11 Apr 2012 18:02:39 -0700 Message-ID: <1334192572-12499-2-git-send-email-mturquette@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1334192572-12499-1-git-send-email-mturquette@linaro.org> References: <1334192572-12499-1-git-send-email-mturquette@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmPkWdZjH1O9hUvk864We8TJP3B8TGgwQ3aNwmJ62dTSx9tjkdhXZuMr+d2o5oy78Yvq5U5 Remove old and misleading documentation from the previous clk_set_rate implementaion. Reported-by: Shawn Guo Signed-off-by: Mike Turquette Cc: Arnd Bergman Cc: Olof Johansson Cc: Russell King Cc: Sascha Hauer Cc: Shawn Guo Cc: Richard Zhao Cc: Saravana Kannan Cc: Mark Brown Cc: Andrew Lunn Cc: Rajendra Nayak Cc: Viresh Kumar --- drivers/clk/clk.c | 41 +++++++++++------------------------------ 1 files changed, 11 insertions(+), 30 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 9cf6f59..3ed36d3 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -859,38 +859,19 @@ static void clk_change_rate(struct clk *clk) * @clk: the clk whose rate is being changed * @rate: the new rate for clk * - * In the simplest case clk_set_rate will only change the rate of clk. + * In the simplest case clk_set_rate will only adjust the rate of clk. * - * If clk has the CLK_SET_RATE_GATE flag set and it is enabled this call - * will fail; only when the clk is disabled will it be able to change - * its rate. + * Setting the CLK_SET_RATE_PARENT flag allows the rate change operation to + * propagate up to clk's parent; whether or not this happens depends on the + * outcome of clk's .round_rate implementation. If *parent_rate is unchanged + * after calling .round_rate then upstream parent propagation is ignored. If + * *parent_rate comes back with a new rate for clk's parent then we propagate + * up to clk's parent and set it's rate. Upward propagation will continue + * until either a clk does not support the CLK_SET_RATE_PARENT flag or + * .round_rate stops requesting changes to clk's parent_rate. * - * Setting the CLK_SET_RATE_PARENT flag allows clk_set_rate to - * recursively propagate up to clk's parent; whether or not this happens - * depends on the outcome of clk's .round_rate implementation. If - * *parent_rate is 0 after calling .round_rate then upstream parent - * propagation is ignored. If *parent_rate comes back with a new rate - * for clk's parent then we propagate up to clk's parent and set it's - * rate. Upward propagation will continue until either a clk does not - * support the CLK_SET_RATE_PARENT flag or .round_rate stops requesting - * changes to clk's parent_rate. If there is a failure during upstream - * propagation then clk_set_rate will unwind and restore each clk's rate - * that had been successfully changed. Afterwards a rate change abort - * notification will be propagated downstream, starting from the clk - * that failed. - * - * At the end of all of the rate setting, clk_set_rate internally calls - * __clk_recalc_rates and propagates the rate changes downstream, - * starting from the highest clk whose rate was changed. This has the - * added benefit of propagating post-rate change notifiers. - * - * Note that while post-rate change and rate change abort notifications - * are guaranteed to be sent to a clk only once per call to - * clk_set_rate, pre-change notifications will be sent for every clk - * whose rate is changed. Stacking pre-change notifications is noisy - * for the drivers subscribed to them, but this allows drivers to react - * to intermediate clk rate changes up until the point where the final - * rate is achieved at the end of upstream propagation. + * Rate changes are accomplished via tree traversal that also recalculates the + * rates for the clocks and fires off POST_RATE_CHANGE notifiers. * * Returns 0 on success, -EERROR otherwise. */