Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2943042rwb; Fri, 9 Dec 2022 08:07:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wNuu6halx4+HzfRXwgVBMwEdp+i4uIRygsY1wcf3gXG0dFEj2iT/9Wqb+Lz1KPeh5Bjqj X-Received: by 2002:a05:6a20:9395:b0:9d:efbe:206d with SMTP id x21-20020a056a20939500b0009defbe206dmr10018572pzh.35.1670602040935; Fri, 09 Dec 2022 08:07:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670602040; cv=none; d=google.com; s=arc-20160816; b=g+nCYOp0mfHHBcb/ekJj976Lcol7RSoeRBhCRrom1GroZqOcpGXJVwFblZCAljPxcH A8JyFZTmcNklKgOGDWmvtecrMgjKF2bTjKCHcxk3V8xMvSGD6KKD4IwUodmmlpTsa43F v5B/gPy6Lrh3twGfhuHzxh0dnGihhkJnLNh7Xj2fq7OJj7YFrszHIMT/e0/AEtMQKugq YZBMXmLDIaTrffGHY6lU18XPjnDlVTnhBATgD3pimY3+Cwb4JUtqH/Ty7cbyuFi4RQpB 6PN4cmn1Ogeb9p6lZ8m/bepc+bzOS2ItJp6dgJWOABSje4RRZ44drSsaSUPlri6YaP28 zFXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=/L89Jisaszb2KZ82TACDoQmvI8vtjDwMU2HkvQaUgm0=; b=Lcu6uadrn82WfxTtvWRIeriLRgBN/XLLtvkdsfQmVFG9khyynQjhEKIPwV05xXdzqU 5qT+yxy3+JGwK7+Z8+V/JRc7BnN9gjeaQLhcEjV/4f+PbWmQikkbV07OwGvzutH2oz6w cf+Zw5uG/eYKo46CbxfX2i4jaVuhECo6jWaO9AHYtXWccI7iIN6u5ISdmdkOylFK3zkn UHkNpNfsMlvPHvSGuoKYyZ11Esp35egFA7x/4wTl38hogaeNcAhsm6sjmpgx7sCNnl2i VjnCMBeZBg7/XjII6VKwhz2byoXEOEQ0t7z3Ygnl9km0V0uzZJoJGrvuX3+cCGp8N3E5 tafg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=S7Y6R39e; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=PN78vMFW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w64-20020a638243000000b00478b13ff34bsi1654511pgd.419.2022.12.09.08.07.09; Fri, 09 Dec 2022 08:07:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=S7Y6R39e; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=PN78vMFW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230436AbiLIPri (ORCPT + 76 others); Fri, 9 Dec 2022 10:47:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbiLIPrZ (ORCPT ); Fri, 9 Dec 2022 10:47:25 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65FDC37F88; Fri, 9 Dec 2022 07:47:24 -0800 (PST) Date: Fri, 09 Dec 2022 15:47:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670600843; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/L89Jisaszb2KZ82TACDoQmvI8vtjDwMU2HkvQaUgm0=; b=S7Y6R39e9P/x5NKovC5IoWgzZQ4Y1wkgA9CAiiWy2ru1BPXObHRQtSGlcggzjtnlD4lcCU ekQcTcyXTo07hQYbOCii6ZpFIcOWZBq2jNrCZsCuUgwKuPyYF/9xaKq9mino29wBmz8b7Q F1UXynSCE42fK2HYP02wIAT7e/xCoynmxWW1Fc7zNl0SPzZqKcx7xG/Fq0J4gEr4iGLK0Y EeEdCvZcts0v7nolfMY8HRGHsv9un9NHrQzbhdHwp3bTziPExZBkpSLNsNpFl4L+kI2A7B gMTVqEWLgqTXwUF4pSjRXSw+La+pCqy2JXZ5KmpRSj5+KeDWTm0LT3pid/pY1A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670600843; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/L89Jisaszb2KZ82TACDoQmvI8vtjDwMU2HkvQaUgm0=; b=PN78vMFWIOUWyZeaEeVZXX8aaF/ZGgZfvNzkiFQO6YGONsaf6nYP0KpO8a8+LPLc20g4w7 /viSSxfOftcrPnAg== From: "tip-bot2 for Tony Lindgren" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/drivers/timer-ti-dm: Clear settings on probe and free Cc: Tony Lindgren , Daniel Lezcano , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221028103813.40783-1-tony@atomide.com> References: <20221028103813.40783-1-tony@atomide.com> MIME-Version: 1.0 Message-ID: <167060084277.4906.10637289144406021448.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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: 822963b96dfdb72ec4fb1395fbdfa778656b49d1 Gitweb: https://git.kernel.org/tip/822963b96dfdb72ec4fb1395fbdfa778656b49d1 Author: Tony Lindgren AuthorDate: Fri, 28 Oct 2022 13:38:13 +03:00 Committer: Daniel Lezcano CommitterDate: Fri, 02 Dec 2022 13:16:46 +01:00 clocksource/drivers/timer-ti-dm: Clear settings on probe and free Clear the timer control register on driver probe and omap_dm_timer_free(). Otherwise we assume the consumer driver takes care of properly initializing timer interrupts on PWM driver module reload for example. AFAIK this is not currently needed as a fix, I just happened to run into this while cleaning up things. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20221028103813.40783-1-tony@atomide.com Signed-off-by: Daniel Lezcano --- drivers/clocksource/timer-ti-dm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c index eeeeb3c..b24b903 100644 --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -633,6 +633,8 @@ static struct omap_dm_timer *omap_dm_timer_request_by_node(struct device_node *n static int omap_dm_timer_free(struct omap_dm_timer *cookie) { struct dmtimer *timer; + struct device *dev; + int rc; timer = to_dmtimer(cookie); if (unlikely(!timer)) @@ -640,6 +642,17 @@ static int omap_dm_timer_free(struct omap_dm_timer *cookie) WARN_ON(!timer->reserved); timer->reserved = 0; + + dev = &timer->pdev->dev; + rc = pm_runtime_resume_and_get(dev); + if (rc) + return rc; + + /* Clear timer configuration */ + dmtimer_write(timer, OMAP_TIMER_CTRL_REG, 0); + + pm_runtime_put_sync(dev); + return 0; } @@ -1135,6 +1148,10 @@ static int omap_dm_timer_probe(struct platform_device *pdev) goto err_disable; } __omap_dm_timer_init_regs(timer); + + /* Clear timer configuration */ + dmtimer_write(timer, OMAP_TIMER_CTRL_REG, 0); + pm_runtime_put(dev); }