Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-16 16:23:44 +0200
committerTakashi Iwai <tiwai@suse.de>2019-07-16 16:23:49 +0200
commita2a1151f04a720ddcbdc44d948bbb4ce1cc300d5 (patch)
treece8ae9e4d431f98dc929f70cea0d922465f31492
parentb24490c0bdf63e9cf3db9d8774ec8b6a3873d747 (diff)
tty: serial: cpm_uart - fix init when SMC is relocated
(bsc#1051510).
-rw-r--r--patches.drivers/tty-serial-cpm_uart-fix-init-when-SMC-is-relocated.patch78
-rw-r--r--series.conf1
2 files changed, 79 insertions, 0 deletions
diff --git a/patches.drivers/tty-serial-cpm_uart-fix-init-when-SMC-is-relocated.patch b/patches.drivers/tty-serial-cpm_uart-fix-init-when-SMC-is-relocated.patch
new file mode 100644
index 0000000000..04cb4ce395
--- /dev/null
+++ b/patches.drivers/tty-serial-cpm_uart-fix-init-when-SMC-is-relocated.patch
@@ -0,0 +1,78 @@
+From 06aaa3d066db87e8478522d910285141d44b1e58 Mon Sep 17 00:00:00 2001
+From: Christophe Leroy <christophe.leroy@c-s.fr>
+Date: Wed, 22 May 2019 12:17:11 +0000
+Subject: [PATCH] tty: serial: cpm_uart - fix init when SMC is relocated
+Git-commit: 06aaa3d066db87e8478522d910285141d44b1e58
+Patch-mainline: v5.3-rc1
+References: bsc#1051510
+
+SMC relocation can also be activated earlier by the bootloader,
+so the driver's behaviour cannot rely on selected kernel config.
+
+When the SMC is relocated, CPM_CR_INIT_TRX cannot be used.
+
+But the only thing CPM_CR_INIT_TRX does is to clear the
+rstate and tstate registers, so this can be done manually,
+even when SMC is not relocated.
+
+Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
+Fixes: 9ab921201444 ("cpm_uart: fix non-console port startup bug")
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/tty/serial/cpm_uart/cpm_uart_core.c | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+index b929c7ae3a27..7bab9a3eda92 100644
+--- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c
++++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c
+@@ -407,7 +407,16 @@ static int cpm_uart_startup(struct uart_port *port)
+ clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
+ }
+ cpm_uart_initbd(pinfo);
+- cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
++ if (IS_SMC(pinfo)) {
++ out_be32(&pinfo->smcup->smc_rstate, 0);
++ out_be32(&pinfo->smcup->smc_tstate, 0);
++ out_be16(&pinfo->smcup->smc_rbptr,
++ in_be16(&pinfo->smcup->smc_rbase));
++ out_be16(&pinfo->smcup->smc_tbptr,
++ in_be16(&pinfo->smcup->smc_tbase));
++ } else {
++ cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
++ }
+ }
+ /* Install interrupt handler. */
+ retval = request_irq(port->irq, cpm_uart_int, 0, "cpm_uart", port);
+@@ -861,16 +870,14 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
+ (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
+
+ /*
+- * In case SMC1 is being relocated...
++ * In case SMC is being relocated...
+ */
+-#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
+ out_be16(&up->smc_rbptr, in_be16(&pinfo->smcup->smc_rbase));
+ out_be16(&up->smc_tbptr, in_be16(&pinfo->smcup->smc_tbase));
+ out_be32(&up->smc_rstate, 0);
+ out_be32(&up->smc_tstate, 0);
+ out_be16(&up->smc_brkcr, 1); /* number of break chars */
+ out_be16(&up->smc_brkec, 0);
+-#endif
+
+ /* Set up the uart parameters in the
+ * parameter ram.
+@@ -884,8 +891,6 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
+ out_be16(&up->smc_brkec, 0);
+ out_be16(&up->smc_brkcr, 1);
+
+- cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
+-
+ /* Set UART mode, 8 bit, no parity, one stop.
+ * Enable receive and transmit.
+ */
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index c0ee95db17..0ac33eb842 100644
--- a/series.conf
+++ b/series.conf
@@ -22913,6 +22913,7 @@
patches.drivers/staging-rtl8712-reduce-stack-usage-again.patch
patches.drivers/staging-comedi-amplc_pci230-fix-null-pointer-deref-o.patch
patches.drivers/staging-comedi-dt282x-fix-a-null-pointer-deref-on-in.patch
+ patches.drivers/tty-serial-cpm_uart-fix-init-when-SMC-is-relocated.patch
patches.drivers/serial-uartps-Fix-multiple-line-dereference.patch
patches.drivers/serial-uartps-Fix-long-line-over-80-chars.patch
patches.drivers/serial-uartps-Do-not-add-a-trailing-semicolon-to-mac.patch