Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2555815lqp; Mon, 25 Mar 2024 02:27:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWRQZJr7qUicRvCtWMDsFyobWa1tFzF6nC8YCHbyL0KtLajGffNrgqGvj8huLCpRZIXFmyjhklRJhnisWcs7R7Xr8o85AiPujh5tev3hw== X-Google-Smtp-Source: AGHT+IG9wHFJe/XENY4WfVmzr0WH1HKkzOgMEYBoFNyG6X9sWswgnDoVQx+nl2rjWSINI7BRVm5t X-Received: by 2002:a05:6214:1c45:b0:696:49f0:9210 with SMTP id if5-20020a0562141c4500b0069649f09210mr8487053qvb.59.1711358854013; Mon, 25 Mar 2024 02:27:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358853; cv=pass; d=google.com; s=arc-20160816; b=rQeS4SyJ01sYLTMaXID/6O/mnmVaibWJXaA485hg/cyqZc2biYPvVEqNKbJMhUIoBt OedRx6Cfc6xTKdEx0fUy5aIJGuTL9JP10IJpIw5DCYVy6b8nB28NbP5UPZUl0fZGl/24 1+rsFEl+CEwCaT5QWKgeV/siQ6WQjvq7JcRlB9hnNyyF+l5fCZ3hVvxPHD7nm/4a2s4L +f7yRopI7szQhmv7YxOwpvVXuK2XAdN2dVmk5Nz37888oJzu7q6g6y/cAxV0NN7QvIPo +NZ978Poh98G6063/Q2+1pHEN8wj/mGyEp6iT+IjpSgEGW4D+HHBd7drVfZ6a8jh53Pz JydQ== 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=Y/kqMcKCHo5gzLZnP6jLPfJnhJg70ESoEDY8etfPr18=; fh=DyT9TW+tGhHedPVCOVkfxW8WBJNs2yarNKSGNJZi2JQ=; b=sdGXxEBrXcYudbTRu2NTlt0vj1/jWKrZ8gwbLD62X2gdG5JTvrMmjzm+x/Gswqr1J7 ep7WoBykDzWS2gdDduF9qZZ2x9//D6weze1xNsslmKVqv1JdMze+efwprEvhTFvXZ6cx J85WmS2UQT0pMdMYFEyi38/fhu6LkZHJDmRXS/RXJo6lPH9jhScQ/5WqqclXXyeQXNKA fnFio+CzEWnZFhbFAO67gFzOHlRPAWOWGypd59jhad5yr+8U/RWrPxzbiC7mkpxPeIx0 9cgfT1s9BSh/JARvn0cy+V28kxVJMSRsW0NJdlcISWePweowYJJWN/RLIYkM2+wbuzqe WTig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O4xxVllg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115813-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 2-20020a0562140dc200b0069694dab3ecsi258837qvt.153.2024.03.25.02.27.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:27:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O4xxVllg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115813-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115813-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B91CD1C30D06 for ; Mon, 25 Mar 2024 09:27:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37E0E375F42; Mon, 25 Mar 2024 03:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O4xxVllg" 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 C194D145FEF; Sun, 24 Mar 2024 23:14:10 +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=1711322051; cv=none; b=iQOjBux9rBMYVW1+e/CQ/nFypihDAlvk2qyETb3SFXKLEKeTTqOvw9d9vo/Nj8WoPUnNwmyyyNl/vaTBCzRJc+8ssnshuR3t49F/dY4YfsGRQXNQnUy+zITabTGI16s6nGkXHJXQkKlVNObg/SO9fHBHum+ucHurmc0qkpKyEPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322051; c=relaxed/simple; bh=1ITZQsOA5uH5mLhtqE6Q6ShPQIh0iAuove/4OFBVZ0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CWHGiQYBqYiL3DnDrUE1uBXWsLiwfzyUZDpxSk803HKLRwIRHSF4OYrd19gTmJbqxcuggAW9SF+u98ifSshv2AJWSZEBJU9+v7SFQI/Tc5LPSZrvd9E1nzx/NyPhOg+9QtvwF/tIbYMkK8vIaPaQRDCevNvhwqWqMtgeP3ylAss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O4xxVllg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BA40C433F1; Sun, 24 Mar 2024 23:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322050; bh=1ITZQsOA5uH5mLhtqE6Q6ShPQIh0iAuove/4OFBVZ0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O4xxVllgJI/Dg5iewAS6lHrG8U8duildQtvDMRUnvPLVTWJ4IcXZyjdi9JzIWlNNA PSbyJwHbS903YzApB+GKjZIE87uWP/XjZl9F48DaUi03TDbf5h48vU/RCx8jw8ig6R YKWQpJYUBRtElTtvyt/jjtN8p2fAgplyNCwaKp2oKrkW+9e71BwV5B9kPB2Uam4Cse XCfApfAj1ZhkG8/uo0iSjFljx9CARSeWB8RgmVKx2ivxYhkm6DxGh2wpUNrxMul4L1 PVXpuhe9EqeLhD3ahPMnAdeF12PxjMnaHeNtyR6xbza0FjwX992B02/g8+JNx7Z83i hRRhNfM8SmbWw== 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.1 123/451] pwm: atmel-hlcdc: Fix clock imbalance related to suspend support Date: Sun, 24 Mar 2024 19:06:39 -0400 Message-ID: <20240324231207.1351418-124-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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 4d0b859d0ac13..3e9c94a8d7f72 100644 --- a/drivers/pwm/pwm-atmel-hlcdc.c +++ b/drivers/pwm/pwm-atmel-hlcdc.c @@ -186,7 +186,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