From patchwork Mon Jan 18 14:28:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 59930 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp2029146lbb; Mon, 18 Jan 2016 06:31:11 -0800 (PST) X-Received: by 10.67.1.164 with SMTP id bh4mr37099170pad.118.1453127471464; Mon, 18 Jan 2016 06:31:11 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qw9si1806512pab.126.2016.01.18.06.31.11; Mon, 18 Jan 2016 06:31:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755406AbcARObG (ORCPT + 29 others); Mon, 18 Jan 2016 09:31:06 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:34422 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755385AbcARObC (ORCPT ); Mon, 18 Jan 2016 09:31:02 -0500 Received: by mail-wm0-f45.google.com with SMTP id u188so106320848wmu.1 for ; Mon, 18 Jan 2016 06:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hV16yTERzWIsAUdd11ZYHiTU0JojptjoOcKKNq2HTcU=; b=OTAu/Ao9kIHeiygNgDWaKvmd+VNjQTJ0rfxOWuqox/N5H+5leDsOsFnwP63GOTtLjD 749bMx8rJWbcGtR6GZm/9fvaZRV/g5FT6zvJVfdLg0sP1KKPCN4XzfJDAgqE+61Gu+3d dROWlXdiilOyGCY/+TEMBaO6XA80yBmnY4mts= 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:in-reply-to :references; bh=hV16yTERzWIsAUdd11ZYHiTU0JojptjoOcKKNq2HTcU=; b=TWiqElaJXYrPq34raU/qt/jL6LUfXCnc/ft55HdzRQYVKKw8z9HRAkiZWucLsOvlWp PhREGiKR4H7usg1p79i2A5K6zHwyB9naIDDQfsnCp77hfrOAhmxPORBlU3V9cthNSITJ j51sGpiFh8wJDbw21K4s0khCsPBLXgMpVuubmRWFwQJXyEv2puH8ztY2KMItit06RIU3 w13HJC+NfMizDVRu8l4aey5EfGYMCfbcB5XSkLkMZxC3JVRaflt4UEHShEM63J2hK4gi CsoheRKovKYO9aCO5iRQKMi4y78jDIs+JAwQPREgTvABqKZHH+t2+fqJcBq5wqtkXPjp 2XYw== X-Gm-Message-State: AG10YOQkBn5UVtrLeUinmQuwMyiUmFDgbmiwe2YTjqhq3oJJBbknG5QbTqYT/eZKfZd1WkJP X-Received: by 10.28.223.67 with SMTP id w64mr14182722wmg.28.1453127460879; Mon, 18 Jan 2016 06:31:00 -0800 (PST) Received: from localhost.localdomain (host81-129-171-44.range81-129.btcentralplus.com. [81.129.171.44]) by smtp.gmail.com with ESMTPSA id e2sm18477554wma.1.2016.01.18.06.30.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jan 2016 06:31:00 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, maxime.coquelin@st.com, mturquette@baylibre.com, sboyd@codeaurora.org, maxime.ripard@free-electrons.com, s.hauer@pengutronix.de, geert@linux-m68k.org, Lee Jones Subject: [PATCH 2/3] clk: WARN_ON about to disable a critical clock Date: Mon, 18 Jan 2016 14:28:50 +0000 Message-Id: <1453127331-20616-3-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453127331-20616-1-git-send-email-lee.jones@linaro.org> References: <1453127331-20616-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Lee Jones --- drivers/clk/clk.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 1.9.1 diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 835cb85..178b364 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -575,6 +575,9 @@ static void clk_core_unprepare(struct clk_core *core) if (WARN_ON(core->prepare_count == 0)) return; + if (WARN_ON(core->prepare_count == 1 && core->flags & CLK_IS_CRITICAL)) + return; + if (--core->prepare_count > 0) return; @@ -680,6 +683,9 @@ static void clk_core_disable(struct clk_core *core) if (WARN_ON(core->enable_count == 0)) return; + if (WARN_ON(core->enable_count == 1 && core->flags & CLK_IS_CRITICAL)) + return; + if (--core->enable_count > 0) return;