From patchwork Thu May 7 14:44:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 6358871 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 52CD8BEEE1 for ; Thu, 7 May 2015 14:44:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CD6620225 for ; Thu, 7 May 2015 14:44:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58A73201CD for ; Thu, 7 May 2015 14:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751596AbbEGOok (ORCPT ); Thu, 7 May 2015 10:44:40 -0400 Received: from muru.com ([72.249.23.125]:49701 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751394AbbEGOok (ORCPT ); Thu, 7 May 2015 10:44:40 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 4B73F8084; Thu, 7 May 2015 14:45:49 +0000 (UTC) Date: Thu, 7 May 2015 07:44:37 -0700 From: Tony Lindgren To: Stephen Boyd Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michael Turquette , Paul Walmsley , Tero Kristo , Tomeu Vizoso Subject: Re: [PATCH] ARM: OMAP2+: Fix bogus struct clk comparison for timer clock Message-ID: <20150507144437.GA15563@atomide.com> References: <1430848941-27106-1-git-send-email-tony@atomide.com> <20150506053539.GA10871@codeaurora.org> <20150506145539.GI21061@atomide.com> <554AB1E3.2000304@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <554AB1E3.2000304@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 * Stephen Boyd [150506 17:30]: > On 05/06/15 07:55, Tony Lindgren wrote: > >> I don't think the coccinelle script was ever merged... > > > Oh OK, but the wrong comparisons in the kernel code got > > fixed, right? > > Yes the ones that mattered were fixed. OK thanks for confirming that. > > Thanks here's an updated version with that. > > Are you taking this through arm-soc? Yes that's the plan. > > --- a/arch/arm/mach-omap2/timer.c > > +++ b/arch/arm/mach-omap2/timer.c > > @@ -298,7 +298,7 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, > > if (IS_ERR(src)) > > return PTR_ERR(src); > > > > - if (clk_get_parent(timer->fclk) != src) { > > + if (!clk_is_match(clk_get_parent(timer->fclk), src)) { > > r = clk_set_parent(timer->fclk, src); > > I also wonder why we can't just call clk_set_parent() and skip the "is > the parent already src" check? > > If there's a good reason for not just calling clk_set_parent() then it > makes sense to do the clk_is_match() thing, and you can have my ack > > Acked-by: Stephen Boyd Good point. We've been unconditionally calling it anyways and nobody has complained of any issues. So let's just remove the check. Regards, Tony 8< ---------------------- From: Tony Lindgren Date: Tue, 5 May 2015 09:03:34 -0700 Subject: [PATCH] ARM: OMAP2+: Remove bogus struct clk comparison for timer clock With recent changes to use determine_rate, the comparison of two clocks won't work without clk_is_match that does __clk_get_hw on the clocks first. As we've been unconditionally already calling clk_set_parent already because of the bogus comparison, let's just remove the check as suggested by Stephen Boyd . Cc: Michael Turquette Cc: Paul Walmsley Cc: Stephen Boyd Cc: Tero Kristo Cc: Tomeu Vizoso Signed-off-by: Tony Lindgren Acked-by: Stephen Boyd --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -298,14 +298,11 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, if (IS_ERR(src)) return PTR_ERR(src); - if (clk_get_parent(timer->fclk) != src) { - r = clk_set_parent(timer->fclk, src); - if (r < 0) { - pr_warn("%s: %s cannot set source\n", __func__, - oh->name); - clk_put(src); - return r; - } + r = clk_set_parent(timer->fclk, src); + if (r < 0) { + pr_warn("%s: %s cannot set source\n", __func__, oh->name); + clk_put(src); + return r; } clk_put(src);