Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp402532ybg; Thu, 19 Mar 2020 01:49:12 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu+w6gfLF0H5p6xs5Ej2W/dAWZDfWbtPcVt5ck4QDdSF/PYnBk52HZ/Vj2/8Fk7AiVqMNw7 X-Received: by 2002:a05:6830:10b:: with SMTP id i11mr1277221otp.99.1584607752665; Thu, 19 Mar 2020 01:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584607752; cv=none; d=google.com; s=arc-20160816; b=dPjDdccWqXgj1/IYuru87uSiewtv0+N2oCrPRlIKnGWzd1L6R9kny0R2oExF5kJ5zY rXW3PW769nUlVNM2aGX65eV4ZwWG+WBFaG/Kqi45QtmfF4TKwpUtgOkuIbx30BL/c/tU d3JRcLAVjxFzmgCtSeFeNZq4qfycCDynMmgqxGrRxan60cC2Hz65QEOT5B/yFd6Luf8p dxTfOaTDt1gZniYiTcus5jQJ2cJy5RXwbROBdlSRBkqsPF/AE8DF9A5f3jZCvlMAEE/J 7/H7IpWq6d/072JK3Kc2Ag1UWJOlDF2Pu51wpaQwAgb5/H5coUBYWXSDGnMEzwqh8Lp7 gg4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=yDRwctUiCelU2ObqIXPgue3LTFKdBPRBwAY8V0ujeTI=; b=tk9siH/tE59+yvZPEZN0x/LBUfeMBQtFvpsi43lam92khN4Ysy6CGMF8JFccugDuZE RhJmkbF4c/DP00xq6SFrlgJnPJKr2B+95DoHTvLLsVhjTujpAFGJUClw5BWfpFue5WaD h4WrmLxYqVTHHPwqabMV7mrPwwJuE1ieYsYmQ/JS9jp5XJz4rxmcbDArjjNtsDmwpnSn lbOLJurPsOKFB7H5gCbnUU1HXO4ayKVVZ3uRcLmrzTswMp9x4/qydr2oglc9HQvQrLYW q/Tv8B46DjSKM6VaKPQYeZYM7zDxbSDQk/02PqsAjm1T3M8CTuBunSMwn31SBdWvVYb6 vrDA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si906322otn.251.2020.03.19.01.49.00; Thu, 19 Mar 2020 01:49:12 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727326AbgCSIsY (ORCPT + 99 others); Thu, 19 Mar 2020 04:48:24 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59805 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbgCSIsE (ORCPT ); Thu, 19 Mar 2020 04:48:04 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jEqqH-00031l-S8; Thu, 19 Mar 2020 09:47:54 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 252261C229E; Thu, 19 Mar 2020 09:47:52 +0100 (CET) Date: Thu, 19 Mar 2020 08:47:51 -0000 From: "tip-bot2 for Suman Anna" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/drivers/timer-ti-dm: Drop bogus omap_dm_timer_of_set_source() Cc: Tony Lindgren , Tero Kristo , Neil Armstrong , "H. Nikolaus Schaller" , Bartosz Golaszewski , Keerthy , Ladislav Michl , Pavel Machek , Sebastian Reichel , Suman Anna , Lokesh Vutla , Daniel Lezcano , x86 , LKML In-Reply-To: <20200213053504.22638-1-s-anna@ti.com> References: <20200213053504.22638-1-s-anna@ti.com> MIME-Version: 1.0 Message-ID: <158460767187.28353.4410336602856187146.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the timers/core branch of tip: Commit-ID: 753e83408b7f2980b7a5bfcf01f1175a937a2340 Gitweb: https://git.kernel.org/tip/753e83408b7f2980b7a5bfcf01f1175a937a2340 Author: Suman Anna AuthorDate: Wed, 12 Feb 2020 23:35:04 -06:00 Committer: Daniel Lezcano CommitterDate: Thu, 27 Feb 2020 10:32:11 +01:00 clocksource/drivers/timer-ti-dm: Drop bogus omap_dm_timer_of_set_source() The function omap_dm_timer_of_set_source() was originally added in commit 31a7448f4fa8a ("ARM: OMAP: dmtimer: Add clock source from DT"), and is designed to set a clock source from DT using the clocks property of a timer node. This design choice is okay for clk provider nodes but otherwise is a bad design as typically the clocks property is used to specify the functional clocks for a device, and not its parents. The timer nodes now all define a timer functional clock after the conversion to ti-sysc and the new clkctrl layout, and this results in an attempt to set the same functional clock as its parent when a consumer driver attempts to acquire any of these timers in the omap_dm_timer_prepare() function. This was masked and worked around in commit 983a5a43ec25 ("clocksource: timer-ti-dm: Fix pwm dmtimer usage of fck reparenting"). Fix all of this by simply dropping the entire function. Any DT configuration of clock sources should be achieved using assigned-clocks and assigned-clock-parents properties provided by the Common Clock Framework. Cc: Tony Lindgren Cc: Tero Kristo Cc: Neil Armstrong Cc: H. Nikolaus Schaller Cc: Bartosz Golaszewski Cc: Keerthy Cc: Ladislav Michl Cc: Pavel Machek Cc: Sebastian Reichel Signed-off-by: Suman Anna Tested-by: Lokesh Vutla Tested-by: Tony Lindgren Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200213053504.22638-1-s-anna@ti.com --- drivers/clocksource/timer-ti-dm.c | 33 +------------------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c index acc9360..6a0adb7 100644 --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -138,35 +138,6 @@ static int omap_dm_timer_reset(struct omap_dm_timer *timer) return 0; } -static int omap_dm_timer_of_set_source(struct omap_dm_timer *timer) -{ - int ret; - struct clk *parent; - - /* - * FIXME: OMAP1 devices do not use the clock framework for dmtimers so - * do not call clk_get() for these devices. - */ - if (!timer->fclk) - return -ENODEV; - - parent = clk_get(&timer->pdev->dev, NULL); - if (IS_ERR(parent)) - return -ENODEV; - - /* Bail out if both clocks point to fck */ - if (clk_is_match(parent, timer->fclk)) - return 0; - - ret = clk_set_parent(timer->fclk, parent); - if (ret < 0) - pr_err("%s: failed to set parent\n", __func__); - - clk_put(parent); - - return ret; -} - static int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) { int ret; @@ -276,9 +247,7 @@ static int omap_dm_timer_prepare(struct omap_dm_timer *timer) __omap_dm_timer_enable_posted(timer); omap_dm_timer_disable(timer); - rc = omap_dm_timer_of_set_source(timer); - if (rc == -ENODEV) - return omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ); + rc = omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ); return rc; }