From mboxrd@z Thu Jan 1 00:00:00 1970 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 4C1FB2DCBFC for ; Sun, 3 May 2026 11:46:43 +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=1777808803; cv=none; b=ArTcby0JJuIH6nkT9OFZ611DuRGQVQVkiEbn3MKZjAsGkvRYjqxTlrcOvUXAWSv/I5YCi+GHp5SZshwE6JYXkPU3UjZvYjlHbEdfW6igyz3oCrxWyVNW9+Tba3FGriBlzUzLerlzUeOtn+wi3lr7d0FYA6pPnafldS/XFTyLxQM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777808803; c=relaxed/simple; bh=KhBkzhXDL7r+gVSYQ/l6ZU/+DUgWx6s7B4sl/S1zcBk=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=oy5oN0fMReuXF+nyAswGYgZidj85TGQX4ofqNn9BTTjPc5/KsMof6/SrZBVZNqeTdNAeYBh3pi2bdEzMIoBr1YQM55T6yLXgyBUc2MEbR+X6+/RvGoSObZNByzqCO8zRG7AEJ95t4EkWJRKipwZ0HPJ0iUixN55zoQTAgPiGnFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WM6r4viJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="WM6r4viJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBBE5C2BCB4; Sun, 3 May 2026 11:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777808803; bh=KhBkzhXDL7r+gVSYQ/l6ZU/+DUgWx6s7B4sl/S1zcBk=; h=Subject:To:Cc:From:Date:From; b=WM6r4viJhvf3jJ1ncx6Lc9kUTlnfnQWQ1ZhwVwHbyMvuqz6J81YN8sSWFPc+3NpAH fg5VjX2nZfboV3cdH80jyFwSLfbPW17sEFygY5Ks0KZBtz3MrpIJnSMEWDs6PqfrGF ivK7lhQKUQkky0S2L+/ksg1HibW0N8SwyN1UmbNM= Subject: FAILED: patch "[PATCH] pwm: imx-tpm: Count the number of enabled channels in probe" failed to apply to 6.1-stable tree To: viorel.suman@oss.nxp.com,ukleinek@kernel.org Cc: From: Date: Sun, 03 May 2026 13:46:32 +0200 Message-ID: <2026050332-washer-legislate-ef0e@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x 3962c24f2d14e8a7f8a23f56b7ce320523947342 # git commit -s git send-email --to '' --in-reply-to '2026050332-washer-legislate-ef0e@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 3962c24f2d14e8a7f8a23f56b7ce320523947342 Mon Sep 17 00:00:00 2001 From: "Viorel Suman (OSS)" Date: Wed, 11 Mar 2026 14:33:09 +0200 Subject: [PATCH] pwm: imx-tpm: Count the number of enabled channels in probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a soft reset TPM PWM IP may preserve its internal state from previous runtime, therefore on a subsequent OS boot and driver probe "enable_count" value and TPM PWM IP internal channels "enabled" states may get unaligned. In consequence on a suspend/resume cycle the call "if (--tpm->enable_count == 0)" may lead to "enable_count" overflow the system being blocked from entering suspend due to: if (tpm->enable_count > 0) return -EBUSY; Fix the problem by counting the enabled channels in probe function. Signed-off-by: Viorel Suman (OSS) Fixes: 738a1cfec2ed ("pwm: Add i.MX TPM PWM driver support") Link: https://patch.msgid.link/20260311123309.348904-1-viorel.suman@oss.nxp.com Cc: stable@vger.kernel.org Signed-off-by: Uwe Kleine-König diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c index 5b399de16d60..80fdb3303400 100644 --- a/drivers/pwm/pwm-imx-tpm.c +++ b/drivers/pwm/pwm-imx-tpm.c @@ -352,7 +352,7 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev) struct clk *clk; void __iomem *base; int ret; - unsigned int npwm; + unsigned int i, npwm; u32 val; base = devm_platform_ioremap_resource(pdev, 0); @@ -382,6 +382,13 @@ static int pwm_imx_tpm_probe(struct platform_device *pdev) mutex_init(&tpm->lock); + /* count the enabled channels */ + for (i = 0; i < npwm; ++i) { + val = readl(base + PWM_IMX_TPM_CnSC(i)); + if (FIELD_GET(PWM_IMX_TPM_CnSC_ELS, val)) + ++tpm->enable_count; + } + ret = devm_pwmchip_add(&pdev->dev, chip); if (ret) return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");