Skip to contentSkip to conversation

serial: atmel: honor CREAD in atmel_set_termios

PATCH In review Rakesh Alasyam 3 participants 6 messages May 1 – May 18

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

PATCH 1/1 serial: atmel: honor CREAD in atmel_set_termios

Ignore received characters when CREAD is cleared by adding RXRDY to ignore_status_mask.

This replaces an existing TODO in the driver.

---
 drivers/tty/serial/atmel_serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/atmel_serial.c +2 -2
index 5d8c1cfc1c60..5b062d8ccabe 100644
@@ -2184,8 +2184,8 @@ static void atmel_set_termios(struct uart_port *port,
 		if (termios->c_iflag & IGNPAR)
 			port->ignore_status_mask |= ATMEL_US_OVRE;
 	}
-	/* TODO: Ignore all characters if CREAD is set.*/
-
+	if (!(termios->c_cflag & CREAD))
+		port->ignore_status_mask |= ATMEL_US_RXRDY;
 	/* update the per-port timeout */
 	uart_update_timeout(port, termios->c_cflag, baud);
 
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 29 lines · Rakesh Alasyam

Ignore received characters when CREAD is cleared by adding RXRDY to ignore_status_mask.

This replaces an existing TODO in the driver.

---
 drivers/tty/serial/atmel_serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/atmel_serial.c +2 -2
index 5d8c1cfc1c60..5b062d8ccabe 100644
@@ -2184,8 +2184,8 @@ static void atmel_set_termios(struct uart_port *port,
 		if (termios->c_iflag & IGNPAR)
 			port->ignore_status_mask |= ATMEL_US_OVRE;
 	}
-	/* TODO: Ignore all characters if CREAD is set.*/
-
+	if (!(termios->c_cflag & CREAD))
+		port->ignore_status_mask |= ATMEL_US_RXRDY;
 	/* update the per-port timeout */
 	uart_update_timeout(port, termios->c_cflag, baud);
 
Signature · 1 line
2.43.0

Cool, was this tested to work properly?

And a blank line is needed before the comment, right?

thanks,

greg k-h

#2 lore raw

PATCH 1/1 tty: serial: atmel: Ignore chars when CREAD is cleared

Ignore received characters when CREAD is cleared by adding RXRDY to ignore_status_mask.

This replaces an existing TODO in the driver.

Tested on hardware.

---

v2:
- Add blank line before comment
- Tested on hardware

---
 drivers/tty/serial/atmel_serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +2 -1
index 5d8c1cfc1c60..5c756dc904b0 100644
@@ -2184,7 +2184,8 @@ static void atmel_set_termios(struct uart_port *port,
 		if (termios->c_iflag & IGNPAR)
 			port->ignore_status_mask |= ATMEL_US_OVRE;
 	}
-	/* TODO: Ignore all characters if CREAD is set.*/
+	if (!(termios->c_cflag & CREAD))
+		port->ignore_status_mask |= ATMEL_US_RXRDY;
 
 	/* update the per-port timeout */
 	uart_update_timeout(port, termios->c_cflag, baud);
Signature · 1 line
2.43.0
maintainer
#3 lore raw

Re: [PATCH] tty: serial: atmel: Ignore chars when CREAD is cleared

Quoted 35 lines · Rakesh Alasyam

Ignore received characters when CREAD is cleared by adding RXRDY to ignore_status_mask.

This replaces an existing TODO in the driver.

Tested on hardware.

---

v2:
- Add blank line before comment
- Tested on hardware

---
 drivers/tty/serial/atmel_serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +2 -1
index 5d8c1cfc1c60..5c756dc904b0 100644
@@ -2184,7 +2184,8 @@ static void atmel_set_termios(struct uart_port *port,
 		if (termios->c_iflag & IGNPAR)
 			port->ignore_status_mask |= ATMEL_US_OVRE;
 	}
-	/* TODO: Ignore all characters if CREAD is set.*/
+	if (!(termios->c_cflag & CREAD))
+		port->ignore_status_mask |= ATMEL_US_RXRDY;
 
 	/* update the per-port timeout */
 	uart_update_timeout(port, termios->c_cflag, baud);
Signature · 1 line
2.43.0

No v2 in the subject line :(

#4 lore raw

PATCH v2 1/1 tty: serial: atmel: Ignore chars when CREAD is cleared

In reply to Greg KH

Ignore received characters when CREAD is cleared by adding RXRDY to ignore_status_mask.

This replaces an existing TODO in the driver.

Tested on hardware.

---

v2:
- Add blank line before comment
- Tested on hardware

---
 drivers/tty/serial/atmel_serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +2 -1
index 5d8c1cfc1c60..5c756dc904b0 100644
@@ -2184,7 +2184,8 @@ static void atmel_set_termios(struct uart_port *port,
 		if (termios->c_iflag & IGNPAR)
 			port->ignore_status_mask |= ATMEL_US_OVRE;
 	}
-	/* TODO: Ignore all characters if CREAD is set.*/
+	if (!(termios->c_cflag & CREAD))
+		port->ignore_status_mask |= ATMEL_US_RXRDY;
 
 	/* update the per-port timeout */
 	uart_update_timeout(port, termios->c_cflag, baud);
Signature · 1 line
2.43.0
#5 lore raw

Re: [PATCH v2] tty: serial: atmel: Ignore chars when CREAD is cleared

Hi Rakesh,

Le 11/05/2026 à 18:59, Rakesh Alasyam a écrit :

Quoted 6 lines

Ignore received characters when CREAD is cleared by adding RXRDY to ignore_status_mask.

This replaces an existing TODO in the driver.

Tested on hardware.

Could you be more precise?
Which board(s) did you test with? (e.g. sama5d3_explained, custom...) Which SoC? (sam9g35, sama5d2...)
With DMA, PDC or none?

Regards,
Richard

Quoted 26 lines

---

v2:
- Add blank line before comment
- Tested on hardware

---
  drivers/tty/serial/atmel_serial.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/atmel_serial.c +2 -1
index 5d8c1cfc1c60..5c756dc904b0 100644
@@ -2184,7 +2184,8 @@ static void atmel_set_termios(struct uart_port *port,
  		if (termios->c_iflag & IGNPAR)
  			port->ignore_status_mask |= ATMEL_US_OVRE;
  	}
-	/* TODO: Ignore all characters if CREAD is set.*/
+	if (!(termios->c_cflag & CREAD))
+		port->ignore_status_mask |= ATMEL_US_RXRDY;
 
  	/* update the per-port timeout */
  	uart_update_timeout(port, termios->c_cflag, baud);