All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: samsung: Handle clock enable errors in noirq resume
@ 2026-11-29 19:25 Jiawen Liu
  2026-11-29 19:42 ` sashiko-bot
  2026-11-30  2:11 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Jiawen Liu @ 2026-11-29 19:25 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Peter Griffin, Greg Kroah-Hartman,
	Jiri Slaby
  Cc: Alim Akhtar, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	linux-serial

On Exynos5433 TM2 and TM2e, the audio UART gets its controller clock
from the audio CMU. If the CMU is runtime-suspended and runtime PM is
still disabled during noirq resume, preparing the clock can fail with
-EACCES. The S3C6400 resume callback ignores the error, attempts to
write the interrupt mask without acquiring the controller clock, and
releases an unacquired clock reference. The clock framework warns
when the enable or prepare count is zero.

Return the clock error before writing the interrupt mask. If enabling
a present baud clock fails, release the controller clock before
returning the error. The PM core reports the error and continues
system resume.

The drafting input was the source
review of the noirq clock failure. Verification included source
inspection of the clock paths, an ARM64 Exynos driver object build
with CONFIG_PM_SLEEP=y, checkpatch, and git diff --check. No runtime
or hardware reproduction was performed.

Fixes: a8a1781b8726 ("serial: samsung: enable clock before accessing interrupt mask resister")
Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
---
 drivers/tty/serial/samsung_tty.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 7ce8f2f993e21..72018a1fbd87e 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -2103,14 +2103,24 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)
 		switch (ourport->info->type) {
 		case TYPE_S3C6400: {
 			u32 uintm = 0xf;
+			int ret;
 
 			if (ourport->tx_enabled)
 				uintm &= ~S3C64XX_UINTM_TXD_MSK;
 			if (ourport->rx_enabled)
 				uintm &= ~S3C64XX_UINTM_RXD_MSK;
-			clk_prepare_enable(ourport->clk);
-			if (!IS_ERR(ourport->baudclk))
-				clk_prepare_enable(ourport->baudclk);
+
+			ret = clk_prepare_enable(ourport->clk);
+			if (ret)
+				return ret;
+			if (!IS_ERR(ourport->baudclk)) {
+				ret = clk_prepare_enable(ourport->baudclk);
+				if (ret) {
+					clk_disable_unprepare(ourport->clk);
+					return ret;
+				}
+			}
+
 			wr_regl(port, S3C64XX_UINTM, uintm);
 			if (!IS_ERR(ourport->baudclk))
 				clk_disable_unprepare(ourport->baudclk);
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: samsung: Handle clock enable errors in noirq resume
  2026-11-29 19:25 [PATCH] serial: samsung: Handle clock enable errors in noirq resume Jiawen Liu
@ 2026-11-29 19:42 ` sashiko-bot
  2026-11-30  2:11 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-29 19:42 UTC (permalink / raw)
  To: Jiawen Liu; +Cc: linux-serial

> On Exynos5433 TM2 and TM2e, the audio UART gets its controller clock
> from the audio CMU. If the CMU is runtime-suspended and runtime PM is
> still disabled during noirq resume, preparing the clock can fail with
> -EACCES. The S3C6400 resume callback ignores the error, attempts to
> write the interrupt mask without acquiring the controller clock, and
> releases an unacquired clock reference. The clock framework warns
> when the enable or prepare count is zero.
> 
> Return the clock error before writing the interrupt mask. If enabling
> a present baud clock fails, release the controller clock before
> returning the error. The PM core reports the error and continues
> system resume.
> 
> The drafting input was the source
> review of the noirq clock failure. Verification included source
> inspection of the clock paths, an ARM64 Exynos driver object build
> with CONFIG_PM_SLEEP=y, checkpatch, and git diff --check. No runtime
> or hardware reproduction was performed.
> 
> Fixes: a8a1781b8726 ("serial: samsung: enable clock before accessing interrupt mask resister")
> Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179598034086.2.8243056622030752053.pattern-ext-118.18@gmail.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: samsung: Handle clock enable errors in noirq resume
  2026-11-29 19:25 [PATCH] serial: samsung: Handle clock enable errors in noirq resume Jiawen Liu
  2026-11-29 19:42 ` sashiko-bot
@ 2026-11-30  2:11 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-30  2:11 UTC (permalink / raw)
  To: Jiawen Liu
  Cc: linux-serial, linux-samsung-soc, linux-kernel, Greg Kroah-Hartman,
	Jiri Slaby, Peter Griffin, linux-arm-kernel, Alim Akhtar


On Sun, 29 Nov 2026 19:25:33 +0000, Jiawen Liu wrote:
> On Exynos5433 TM2 and TM2e, the audio UART gets its controller clock
> from the audio CMU. If the CMU is runtime-suspended and runtime PM is
> still disabled during noirq resume, preparing the clock can fail with
> -EACCES. The S3C6400 resume callback ignores the error, attempts to
> write the interrupt mask without acquiring the controller clock, and
> releases an unacquired clock reference. The clock framework warns
> when the enable or prepare count is zero.
> 
> Return the clock error before writing the interrupt mask. If enabling
> a present baud clock fails, release the controller clock before
> returning the error. The PM core reports the error and continues
> system resume.
> 
> The drafting input was the source
> review of the noirq clock failure. Verification included source
> inspection of the clock paths, an ARM64 Exynos driver object build
> with CONFIG_PM_SLEEP=y, checkpatch, and git diff --check. No runtime
> or hardware reproduction was performed.
> 
> Fixes: a8a1781b8726 ("serial: samsung: enable clock before accessing interrupt mask resister")
> Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
> ---
>  drivers/tty/serial/samsung_tty.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 

You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.

Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.

Best regards,
Krzysztof





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-30  2:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 19:25 [PATCH] serial: samsung: Handle clock enable errors in noirq resume Jiawen Liu
2026-11-29 19:42 ` sashiko-bot
2026-11-30  2:11 ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.