Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2337933imu; Sat, 10 Nov 2018 12:34:07 -0800 (PST) X-Google-Smtp-Source: AJdET5dfLj/9L73zzTOE8C9dTu1SkiYGLbH2yr47Iul56jzcgLw5v4kumFaim3bwOrehqgom5Bdm X-Received: by 2002:a62:2cca:: with SMTP id s193-v6mr9141670pfs.10.1541882047070; Sat, 10 Nov 2018 12:34:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541882047; cv=none; d=google.com; s=arc-20160816; b=z8eWPg3WUbyoFMxSHYsYUiSAFZ58v8WlTdEtonXxB+FYI8/wppGSf1+8Zj+MaAUeWY 4r6fgsrdwLq9xym5z02uvLpw5o6sCgeiXCT9yAqNSxzryrzzAQFI5FGJjBcGyvdr4Egi 2bIHJFJhTz0cbl0bAU0C7/RYJNy6jUdw7IMm2x+XWx5uotvpMjeBynujbxwcDyZHR4UU rwkKHVIP3d9mcQyF0Y5refsbB8mYdGOUXJl1g6DXZnfmVcDsVSm5S77/9DYzCB4ETVa4 rH2yTwM2GtnuGzuBllZ84d7O9lHQEG3KwXNVpwWHhjPptBzM56AOas9t2kzzQfIqOqpp lkYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=bkT6Tvgpqv1f+bqR/z7UZurhOG3dEwgC/MQ7DiTqGn0=; b=i0TvINhlV7TZoUvH0kJytFAAnjVwDGqb+xw2AuXewQLIR+lmy6tBOmRv/sy+7BwtPw nG98/XfBYVcOfPWvkNB78+8ij8NGi/CZXwp9n7VK/KN3jI92ZQEb7rRV2FOuKVALqkA+ eX6iOHMOFA7KMgY1NdnL5AHvAKoiSKjvp2aeorQO6fRwB3OdtssRbeE1ZhzAVz2twZxs d7FQILSS3j+67S48nhUZxRalFsFW/Q0VtXxdaia4a0J4IduxfPTs3rbSXgH3a+4jlsQn iYeHfAXl8mLCFbAhK7V1ftYGglTLNI0b8KtRTa8ledOhDf4s3VP5AYgdzdsHHrP/O7+k taCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=as+EzBEV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d66-v6si12706382pfc.92.2018.11.10.12.33.51; Sat, 10 Nov 2018 12:34:07 -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; dkim=fail header.i=@kemnade.info header.s=20180802 header.b=as+EzBEV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726495AbeKKGRv (ORCPT + 99 others); Sun, 11 Nov 2018 01:17:51 -0500 Received: from mail.andi.de1.cc ([85.214.239.24]:55176 "EHLO h2641619.stratoserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbeKKGRv (ORCPT ); Sun, 11 Nov 2018 01:17:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20180802; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bkT6Tvgpqv1f+bqR/z7UZurhOG3dEwgC/MQ7DiTqGn0=; b=as+EzBEVbE5PEBH8tav8ZjqVh OWO73h29oavst3j58voN17vUJlsDtdfWuwhc5M3QxZjXvU9ENM6XBoVAY3fnXQs19PNJrcYii+0ba zAgQtYDGwPfYVeQhLrrlB9aLDS/3yhILf60GRIYIWRe9XNSQXWGOGAOjDZxYJpQIEWkcA=; Received: from p200300ccfbcefb001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:fbce:fb00:1a3d:a2ff:febf:d33a] helo=aktux) by h2641619.stratoserver.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLZul-0000Ay-UL; Sat, 10 Nov 2018 21:31:32 +0100 Received: from andi by aktux with local (Exim 4.89) (envelope-from ) id 1gLZul-0003Ts-L2; Sat, 10 Nov 2018 21:31:31 +0100 From: Andreas Kemnade To: t-kristo@ti.com, mturquette@baylibre.com, sboyd@kernel.org, linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, bcousson@baylibre.com, paul@pwsan.com, tony@atomide.com, letux-kernel@openphoenux.org Cc: Andreas Kemnade Subject: [PATCH v2 2/3] clk: ti: check clock type before doing autoidle ops Date: Sat, 10 Nov 2018 21:31:14 +0100 Message-Id: <20181110203115.13335-3-andreas@kemnade.info> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181110203115.13335-1-andreas@kemnade.info> References: <20181110203115.13335-1-andreas@kemnade.info> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Code might use autoidle api with clocks not being omap2 clocks, so check if clock type is not basic Signed-off-by: Andreas Kemnade --- New in v2 --- drivers/clk/ti/autoidle.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/clk/ti/autoidle.c b/drivers/clk/ti/autoidle.c index 161f67850393..5bdae5552d38 100644 --- a/drivers/clk/ti/autoidle.c +++ b/drivers/clk/ti/autoidle.c @@ -54,8 +54,12 @@ static DEFINE_SPINLOCK(autoidle_spinlock); int omap2_clk_deny_idle(struct clk *clk) { struct clk_hw_omap *c; + struct clk_hw *hw = __clk_get_hw(clk); - c = to_clk_hw_omap(__clk_get_hw(clk)); + if (clk_hw_get_flags(hw) & CLK_IS_BASIC) + return -EINVAL; + + c = to_clk_hw_omap(hw); if (c->ops && c->ops->deny_idle) { unsigned long irqflags; @@ -77,8 +81,12 @@ int omap2_clk_deny_idle(struct clk *clk) int omap2_clk_allow_idle(struct clk *clk) { struct clk_hw_omap *c; + struct clk_hw *hw = __clk_get_hw(clk); - c = to_clk_hw_omap(__clk_get_hw(clk)); + if (clk_hw_get_flags(hw) & CLK_IS_BASIC) + return -EINVAL; + + c = to_clk_hw_omap(hw); if (c->ops && c->ops->allow_idle) { unsigned long irqflags; -- 2.11.0