Skip to contentSkip to conversation

tty: serial: samsung_tty: Fix suspend/resume on S5L

PATCH In review Hector Martin 3 participants 4 messages May 2, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial: samsung_tty: Fix suspend/resume on S5L

We were restoring the IRQ masks then clearing them again, because ucon_mask wasn't set properly. Adding that makes suspend/resume work as intended.

---
 drivers/tty/serial/samsung_tty.c | 1 +
 include/linux/serial_s3c.h       | 3 +++
 2 files changed, 4 insertions(+)
drivers/tty/serial/samsung_tty.c +1 -0
index 12bf6b18847f..88a0b01ee9ab 100644
@@ -2840,6 +2840,7 @@ static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
 		.num_clks	= 1,
 		.clksel_mask	= 0,
 		.clksel_shift	= 0,
+		.ucon_mask	= APPLE_S5L_UCON_MASK,
 	},
 	.def_cfg = {
 		.ucon		= APPLE_S5L_UCON_DEFAULT,
include/linux/serial_s3c.h +3 -0
index f6c3323fc4c5..dec15f5b3dec 100644
@@ -256,6 +256,9 @@
 #define APPLE_S5L_UCON_DEFAULT		(S3C2410_UCON_TXIRQMODE | \
 					 S3C2410_UCON_RXIRQMODE | \
 					 S3C2410_UCON_RXFIFO_TOI)
+#define APPLE_S5L_UCON_MASK		(APPLE_S5L_UCON_RXTO_ENA_MSK | \
+					 APPLE_S5L_UCON_RXTHRESH_ENA_MSK | \
+					 APPLE_S5L_UCON_TXTHRESH_ENA_MSK)
 
 #define APPLE_S5L_UTRSTAT_RXTHRESH	(1<<4)
 #define APPLE_S5L_UTRSTAT_TXTHRESH	(1<<5)
Signature · 1 line
2.35.1
#1 lore raw
Quoted 9 lines · Hector Martin

We were restoring the IRQ masks then clearing them again, because ucon_mask wasn't set properly. Adding that makes suspend/resume work as intended.

---
 drivers/tty/serial/samsung_tty.c | 1 +
 include/linux/serial_s3c.h       | 3 +++
 2 files changed, 4 insertions(+)

Does this fix a specific older commit?

And should it be backported to older stable kernels?

thanks,

greg k-h

#2 lore raw
Quoted 11 lines · Greg Kroah-Hartman
Quoted 9 lines · Hector Martin

We were restoring the IRQ masks then clearing them again, because ucon_mask wasn't set properly. Adding that makes suspend/resume work as intended.

---
 drivers/tty/serial/samsung_tty.c | 1 +
 include/linux/serial_s3c.h       | 3 +++
 2 files changed, 4 insertions(+)
Quoted 3 lines

Does this fix a specific older commit?

And should it be backported to older stable kernels?

It does fix the commit that introduced this device support in general; I can add a Fixes line for that. I don't think anyone cares about backporting though, since there are other fairly critical devices that don't have support outright and there's still work to do before suspend/resume is generally usable on these machines.

Signature · 2 lines
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub
#3 lore raw
Quoted 14 lines · Hector Martin
Quoted 13 lines · Greg Kroah-Hartman
Quoted 9 lines · Hector Martin

We were restoring the IRQ masks then clearing them again, because ucon_mask wasn't set properly. Adding that makes suspend/resume work as intended.

---
 drivers/tty/serial/samsung_tty.c | 1 +
 include/linux/serial_s3c.h       | 3 +++
 2 files changed, 4 insertions(+)

Does this fix a specific older commit?

Quoted 7 lines
Quoted 1 line

And should it be backported to older stable kernels?

It does fix the commit that introduced this device support in general; I can add a Fixes line for that. I don't think anyone cares about backporting though, since there are other fairly critical devices that don't have support outright and there's still work to do before suspend/resume is generally usable on these machines.

Then please add only Fixes tag.

Best regards,
Krzysztof