From 1be0f3ac959bc5b59041783f9d83bc6e991e1a87 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 23 Jul 2022 17:19:55 +0200 Subject: [PATCH] 5.15-stable patches added patches: batman-adv-use-netif_rx_any_context-any.patch serial-mvebu-uart-correctly-report-configured-baudrate-value.patch --- ...man-adv-use-netif_rx_any_context-any.patch | 45 +++++++++ ...tly-report-configured-baudrate-value.patch | 92 +++++++++++++++++++ queue-5.15/series | 2 + 3 files changed, 139 insertions(+) create mode 100644 queue-5.15/batman-adv-use-netif_rx_any_context-any.patch create mode 100644 queue-5.15/serial-mvebu-uart-correctly-report-configured-baudrate-value.patch diff --git a/queue-5.15/batman-adv-use-netif_rx_any_context-any.patch b/queue-5.15/batman-adv-use-netif_rx_any_context-any.patch new file mode 100644 index 00000000000..9ad180f3b1b --- /dev/null +++ b/queue-5.15/batman-adv-use-netif_rx_any_context-any.patch @@ -0,0 +1,45 @@ +From bigeasy@linutronix.de Sat Jul 23 17:18:39 2022 +From: Sebastian Andrzej Siewior +Date: Tue, 19 Jul 2022 18:08:12 +0200 +Subject: batman-adv: Use netif_rx_any_context() any. +To: Greg Kroah-Hartman , Sasha Levin +Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Antonio Quartulli , Marek Lindner , Simon Wunderlich , Sven Eckelmann , b.a.t.m.a.n@lists.open-mesh.org, "David S. Miller" , Thomas Gleixner +Message-ID: +Content-Disposition: inline + +From: Sebastian Andrzej Siewior + +This reverts the stable commit + e65d78b12fbc0 ("batman-adv: Use netif_rx().") + +The commit message says: + +| Since commit +| baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") +| +| the function netif_rx() can be used in preemptible/thread context as +| well as in interrupt context. + +This commit (baebdf48c3600) has not been backported to the 5.15 stable +series and therefore, the commit which builds upon it, must not be +backported either. + +Revert the backport and use netif_rx_any_context() again. + +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Greg Kroah-Hartman +--- + net/batman-adv/bridge_loop_avoidance.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/batman-adv/bridge_loop_avoidance.c ++++ b/net/batman-adv/bridge_loop_avoidance.c +@@ -443,7 +443,7 @@ static void batadv_bla_send_claim(struct + batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES, + skb->len + ETH_HLEN); + +- netif_rx(skb); ++ netif_rx_any_context(skb); + out: + batadv_hardif_put(primary_if); + } diff --git a/queue-5.15/serial-mvebu-uart-correctly-report-configured-baudrate-value.patch b/queue-5.15/serial-mvebu-uart-correctly-report-configured-baudrate-value.patch new file mode 100644 index 00000000000..fbc5d25ec06 --- /dev/null +++ b/queue-5.15/serial-mvebu-uart-correctly-report-configured-baudrate-value.patch @@ -0,0 +1,92 @@ +From 4f532c1e25319e42996ec18a1f473fd50c8e575d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pali=20Roh=C3=A1r?= +Date: Tue, 28 Jun 2022 12:09:22 +0200 +Subject: serial: mvebu-uart: correctly report configured baudrate value +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pali Rohár + +commit 4f532c1e25319e42996ec18a1f473fd50c8e575d upstream. + +Functions tty_termios_encode_baud_rate() and uart_update_timeout() should +be called with the baudrate value which was set to hardware. Linux then +report exact values via ioctl(TCGETS2) to userspace. + +Change mvebu_uart_baud_rate_set() function to return baudrate value which +was set to hardware and propagate this value to above mentioned functions. + +With this change userspace would see precise value in termios c_ospeed +field. + +Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate") +Cc: stable +Reviewed-by: Ilpo Järvinen +Signed-off-by: Pali Rohár +Link: https://lore.kernel.org/r/20220628100922.10717-1-pali@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/mvebu-uart.c | 25 +++++++++++++------------ + 1 file changed, 13 insertions(+), 12 deletions(-) + +--- a/drivers/tty/serial/mvebu-uart.c ++++ b/drivers/tty/serial/mvebu-uart.c +@@ -442,13 +442,13 @@ static void mvebu_uart_shutdown(struct u + } + } + +-static int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud) ++static unsigned int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud) + { + unsigned int d_divisor, m_divisor; + u32 brdv, osamp; + + if (!port->uartclk) +- return -EOPNOTSUPP; ++ return 0; + + /* + * The baudrate is derived from the UART clock thanks to two divisors: +@@ -472,7 +472,7 @@ static int mvebu_uart_baud_rate_set(stru + osamp &= ~OSAMP_DIVISORS_MASK; + writel(osamp, port->membase + UART_OSAMP); + +- return 0; ++ return DIV_ROUND_CLOSEST(port->uartclk, d_divisor * m_divisor); + } + + static void mvebu_uart_set_termios(struct uart_port *port, +@@ -509,15 +509,11 @@ static void mvebu_uart_set_termios(struc + max_baud = 230400; + + baud = uart_get_baud_rate(port, termios, old, min_baud, max_baud); +- if (mvebu_uart_baud_rate_set(port, baud)) { +- /* No clock available, baudrate cannot be changed */ +- if (old) +- baud = uart_get_baud_rate(port, old, NULL, +- min_baud, max_baud); +- } else { +- tty_termios_encode_baud_rate(termios, baud, baud); +- uart_update_timeout(port, termios->c_cflag, baud); +- } ++ baud = mvebu_uart_baud_rate_set(port, baud); ++ ++ /* In case baudrate cannot be changed, report previous old value */ ++ if (baud == 0 && old) ++ baud = tty_termios_baud_rate(old); + + /* Only the following flag changes are supported */ + if (old) { +@@ -528,6 +524,11 @@ static void mvebu_uart_set_termios(struc + termios->c_cflag |= CS8; + } + ++ if (baud != 0) { ++ tty_termios_encode_baud_rate(termios, baud, baud); ++ uart_update_timeout(port, termios->c_cflag, baud); ++ } ++ + spin_unlock_irqrestore(&port->lock, flags); + } + diff --git a/queue-5.15/series b/queue-5.15/series index 968c48acaff..cc361d4038f 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -11,3 +11,5 @@ pci-hv-fix-multi-msi-to-allow-more-than-one-msi-vector.patch pci-hv-fix-hv_arch_irq_unmask-for-multi-msi.patch pci-hv-reuse-existing-irte-allocation-in-compose_msi_msg.patch pci-hv-fix-interrupt-mapping-for-multi-msi.patch +serial-mvebu-uart-correctly-report-configured-baudrate-value.patch +batman-adv-use-netif_rx_any_context-any.patch -- 2.47.3