Skip to contentSkip to conversation

patch "serial: qcom_geni_serial: To correct QUP Version detection logic" added to tty-next

PATCH [email protected] 1 participant 1 message Oct 1, 2020

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

serial: qcom_geni_serial: To correct QUP Version detection logic

to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-next branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will also be merged in the next major kernel release during the merge window.

If you have any questions about this process, please let me know.

From c9ca43d42ed8d5fd635d327a664ed1d8579eb2af Mon Sep 17 00:00:00 2001
From: Paras Sharma <[email protected]>
Date: Wed, 30 Sep 2020 11:35:26 +0530
Subject: serial: qcom_geni_serial: To correct QUP Version detection logic

For QUP IP versions 2.5 and above the oversampling rate is halved from 32 to 16.

Commit ce734600545f ("tty: serial: qcom_geni_serial: Update the oversampling rate") is pushed to handle this scenario. But the existing logic is failing to classify QUP Version 3.0 into the correct group ( 2.5 and above).

As result Serial Engine clocks are not configured properly for baud rate and garbage data is sampled to FIFOs from the line.

So, fix the logic to detect QUP with versions 2.5 and above.

Fixes ce734600545f ("tty: serial: qcom_geni_serial: Update the oversampling rate")
Cc stable <[email protected]>
---
 drivers/tty/serial/qcom_geni_serial.c | 2 +-
 include/linux/qcom-geni-se.h          | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/tty/serial/qcom_geni_serial.c +1 -1
index 8da2eb2d1090..291649f02821 100644
@@ -1000,7 +1000,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport,
 	sampling_rate = UART_OVERSAMPLING;
 	/* Sampling rate is halved for IP versions >= 2.5 */
 	ver = geni_se_get_qup_hw_version(&port->se);
-	if (GENI_SE_VERSION_MAJOR(ver) >= 2 && GENI_SE_VERSION_MINOR(ver) >= 5)
+	if (ver >= QUP_SE_VERSION_2_5)
 		sampling_rate /= 2;
 
 	clk_rate = get_clk_div_rate(baud, sampling_rate, &clk_div);
include/linux/qcom-geni-se.h +3 -0
index 8f385fbe5a0e..1c31f26ccc7a 100644
@@ -248,6 +248,9 @@ struct geni_se {
 #define GENI_SE_VERSION_MINOR(ver) ((ver & HW_VER_MINOR_MASK) >> HW_VER_MINOR_SHFT)
 #define GENI_SE_VERSION_STEP(ver) (ver & HW_VER_STEP_MASK)
 
+/* QUP SE VERSION value for major number 2 and minor number 5 */
+#define QUP_SE_VERSION_2_5                  0x20050000
+
 /*
  * Define bandwidth thresholds that cause the underlying Core 2X interconnect
  * clock to run at the named frequency. These baseline values are recommended
Signature · 1 line
2.28.0