Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2368088lqp; Sun, 24 Mar 2024 16:07:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHpN0u6SGKY1Z362CE5FOANFznix5xJX6ORWzoaGoYkkwqMRorplsOzIbcxym+Z11aaqR16i4f6CTIBksahc9NIyKKqcFUQP0LrtcPOg== X-Google-Smtp-Source: AGHT+IGUZtu/onNBc9LLbx2ZnUiUDFziNPFnb1ARNEHPdcQi1VTvyssh43kJYn32oyWJR3dXSkyJ X-Received: by 2002:a05:6a00:890b:b0:6ea:aaf5:9e00 with SMTP id hw11-20020a056a00890b00b006eaaaf59e00mr1147611pfb.33.1711321644884; Sun, 24 Mar 2024 16:07:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711321644; cv=pass; d=google.com; s=arc-20160816; b=vQ0gq1kml30+X+kXi8pfGNjFfuJpjFsr6cwUSDib22P0pUG9kdge95HZS6eszmX2+d gBntBy52WMZ2G6EsHdACu64b5yP3B4Q6ZnP0aE2cpAU1/JLXB8XtWJWuU8qz+UCwKwOh +SJVw5zE2iPZ/D+BegNI0JDIIABQdNFRPri7WHkhvbN1FSgiJamE4SIDoCuiybC0VvKJ aIEELnGZWnPgaCy6HVzPtmtn1or4CQDeSSTFEnf67SBCSxI/Lqp8ERe+BvPKzKWskHQ1 mQkqZhSqxRx66K2gWMjfq8yCCGwdaRmt2l/7VqnLDHEgZGPXpU4LCXSwBtMNMIFzBq6Q sdpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Bl+vgqv6gN8TIEUTKj9YAHarMhGR9/sVNMb2t3iR6Vo=; fh=DyT9TW+tGhHedPVCOVkfxW8WBJNs2yarNKSGNJZi2JQ=; b=RfB8Xum96LTE/ZDR90jFgOfM9IM7zeJm646rBuG2+BOKXQ3/w+/v75HdGwjfampEwd kpQi/93TdMrn6h3K0d7PzSvXXFK83YNU45FZlyzvJq0l4KsMFKjgxeiizr9NFkH19F8i sdjmi49dEUg3KXyScsmZGWKuX5m9yuDIdZdXY3apPgq1H5VqmUmhhdRerFD2dLj+t8bC jAMzdytv5dAk8RwA99FOnpJ6chllRk33fuhSz716DphIHPLpScCzA5yQlcJYbnYq940i D1LlaAkI+Bp0QlCY8SUVq4Db1COrJGXqsDTT6lOJIfZXZ8fh6SENj/dXBE3t6NS99JLq blCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JkRT/sJh"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113026-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p187-20020a625bc4000000b006ea790f3132si3985194pfb.163.2024.03.24.16.07.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:07:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="JkRT/sJh"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113026-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113026-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 90160281ADE for ; Sun, 24 Mar 2024 23:07:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D302313A244; Sun, 24 Mar 2024 22:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JkRT/sJh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB2C413957F; Sun, 24 Mar 2024 22:37:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319837; cv=none; b=P6cxjsWX1ich3w7+79KSSpB/DHVtWW7/NrxWgtdaZ/Xqd9wBu1aEp2qpsDzknt3paUjko/z1GisVy3hbvbxIXRPxp0kOiwtGqB6H2My9ASiQBTqweeaiRJtZGn/4Atz1S29Nj1RWajpHHu2veLwEx4KCD+szbggpDGOHO79MhhY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319837; c=relaxed/simple; bh=BlrEduLhK8IxCF6Js5m5Yhu9/N1eH5XB7begusWkerc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cVYst828vWVzSCSol9xKNGpraYmQUpZukBwtXDXiDIqSXENE64df+SvfAlsYudxf3taPszwir2hnSHzZmRqxJ99HnqL9IMJcqvQL7Sp1oP5tfEfgWzEzRvte4pau53ltljj28AOQ0vYXileag0rkmXG7FhNkPmyse6M1NNH53Og= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JkRT/sJh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEBE6C43330; Sun, 24 Mar 2024 22:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319836; bh=BlrEduLhK8IxCF6Js5m5Yhu9/N1eH5XB7begusWkerc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JkRT/sJhkbfnPTT7h+DA5Va7EQ+YlEEMqkGcZlpe6WIQ+eRbikfTrqmfmLjgPckwd 0FT+X6CTxHY7casZeyfgelUyNyIAUmXjv4TSMFye2KCUnE1W/zPYODGSw2OSip5U1o onDecMXyuNVTzNpl5i0t2DgmQ2d3UpfK7cOgTSwLLVLbAWbEfde28R6fLfk/QT8Muj zMatPHyCst+Mrqe9jMb0RcKjFdb8iwqTM3NZzyKZH/El1g7EFq7RdfSy5fuwwwk1Sr 96qp6lRORPy4cslMvOmAS+q6YtzFGgOTXoSaiz18aRIZ/MYPOT66Df7e9NLC9vO/e/ CqgbVuaEUVU9w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Claudiu Beznea , Sasha Levin Subject: [PATCH 6.8 139/715] pwm: atmel-hlcdc: Fix clock imbalance related to suspend support Date: Sun, 24 Mar 2024 18:25:18 -0400 Message-ID: <20240324223455.1342824-140-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Uwe Kleine-König [ Upstream commit e25ac87d3f831fed002c34aadddaf4ebb4ea45ec ] The suspend callback disables the periph clock when the PWM is enabled and resume reenables this clock if the PWM was disabled before. Judging from the code comment it's suspend that is wrong here. Fix accordingly. Fixes: f9bb9da7c09d ("pwm: atmel-hlcdc: Implement the suspend/resume hooks") Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/b51ea92b0a45eff3dc83b08adefd43d930df996c.1706269232.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König Signed-off-by: Sasha Levin --- drivers/pwm/pwm-atmel-hlcdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c index 3f2c5031a3ba8..1f6fc9a9fcf3e 100644 --- a/drivers/pwm/pwm-atmel-hlcdc.c +++ b/drivers/pwm/pwm-atmel-hlcdc.c @@ -185,7 +185,7 @@ static int atmel_hlcdc_pwm_suspend(struct device *dev) struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); /* Keep the periph clock enabled if the PWM is still running. */ - if (pwm_is_enabled(&atmel->chip.pwms[0])) + if (!pwm_is_enabled(&atmel->chip.pwms[0])) clk_disable_unprepare(atmel->hlcdc->periph_clk); return 0; -- 2.43.0