Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp7095751ybf; Fri, 6 Mar 2020 10:15:17 -0800 (PST) X-Google-Smtp-Source: ADFU+vsmQYM3Goa6ypEa0FpFwBo0NgnB7m3g/qcbncv480WiNmJ8PVnME3iQCnPZ1E9Erx6u6Brn X-Received: by 2002:a05:6830:160c:: with SMTP id g12mr3642219otr.86.1583518517579; Fri, 06 Mar 2020 10:15:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583518517; cv=none; d=google.com; s=arc-20160816; b=BAj1tXSOC5pk38Hq2M3daZz8LGlFxrqyd5RfLoDNmsIEtG5xvR88bqBVfgburb7eap ZxUb0B4ILoOhcjMIQmpR5ZA6K08iB4r/Z51ThKBsrYwhjSCBp4rSf/qhU6WrTYl5MSnz 2GOPUpdiPS/4vkxxvoPGEezJq3Bvz8Pm9yjsqMRXOsZtYeTKPy1sQVcAs31Xmh48teLz okW8/nNE3XCjnV5mB0Ptcw5E7ChI/pPJtD1UJ+OXNKjairrDtpS0MKfGq+5rf2wWL38k 1dmMSOnERLC1YARezA1dexyPp04C9q3Bpwy8SVsWoComkkr/5irMdBA9u8JwaDF9xWJV 8jvw== 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=jwn2DtlNZLC3EPZajDl/xJmfFDlD2H9B/QAIAukQ/0w=; b=dB9PKPYpMcaMASlhQN7YI+D55qCL4SJ9FmmmMzcYmEylg0Nl1doCQnaaXX1ft+8D/n 7f4e/GHZyMBRQo2QjoXdk/KJzAbolY+edg5gwg0l1I33RHceIPC0UwbFyilKK10CE0YN uWatXPsHuDnOLF7cW7f4mtFN44xVZrLZedGghLseHTkgYFH3zpxtAEZau4u30DVUUuvG Od76kDs2FQDbCo71TzDZurbS0+V/9euv/iZCL4tDcNTFoPvBhIuAuDEbvRQ7uoA+tUAy ZrhYZ8ccot9qdLxCvxw3FRM00Tsx9lnsN8/03ZF7FI/6KIo0n+4uasXfApxZtidmnmle +8hw== 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 p11si1888004ota.240.2020.03.06.10.15.04; Fri, 06 Mar 2020 10:15:17 -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; 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 S1726269AbgCFSOr (ORCPT + 99 others); Fri, 6 Mar 2020 13:14:47 -0500 Received: from muru.com ([72.249.23.125]:59204 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgCFSOr (ORCPT ); Fri, 6 Mar 2020 13:14:47 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id D761D8027; Fri, 6 Mar 2020 18:15:31 +0000 (UTC) Date: Fri, 6 Mar 2020 10:14:43 -0800 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: <20200306181443.GJ37466@atomide.com> References: <20200228095651.32464-1-lokeshvutla@ti.com> <20200228095651.32464-5-lokeshvutla@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200228095651.32464-5-lokeshvutla@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Lokesh Vutla [200228 09:58]: > pwm_omap_dmtimer_disable() calls .stop callback which abruptly stops the > timer counter. This doesn't complete the current pwm cycle and > immediately disables the pwm. Instead disable the auto reload > functionality which allows to complete the current pwm cycle and then > disables the timer. > > Signed-off-by: Lokesh Vutla > --- > drivers/pwm/pwm-omap-dmtimer.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c > index bc338619232d..89b3c25d02b8 100644 > --- a/drivers/pwm/pwm-omap-dmtimer.c > +++ b/drivers/pwm/pwm-omap-dmtimer.c > @@ -93,8 +93,16 @@ static void pwm_omap_dmtimer_disable(struct pwm_chip *chip, > { > struct pwm_omap_dmtimer_chip *omap = to_pwm_omap_dmtimer_chip(chip); > > + /* > + * Disable auto reload so that the current cycle gets completed and > + * then the counter stops. > + */ > mutex_lock(&omap->mutex); > - omap->pdata->stop(omap->dm_timer); > + omap->pdata->set_pwm(omap->dm_timer, > + pwm_get_polarity(pwm) == PWM_POLARITY_INVERSED, > + true, OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE, > + false); > + > mutex_unlock(&omap->mutex); > } I'm seeing an issue with this patch where after use something is left on and power consumption stays higher by about 30 mW after use. I can reproduce this easily on droid4 with Sebastian's rumble-test app[0]. After use, I sometimes also hear the vibrator keep chirping quietly, so there seems to be some pwm still happening after disable :) Reloading modules for pwm-vibra and pwm-omap-dmtimer make the power consumption go back down again. If you have a scope set up, maybe check the lines are quiet after disable after this patch? Regards, Tony [0] https://git.collabora.com/cgit/user/sre/rumble-test.git/plain/rumble-test.c