Message ID | 20231004175414.1738475-1-florian.fainelli@broadcom.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp305524vqb; Wed, 4 Oct 2023 10:54:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4QVYR4ccYs/Il8L1QkwbQ9qVolj2sLTpIG2UcnWC0GXTEmtQqSb3tgAGxvrcGyvdJPjtZ X-Received: by 2002:a05:6a20:914b:b0:140:c838:2b2e with SMTP id x11-20020a056a20914b00b00140c8382b2emr3377252pzc.22.1696442068411; Wed, 04 Oct 2023 10:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696442068; cv=none; d=google.com; s=arc-20160816; b=fROMWF++DNiuZTOgPHq0H86Uoh+gDwxFQW6ra6rEKk9fqfpUkUqMgAgUfk1H4XVBR0 ke5Rm+eIc0OA7yfcRKoFSXlk/rlGuqResp9zLmPwExhrr7V5r/17c7sRiW7af0QqFroe TKskB8qgx47SNbZGUEEKODzc1NTk06nXJJC98YHXLgBu971v/udc5QRJDiAM9JF+8uAd pIQAXTjesoPMbVzXGjkxMXFOUWvuCrMPyiW1BKom3rfj4cIpOOmvWJDeF7g5UrTh96V7 kleBSTlbfCjnDTncnrXzKoVTSTgInlzkJTbMF97aCe2MwOrbxHUAw+FLyGR2FTkC9cdE 7hcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=FFfm8ArjM+x2wcc8brMUA0lCTR62EjvsgnqA1tXi/ak=; fh=ukLWpqxpmQjf8a6hwmV0SAAI+5S4wp7qD8KaFky6zk8=; b=hux+3S0T7NUjUEP4zabDxoIvpr6Ll1RaUNNOdwSAmr2RUWPzrGDJnzQlcaoxAHpR7e hj8TjvS6/xP4B+eD9Gkm/fIyoez11oD89Xih46FtoGdgVAnFwss3w79EFzX7gpmHONnj mofm0DWVsVUO7c4v1WnXDIgKvoHwL3gJsnPuye8KuqMTHCzY7HIdKQw+pbafXflVWTGk 9t3IdzZNNDEJYh0bOCOQpMFx4eByFBfg0+sI6YhdDDuUpvFa46WpXMQcrlOfn+x1cs+7 Z/mCAljdib2MJQJ/2WRpGxxk1CKvNsNrVL8zJGcZqV8GbG9BTwAMGCvvdFxvsPELurCR lBdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=GljeX4Oz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bd20-20020a056a00279400b0068fe7c4147esi3955759pfb.391.2023.10.04.10.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=GljeX4Oz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B9E208239E97; Wed, 4 Oct 2023 10:54:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233946AbjJDRyY (ORCPT <rfc822;ezelljr.billy@gmail.com> + 19 others); Wed, 4 Oct 2023 13:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233149AbjJDRyX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 13:54:23 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DA09E for <linux-kernel@vger.kernel.org>; Wed, 4 Oct 2023 10:54:19 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c6219307b2so152605ad.1 for <linux-kernel@vger.kernel.org>; Wed, 04 Oct 2023 10:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1696442059; x=1697046859; darn=vger.kernel.org; h=mime-version:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=FFfm8ArjM+x2wcc8brMUA0lCTR62EjvsgnqA1tXi/ak=; b=GljeX4Oz4PNMy1BYv0N0GjE64MfJb4IE7cZY+YrDgNtt9xIxr1saleuldcudSLmcm1 UncVrFrOD/uRgdQWiBhAS4ObxLhRaBHwdopFHWnhUfqSp6U1gC1VrIunr4BL2SAaMtWK cBUZL1uQYbXDfWpqUXr9h5TsQQJ90S3/8bRDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696442059; x=1697046859; h=mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FFfm8ArjM+x2wcc8brMUA0lCTR62EjvsgnqA1tXi/ak=; b=dMnS8dNHGvBZi69ZVNZ8uhRk9hRXlxb9oYzW4Wxz4SzfuyOKN4o5OQ/4wbXpmoeojD Hb7+E/VnKhsz11qXxB+WsG5JEVAFlJMFfSW4oLHIJnyVxBCMExHwGTth1JgVyjpL4RHf +JxZc3RMe677xS4UXvuiKOS+1pTUB2GWSOK6xB7DhSncvtlqANQ/qzSbgWwCHHq/IdPq dSoNeI44+HzZgc0Lvch/S7Z56iABt8yGBc6y4DafjZMtM4z7luo5rnk1x+kCG1GVVsjf tYqkdYBRifjFtffyzoa9Pa0jHUtsfsPoUd/Z92RTLLl1NSNd0N83FRNkG2nQZhoVP2V3 s/5w== X-Gm-Message-State: AOJu0YzcYj9+uBMkvwsjlE4wnqBj487IP5LlHvAchBn7teXlPaggGunQ XM9yMyXvdi2U9pfoPr6dQS/fJkDDJ6mQHp7VaIA= X-Received: by 2002:a17:902:ce8b:b0:1bc:7441:d81a with SMTP id f11-20020a170902ce8b00b001bc7441d81amr3597033plg.6.1696442059415; Wed, 04 Oct 2023 10:54:19 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id g6-20020a170902c38600b001b567bbe82dsm4008921plg.150.2023.10.04.10.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 10:54:18 -0700 (PDT) From: Florian Fainelli <florian.fainelli@broadcom.com> To: linux-pwm@vger.kernel.org Cc: Florian Fainelli <florian.fainelli@broadcom.com>, Thierry Reding <thierry.reding@gmail.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume Date: Wed, 4 Oct 2023 10:54:14 -0700 Message-Id: <20231004175414.1738475-1-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000005a54150606e7b2c4" X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MIME_NO_TEXT, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 10:54:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778848438038764318 X-GMAIL-MSGID: 1778848438038764318 |
Series |
pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume
|
|
Commit Message
Florian Fainelli
Oct. 4, 2023, 5:54 p.m. UTC
The suspend/resume functions currently utilize
clk_disable()/clk_enable() respectively which may be no-ops with certain
clock providers such as SCMI. Fix this to use clk_disable_unprepare()
and clk_prepare_enable() respectively as we should.
Fixes: 3a9f5957020f ("pwm: Add Broadcom BCM7038 PWM controller support")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/pwm/pwm-brcmstb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hello Florian, On Wed, Oct 04, 2023 at 10:54:14AM -0700, Florian Fainelli wrote: > The suspend/resume functions currently utilize > clk_disable()/clk_enable() respectively which may be no-ops with certain > clock providers such as SCMI. Fix this to use clk_disable_unprepare() > and clk_prepare_enable() respectively as we should. > > Fixes: 3a9f5957020f ("pwm: Add Broadcom BCM7038 PWM controller support") > Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> > --- > drivers/pwm/pwm-brcmstb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pwm/pwm-brcmstb.c b/drivers/pwm/pwm-brcmstb.c > index a3faa9a3de7c..a7d529bf76ad 100644 > --- a/drivers/pwm/pwm-brcmstb.c > +++ b/drivers/pwm/pwm-brcmstb.c > @@ -288,7 +288,7 @@ static int brcmstb_pwm_suspend(struct device *dev) > { > struct brcmstb_pwm *p = dev_get_drvdata(dev); > > - clk_disable(p->clk); > + clk_disable_unprepare(p->clk); > > return 0; > } > @@ -297,7 +297,7 @@ static int brcmstb_pwm_resume(struct device *dev) > { > struct brcmstb_pwm *p = dev_get_drvdata(dev); > > - clk_enable(p->clk); > + clk_prepare_enable(p->clk); While at it: Add another patch that checks the return value of clk_prepare_enable()? Orthogonally to that, the patch looks fine: Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Best regards Uwe
On Wed, 04 Oct 2023 10:54:14 -0700, Florian Fainelli wrote: > The suspend/resume functions currently utilize > clk_disable()/clk_enable() respectively which may be no-ops with certain > clock providers such as SCMI. Fix this to use clk_disable_unprepare() > and clk_prepare_enable() respectively as we should. > > Applied, thanks! [1/1] pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume commit: 4da07e8a22919fde057b554716e4c5a640d4d805 Best regards,
diff --git a/drivers/pwm/pwm-brcmstb.c b/drivers/pwm/pwm-brcmstb.c index a3faa9a3de7c..a7d529bf76ad 100644 --- a/drivers/pwm/pwm-brcmstb.c +++ b/drivers/pwm/pwm-brcmstb.c @@ -288,7 +288,7 @@ static int brcmstb_pwm_suspend(struct device *dev) { struct brcmstb_pwm *p = dev_get_drvdata(dev); - clk_disable(p->clk); + clk_disable_unprepare(p->clk); return 0; } @@ -297,7 +297,7 @@ static int brcmstb_pwm_resume(struct device *dev) { struct brcmstb_pwm *p = dev_get_drvdata(dev); - clk_enable(p->clk); + clk_prepare_enable(p->clk); return 0; }