Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1871907ybh; Fri, 13 Mar 2020 08:51:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvo4gc62s2UWczlyx8mAY6EevOc+Kdjjrq1igemgmzaiPtwyAExbUZEUe5avFlvDsoH4qle X-Received: by 2002:aca:1015:: with SMTP id 21mr391033oiq.101.1584114686208; Fri, 13 Mar 2020 08:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584114686; cv=none; d=google.com; s=arc-20160816; b=ySiP2Obmb0Hgq3saPo1j80udOwJsdZjh549NDy3oVrSgxaY30bR3Wpmdyj3qQind69 UWXo0YcF15CwYoEEwH3IhucbXaqZKJSzohKGaTkO012sZWa2dQ/MQxnakjzikiMElBXZ qJRsFYq9XZ81ZpFCl7i+i5+lsxAWRrrKMz6/VOj1gB3jlLOyNwhHaKjJUUj93LtvkitD GMRyzCvsqn1V7R2B3q/HL/mkSdLM3CJFNGR3+qjbB+pdkFdffrlQLMnv5B6DiCKpAhY7 ti1LXaaKobislq6PXQ5OkShMN32u7uHQYgO4JQfCe02mc15PO6R69h+hVLWguKTELaHh oZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=iaZHahnDCmAhRjDnGw9MKP5Jp1WQuPlAD+M6wv+1b4s=; b=D3kcsbFjSH19PiGOznPmAXmGzC6qG2mNeiBWrMfXsWHPdBxNNzUNwLs3ScOAqNtLRs GvNjn1j79jx+rf9DbMioaWj5zfELBoQCqmVGwLx6zG7xhl32Lv3vEOc9owb+Ve6SkQCO XE2KhkIxGV7gSLn+gw1O767vPePLDGNuwMsem4Y/fNueDAckbwxNyEHmrm17cfLoFL05 ZSKYUrqjor5Uxv//mSsiBvrS79aZFGZ/kN7u5Jxd4DDIlBFODvmJRUSUXQhOj5ULu1eW +JK27WrXAXyT4ES/XPlk7dZS3JyHU5ONJqeU563pFlQYGB43Edaa6d6xS9ldBaixJYty ddlA== 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 4si361591oil.222.2020.03.13.08.51.13; Fri, 13 Mar 2020 08:51:26 -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 S1727075AbgCMPux (ORCPT + 99 others); Fri, 13 Mar 2020 11:50:53 -0400 Received: from muru.com ([72.249.23.125]:60076 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbgCMPux (ORCPT ); Fri, 13 Mar 2020 11:50:53 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 73F988087; Fri, 13 Mar 2020 15:51:38 +0000 (UTC) Date: Fri, 13 Mar 2020 08:50:49 -0700 From: Tony Lindgren To: Lokesh Vutla Cc: Thierry Reding , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Linux OMAP Mailing List , linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, Sekhar Nori , Vignesh R , Sebastian Reichel Subject: Re: [PATCH v2 4/6] pwm: omap-dmtimer: Fix pwm disabling sequence Message-ID: <20200313155049.GE37466@atomide.com> References: <20200228095651.32464-1-lokeshvutla@ti.com> <20200228095651.32464-5-lokeshvutla@ti.com> <20200306181443.GJ37466@atomide.com> <9129d4fe-a17e-2fa6-764c-6a746fa5096d@ti.com> <20200309180123.GP37466@atomide.com> <666dbb7a-db98-d16a-ee73-27d353d2a317@ti.com> <20200310155242.GT37466@atomide.com> <296e28b7-7925-5dfa-ce5a-c0b2a2f1c2e0@ti.com> <20200312005849.GY37466@atomide.com> <20200313153449.GD37466@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200313153449.GD37466@atomide.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tony Lindgren [200313 15:35]: > * Tony Lindgren [200312 00:59]: > > * Lokesh Vutla [200311 04:14]: > > > However, I see an issue with the patch itself as pm_runtime is not disabled > > > after the pwm is stopped. Not sure how that could be nullified with this approach. > > > > Hmm yeah not sure what could be used to clear things > > when the current cycle is completed unless there's > > some interrupt for it. > > You could enable pm_runtime_use_autosuspend() for pwm use, > then set the timeout to the cycle length, then in the > runtime_suspend make sure the enable bit is cleared if > requested. > > But this too seems inaccurate, it would be best to clear > the enable bit on some cycle completion interrupt if > such thing is available. I think enabling pm_runtime_use_autosuspend() for pwm, adding a flag for pwm_enabled, and blocking cpu_pm if pwm_enabled is set might do the trick though. Then clear pwm_enabled flag in runtime_suspend if set. This depend on cpuidle respecting NOTIFY_BAD that I fixed in the recent thread: [PATCH 0/3] Block idle in gpio-omap with cpu_pm Regards, Tony