From afcc880e91e4d730975ef1ef42d261c057cef6f4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 9 Apr 2025 10:05:44 +0200 Subject: [PATCH] 6.12-stable patches added patches: tty-serial-fsl_lpuart-fix-unused-variable-sport-build-warning.patch tty-serial-fsl_lpuart-use-port-struct-directly-to-simply-code.patch --- queue-6.12/series | 3 +- ...-unused-variable-sport-build-warning.patch | 40 ++++++++++ ...port-struct-directly-to-simply-code.patch} | 73 ++++++++----------- 3 files changed, 71 insertions(+), 45 deletions(-) create mode 100644 queue-6.12/tty-serial-fsl_lpuart-fix-unused-variable-sport-build-warning.patch rename queue-6.12/{tty-serial-fsl_lpuart-use-port-struct-directly-to-si.patch => tty-serial-fsl_lpuart-use-port-struct-directly-to-simply-code.patch} (85%) diff --git a/queue-6.12/series b/queue-6.12/series index 8494268450..fb6db2fafd 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -354,7 +354,8 @@ tracing-correct-the-refcount-if-the-hist-hist_debug-.patch cgroup-rstat-tracking-cgroup-level-niced-cpu-time.patch cgroup-rstat-fix-forceidle-time-in-cpu.stat.patch tty-serial-fsl_lpuart-use-u32-and-u8-for-register-va.patch -tty-serial-fsl_lpuart-use-port-struct-directly-to-si.patch +tty-serial-fsl_lpuart-use-port-struct-directly-to-simply-code.patch +tty-serial-fsl_lpuart-fix-unused-variable-sport-build-warning.patch tty-serial-lpuart-only-disable-cts-instead-of-overwr.patch wifi-mac80211-fix-sparse-warning-for-monitor_sdata.patch usbnet-fix-npe-during-rx_complete.patch diff --git a/queue-6.12/tty-serial-fsl_lpuart-fix-unused-variable-sport-build-warning.patch b/queue-6.12/tty-serial-fsl_lpuart-fix-unused-variable-sport-build-warning.patch new file mode 100644 index 0000000000..835909ce70 --- /dev/null +++ b/queue-6.12/tty-serial-fsl_lpuart-fix-unused-variable-sport-build-warning.patch @@ -0,0 +1,40 @@ +From 9f8fe348ac9544f6855f82565e754bf085d81f88 Mon Sep 17 00:00:00 2001 +From: Sherry Sun +Date: Mon, 24 Mar 2025 10:10:51 +0800 +Subject: tty: serial: fsl_lpuart: Fix unused variable 'sport' build warning + +From: Sherry Sun + +commit 9f8fe348ac9544f6855f82565e754bf085d81f88 upstream. + +Remove the unused variable 'sport' to avoid the kernel build warning. + +Fixes: 3cc16ae096f1 ("tty: serial: fsl_lpuart: use port struct directly to simply code") +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202503210614.2qGlnbIq-lkp@intel.com/ +Signed-off-by: Sherry Sun +Link: https://lore.kernel.org/r/20250324021051.162676-1-sherry.sun@nxp.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/fsl_lpuart.c | 3 --- + 1 file changed, 3 deletions(-) + +--- a/drivers/tty/serial/fsl_lpuart.c ++++ b/drivers/tty/serial/fsl_lpuart.c +@@ -638,8 +638,6 @@ static void lpuart32_wait_bit_set(struct + + static int lpuart_poll_init(struct uart_port *port) + { +- struct lpuart_port *sport = container_of(port, +- struct lpuart_port, port); + unsigned long flags; + u8 temp; + +@@ -692,7 +690,6 @@ static int lpuart_poll_get_char(struct u + static int lpuart32_poll_init(struct uart_port *port) + { + unsigned long flags; +- struct lpuart_port *sport = container_of(port, struct lpuart_port, port); + u32 temp; + + port->fifosize = 0; diff --git a/queue-6.12/tty-serial-fsl_lpuart-use-port-struct-directly-to-si.patch b/queue-6.12/tty-serial-fsl_lpuart-use-port-struct-directly-to-simply-code.patch similarity index 85% rename from queue-6.12/tty-serial-fsl_lpuart-use-port-struct-directly-to-si.patch rename to queue-6.12/tty-serial-fsl_lpuart-use-port-struct-directly-to-simply-code.patch index d2086ab174..d1c01cfc0b 100644 --- a/queue-6.12/tty-serial-fsl_lpuart-use-port-struct-directly-to-si.patch +++ b/queue-6.12/tty-serial-fsl_lpuart-use-port-struct-directly-to-simply-code.patch @@ -1,11 +1,11 @@ -From 937ce975f6fc60b4ad00a4759e55b66820814c4c Mon Sep 17 00:00:00 2001 -From: Sasha Levin +From 3cc16ae096f164ae0c6b98416c25a01db5f3a529 Mon Sep 17 00:00:00 2001 +From: Sherry Sun Date: Wed, 12 Mar 2025 10:39:03 +0800 Subject: tty: serial: fsl_lpuart: use port struct directly to simply code From: Sherry Sun -[ Upstream commit 3cc16ae096f164ae0c6b98416c25a01db5f3a529 ] +commit 3cc16ae096f164ae0c6b98416c25a01db5f3a529 upstream. Most lpuart functions have the parameter struct uart_port *port, but still use the &sport->port to get the uart_port instead of use it @@ -15,17 +15,13 @@ of covert it from struct sport. Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20250312023904.1343351-3-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: e98ab45ec518 ("tty: serial: lpuart: only disable CTS instead of overwriting the whole UARTMODIR register") -Signed-off-by: Sasha Levin --- - drivers/tty/serial/fsl_lpuart.c | 213 +++++++++++++++----------------- - 1 file changed, 102 insertions(+), 111 deletions(-) + drivers/tty/serial/fsl_lpuart.c | 210 +++++++++++++++++++--------------------- + 1 file changed, 102 insertions(+), 108 deletions(-) -diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c -index e86fb9c60f1c3..c2b522843b72c 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c -@@ -580,7 +580,7 @@ static int lpuart_dma_tx_request(struct uart_port *port) +@@ -580,7 +580,7 @@ static int lpuart_dma_tx_request(struct ret = dmaengine_slave_config(sport->dma_tx_chan, &dma_tx_sconfig); if (ret) { @@ -34,7 +30,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 "DMA slave config failed, err = %d\n", ret); return ret; } -@@ -610,13 +610,13 @@ static void lpuart_flush_buffer(struct uart_port *port) +@@ -610,13 +610,13 @@ static void lpuart_flush_buffer(struct u } if (lpuart_is_32(sport)) { @@ -52,12 +48,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 } } -@@ -638,38 +638,36 @@ static void lpuart32_wait_bit_set(struct uart_port *port, unsigned int offset, - - static int lpuart_poll_init(struct uart_port *port) - { -- struct lpuart_port *sport = container_of(port, -- struct lpuart_port, port); +@@ -643,33 +643,33 @@ static int lpuart_poll_init(struct uart_ unsigned long flags; u8 temp; @@ -104,11 +95,8 @@ index e86fb9c60f1c3..c2b522843b72c 100644 return 0; } -@@ -692,33 +690,32 @@ static int lpuart_poll_get_char(struct uart_port *port) - static int lpuart32_poll_init(struct uart_port *port) - { - unsigned long flags; -- struct lpuart_port *sport = container_of(port, struct lpuart_port, port); +@@ -695,30 +695,30 @@ static int lpuart32_poll_init(struct uar + struct lpuart_port *sport = container_of(port, struct lpuart_port, port); u32 temp; - sport->port.fifosize = 0; @@ -149,7 +137,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 return 0; } -@@ -1448,12 +1445,9 @@ static void lpuart_dma_rx_free(struct uart_port *port) +@@ -1448,12 +1448,9 @@ static void lpuart_dma_rx_free(struct ua static int lpuart_config_rs485(struct uart_port *port, struct ktermios *termios, struct serial_rs485 *rs485) { @@ -164,7 +152,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 if (rs485->flags & SER_RS485_ENABLED) { /* Enable auto RS-485 RTS mode */ -@@ -1471,32 +1465,29 @@ static int lpuart_config_rs485(struct uart_port *port, struct ktermios *termios, +@@ -1471,32 +1468,29 @@ static int lpuart_config_rs485(struct ua modem &= ~UARTMODEM_TXRTSPOL; } @@ -204,7 +192,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 if (rs485->flags & SER_RS485_ENABLED) { /* Enable auto RS-485 RTS mode */ -@@ -1514,10 +1505,10 @@ static int lpuart32_config_rs485(struct uart_port *port, struct ktermios *termio +@@ -1514,10 +1508,10 @@ static int lpuart32_config_rs485(struct modem &= ~UARTMODIR_TXRTSPOL; } @@ -217,7 +205,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 return 0; } -@@ -1828,11 +1819,11 @@ static int lpuart_startup(struct uart_port *port) +@@ -1828,11 +1822,11 @@ static int lpuart_startup(struct uart_po u8 temp; /* determine FIFO size and enable FIFO mode */ @@ -231,7 +219,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 sport->rxfifo_size = UARTFIFO_DEPTH((temp >> UARTPFIFO_RXSIZE_OFF) & UARTPFIFO_FIFOSIZE_MASK); -@@ -1888,11 +1879,11 @@ static int lpuart32_startup(struct uart_port *port) +@@ -1888,11 +1882,11 @@ static int lpuart32_startup(struct uart_ u32 temp; /* determine FIFO size */ @@ -245,7 +233,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 sport->rxfifo_size = UARTFIFO_DEPTH((temp >> UARTFIFO_RXSIZE_OFF) & UARTFIFO_FIFOSIZE_MASK); -@@ -1905,7 +1896,7 @@ static int lpuart32_startup(struct uart_port *port) +@@ -1905,7 +1899,7 @@ static int lpuart32_startup(struct uart_ if (is_layerscape_lpuart(sport)) { sport->rxfifo_size = 16; sport->txfifo_size = 16; @@ -254,7 +242,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 } lpuart_request_dma(sport); -@@ -1965,8 +1956,8 @@ static void lpuart32_shutdown(struct uart_port *port) +@@ -1965,8 +1959,8 @@ static void lpuart32_shutdown(struct uar uart_port_lock_irqsave(port, &flags); /* clear status */ @@ -265,7 +253,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 /* disable Rx/Tx DMA */ temp = lpuart32_read(port, UARTBAUD); -@@ -1995,12 +1986,12 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -1995,12 +1989,12 @@ lpuart_set_termios(struct uart_port *por unsigned int old_csize = old ? old->c_cflag & CSIZE : CS8; unsigned int sbr, brfa; @@ -284,7 +272,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 /* * only support CS8 and CS7, and for CS7 must enable PE. * supported mode: -@@ -2032,7 +2023,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2032,7 +2026,7 @@ lpuart_set_termios(struct uart_port *por * When auto RS-485 RTS mode is enabled, * hardware flow control need to be disabled. */ @@ -293,7 +281,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 termios->c_cflag &= ~CRTSCTS; if (termios->c_cflag & CRTSCTS) -@@ -2073,59 +2064,59 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2073,59 +2067,59 @@ lpuart_set_termios(struct uart_port *por * Need to update the Ring buffer length according to the selected * baud rate and restart Rx DMA path. * @@ -374,7 +362,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 if (old && sport->lpuart_dma_rx_use) { if (!lpuart_start_rx_dma(sport)) -@@ -2134,7 +2125,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2134,7 +2128,7 @@ lpuart_set_termios(struct uart_port *por sport->lpuart_dma_rx_use = false; } @@ -383,7 +371,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 } static void __lpuart32_serial_setbrg(struct uart_port *port, -@@ -2232,9 +2223,9 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2232,9 +2226,9 @@ lpuart32_set_termios(struct uart_port *p unsigned int baud; unsigned int old_csize = old ? old->c_cflag & CSIZE : CS8; @@ -396,7 +384,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 sport->is_cs7 = false; /* * only support CS8 and CS7, and for CS7 must enable PE. -@@ -2267,7 +2258,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2267,7 +2261,7 @@ lpuart32_set_termios(struct uart_port *p * When auto RS-485 RTS mode is enabled, * hardware flow control need to be disabled. */ @@ -405,7 +393,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 termios->c_cflag &= ~CRTSCTS; if (termios->c_cflag & CRTSCTS) -@@ -2308,32 +2299,32 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2308,32 +2302,32 @@ lpuart32_set_termios(struct uart_port *p * Need to update the Ring buffer length according to the selected * baud rate and restart Rx DMA path. * @@ -448,7 +436,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 } /* update the per-port timeout */ -@@ -2345,22 +2336,22 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2345,22 +2339,22 @@ lpuart32_set_termios(struct uart_port *p * asserted. */ if (!(old_ctrl & UARTCTRL_SBK)) { @@ -478,7 +466,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 if ((ctrl & (UARTCTRL_PE | UARTCTRL_M)) == UARTCTRL_PE) sport->is_cs7 = true; -@@ -2372,7 +2363,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2372,7 +2366,7 @@ lpuart32_set_termios(struct uart_port *p sport->lpuart_dma_rx_use = false; } @@ -487,7 +475,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 } static const char *lpuart_type(struct uart_port *port) -@@ -2810,7 +2801,7 @@ static int lpuart_global_reset(struct lpuart_port *sport) +@@ -2810,7 +2804,7 @@ static int lpuart_global_reset(struct lp ret = clk_prepare_enable(sport->ipg_clk); if (ret) { @@ -496,7 +484,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 return ret; } -@@ -2821,10 +2812,10 @@ static int lpuart_global_reset(struct lpuart_port *sport) +@@ -2821,10 +2815,10 @@ static int lpuart_global_reset(struct lp */ ctrl = lpuart32_read(port, UARTCTRL); if (ctrl & UARTCTRL_TE) { @@ -509,7 +497,7 @@ index e86fb9c60f1c3..c2b522843b72c 100644 "timeout waiting for transmit engine to complete\n"); clk_disable_unprepare(sport->ipg_clk); return 0; -@@ -3176,7 +3167,7 @@ static void lpuart_console_fixup(struct lpuart_port *sport) +@@ -3176,7 +3170,7 @@ static void lpuart_console_fixup(struct * in VLLS mode, or restore console setting here. */ if (is_imx7ulp_lpuart(sport) && lpuart_uport_is_active(sport) && @@ -518,6 +506,3 @@ index e86fb9c60f1c3..c2b522843b72c 100644 mutex_lock(&port->mutex); memset(&termios, 0, sizeof(struct ktermios)); --- -2.39.5 - -- 2.47.3