From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2F41C47094 for ; Thu, 10 Jun 2021 13:43:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7FCCB613B3 for ; Thu, 10 Jun 2021 13:43:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FCCB613B3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=pascalroeleven.nl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To: Subject:Cc:To:From:Date:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CtFVgMtTfW3r7CvuJ/wHtCB4rTGqhjTb4eelroqmQY4=; b=Fn2lWdfglpwd9x ElnDE7kd6B7ocgmCI/J/cH+FLuFIVjAG0weyPm1frBHXzdi7lSTu7zwspvUXNedAt4BgWN6uOgQpb nSyICaaXSa93kAWju3Q9SznvzyKcwRzqFgYp/TQlXloKS5Eg4rp5HeQ317ToAd+XaXcCg/beqEroR IIIsCiguM2hd+tEeMLLzXmEVgdrtj6wAjaN+0c2rFVS6M5csnHuAV/jqJIu2er/KQg0EHeXMAKigo jG8ex8UZ71VgOMz+a2D+U1FL4Wz1SiYZk1Z3ZHEELEPF4lgT77BWLroCYu07vbdI9jipONl/AtZbZ zjKi8jSt1qfJPoL2WCAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrKw6-000uTf-16; Thu, 10 Jun 2021 13:41:30 +0000 Received: from pmg01-out3.zxcs.nl ([2a06:2ec0:1:b::ffeb]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrKw1-000uRu-Q3 for linux-arm-kernel@lists.infradead.org; Thu, 10 Jun 2021 13:41:28 +0000 Received: from pmg01.zxcs.nl (localhost.localdomain [127.0.0.1]) by pmg01.zxcs.nl (ZXCS) with ESMTP id F258510562D; Thu, 10 Jun 2021 15:41:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pascalroeleven.nl; s=x; h=Content-Transfer-Encoding:Content-Type:Message-ID :References:In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=J7BYOV3zpefWkAu9B9rGYhAKW1ymqNGvJk9qXTZ3fm8=; b=Fnj3Kf6oQ6udqaTrf2rT63ksli UFtUc05M59I8CpolR6SbTloiYykr1KmVxfkBTEQ0KksfyqsQhQh2rPXOg8uRe9HgU2MbUdfE7RX43 OhzPL8J3azkjyQtOY7DeiwVLp9QQnhvRVMj2pguz1wXFE5PH1aMaJraDwPdDKYfhzHd6R8IGErevx 6TQdYdta2OYTdKRViZm1o6ewnZHFw08UgqPH/VxoFIaG8Ih306NkmQ4BdyoNPD7QRd+nEDjHW6kGb wxNqnl0SCjugcnwzVVuGhJfBQbG4kPzTbrZNq7xQ0fnDhRaAAM2rF4AVHr3bII4sS7ngUYmnVdQal 1DdEpEaQ==; MIME-Version: 1.0 Date: Thu, 10 Jun 2021 15:41:15 +0200 From: Pascal Roeleven To: Roman Beranek Cc: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Thierry Reding , Emil Lenngren , Lee Jones , Maxime Ripard , Chen-Yu Tsai , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-sunxi@googlegroups.com Subject: Re: [PATCH 6/6] pwm: sun4i: don't delay if the PWM is already off In-Reply-To: <20210531044608.1006024-7-roman.beranek@prusa3d.com> References: <20210531044608.1006024-1-roman.beranek@prusa3d.com> <20210531044608.1006024-7-roman.beranek@prusa3d.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: dev@pascalroeleven.nl X-Forwarded-For: roman.beranek@prusa3d.cz X-AuthUser: dev@pascalroeleven.nl X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210610_064126_425263_14D2DE51 X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-05-31 06:46, Roman Beranek wrote: > Signed-off-by: Roman Beranek > --- > drivers/pwm/pwm-sun4i.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c > index 6ab06b9749d0..88bd90498d1f 100644 > --- a/drivers/pwm/pwm-sun4i.c > +++ b/drivers/pwm/pwm-sun4i.c > @@ -304,7 +304,7 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, > struct pwm_device *pwm, > > sun4i_pwm_writel(sun4i_pwm, ctrl, PWM_CTRL_REG); > > - if (state->enabled) { > + if (state->enabled || !cstate.enabled) { > mutex_unlock(&sun4i_pwm->ctrl_lock); > return 0; > } Btw, this now leaves the gate open if the controller is currently disabled and we are only changing the period register and staying disabled. This becomes an issue because we always expect the gate to be disabled when the controller is disabled. Regards, Pascal _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel