From: Sasha Levin Date: Sat, 5 Nov 2022 13:48:37 +0000 (-0400) Subject: Fix up backport of serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch X-Git-Tag: v4.9.333~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea02c5d65a2b62b9354e4d847f028e2f42e23f21;p=thirdparty%2Fkernel%2Fstable-queue.git Fix up backport of serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch --- diff --git a/queue-5.10/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch b/queue-5.10/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch index 322347cb10a..b9357ed8b22 100644 --- a/queue-5.10/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch +++ b/queue-5.10/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch @@ -1,6 +1,6 @@ -From ed5a30b1b62a514b606e883884676bac9b544c25 Mon Sep 17 00:00:00 2001 +From 9a1e798893679aeb400f255fdacdd066087c0ed6 Mon Sep 17 00:00:00 2001 From: Sasha Levin -Date: Sun, 11 Sep 2022 11:12:15 +0200 +Date: Sat, 5 Nov 2022 09:46:40 -0400 Subject: serial: ar933x: Deassert Transmit Enable on ->rs485_config() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,7 +8,7 @@ Content-Transfer-Encoding: 8bit From: Lukas Wunner -[ Upstream commit 3a939433ddc1bab98be028903aaa286e5e7461d7 ] +commit 3a939433ddc1bab98be028903aaa286e5e7461d7 upstream. The ar933x_uart driver neglects to deassert Transmit Enable when ->rs485_config() is invoked. Fix it. @@ -16,33 +16,29 @@ The ar933x_uart driver neglects to deassert Transmit Enable when Fixes: 9be1064fe524 ("serial: ar933x_uart: add RS485 support") Cc: stable@vger.kernel.org # v5.7+ Cc: Daniel Golle -Reviewed-by: Ilpo Järvinen +Reviewed-by: Ilpo JÀrvinen Signed-off-by: Lukas Wunner -Link: https://lore.kernel.org/r/5b36af26e57553f084334666e7d24c7fd131a01e.1662887231.git.lukas@wunner.de -Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- - drivers/tty/serial/ar933x_uart.c | 7 +++++++ - 1 file changed, 7 insertions(+) + drivers/tty/serial/ar933x_uart.c | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c -index be3f5d8f683b..23f2d9937cfc 100644 +index 4379ca4842ae..0f2677695b52 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c -@@ -585,6 +585,13 @@ static const struct uart_ops ar933x_uart_ops = { - static int ar933x_config_rs485(struct uart_port *port, - struct serial_rs485 *rs485conf) - { -+ struct ar933x_uart_port *up = -+ container_of(port, struct ar933x_uart_port, port); +@@ -591,6 +591,11 @@ static int ar933x_config_rs485(struct uart_port *port, + dev_err(port->dev, "RS485 needs rts-gpio\n"); + return 1; + } + -+ if (port->rs485.flags & SER_RS485_ENABLED) ++ if (rs485conf->flags & SER_RS485_ENABLED) + gpiod_set_value(up->rts_gpiod, + !!(rs485conf->flags & SER_RS485_RTS_AFTER_SEND)); + + port->rs485 = *rs485conf; return 0; } - -- 2.35.1 diff --git a/queue-5.10/serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch b/queue-5.10/serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch deleted file mode 100644 index 6fcf7240448..00000000000 --- a/queue-5.10/serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 5f883654fb7bc06350c4f9c8b07b0690bb946879 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sun, 10 Jul 2022 18:44:36 +0200 -Subject: serial: ar933x: Remove superfluous code in ar933x_config_rs485() - -From: Lino Sanfilippo - -[ Upstream commit 184842622c97da2f88f365a981af05432baa5385 ] - -In ar933x_config_rs485() the check for the RTS GPIO is not needed since in -case the GPIO is not available at driver init ar933x_no_rs485 is assigned -to port->rs485_supported and this function is never called. So remove the -check. - -Also in uart_set_rs485_config() the serial core already assigns the passed -serial_rs485 struct to the uart port. So remove the assignment in the -drivers rs485_config() function to avoid redundancy. - -Signed-off-by: Lino Sanfilippo -Link: https://lore.kernel.org/r/20220710164442.2958979-3-LinoSanfilippo@gmx.de -Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: 3a939433ddc1 ("serial: ar933x: Deassert Transmit Enable on ->rs485_config()") -Signed-off-by: Sasha Levin ---- - drivers/tty/serial/ar933x_uart.c | 9 --------- - 1 file changed, 9 deletions(-) - -diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c -index c2be7cf91399..be3f5d8f683b 100644 ---- a/drivers/tty/serial/ar933x_uart.c -+++ b/drivers/tty/serial/ar933x_uart.c -@@ -585,15 +585,6 @@ static const struct uart_ops ar933x_uart_ops = { - static int ar933x_config_rs485(struct uart_port *port, - struct serial_rs485 *rs485conf) - { -- struct ar933x_uart_port *up = -- container_of(port, struct ar933x_uart_port, port); -- -- if ((rs485conf->flags & SER_RS485_ENABLED) && -- !up->rts_gpiod) { -- dev_err(port->dev, "RS485 needs rts-gpio\n"); -- return 1; -- } -- port->rs485 = *rs485conf; - return 0; - } - --- -2.35.1 - diff --git a/queue-5.10/series b/queue-5.10/series index e68c0a39479..135ef59a193 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -1,5 +1,4 @@ serial-8250-let-drivers-request-full-16550a-feature-.patch -serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch kvm-nvmx-pull-kvm-l0-s-desired-controls-directly-fro.patch kvm-nvmx-don-t-propagate-vmcs12-s-perf_global_ctrl-s.patch diff --git a/queue-5.15/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch b/queue-5.15/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch index 445d54619ae..b9357ed8b22 100644 --- a/queue-5.15/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch +++ b/queue-5.15/serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch @@ -1,6 +1,6 @@ -From c737ecf2d493533f6062300c0ada22c5788ce0c5 Mon Sep 17 00:00:00 2001 +From 9a1e798893679aeb400f255fdacdd066087c0ed6 Mon Sep 17 00:00:00 2001 From: Sasha Levin -Date: Sun, 11 Sep 2022 11:12:15 +0200 +Date: Sat, 5 Nov 2022 09:46:40 -0400 Subject: serial: ar933x: Deassert Transmit Enable on ->rs485_config() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -8,7 +8,7 @@ Content-Transfer-Encoding: 8bit From: Lukas Wunner -[ Upstream commit 3a939433ddc1bab98be028903aaa286e5e7461d7 ] +commit 3a939433ddc1bab98be028903aaa286e5e7461d7 upstream. The ar933x_uart driver neglects to deassert Transmit Enable when ->rs485_config() is invoked. Fix it. @@ -16,33 +16,29 @@ The ar933x_uart driver neglects to deassert Transmit Enable when Fixes: 9be1064fe524 ("serial: ar933x_uart: add RS485 support") Cc: stable@vger.kernel.org # v5.7+ Cc: Daniel Golle -Reviewed-by: Ilpo Järvinen +Reviewed-by: Ilpo JÀrvinen Signed-off-by: Lukas Wunner -Link: https://lore.kernel.org/r/5b36af26e57553f084334666e7d24c7fd131a01e.1662887231.git.lukas@wunner.de -Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- - drivers/tty/serial/ar933x_uart.c | 7 +++++++ - 1 file changed, 7 insertions(+) + drivers/tty/serial/ar933x_uart.c | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c -index 7e89e563359a..394e960fd33c 100644 +index 4379ca4842ae..0f2677695b52 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c -@@ -583,6 +583,13 @@ static const struct uart_ops ar933x_uart_ops = { - static int ar933x_config_rs485(struct uart_port *port, - struct serial_rs485 *rs485conf) - { -+ struct ar933x_uart_port *up = -+ container_of(port, struct ar933x_uart_port, port); +@@ -591,6 +591,11 @@ static int ar933x_config_rs485(struct uart_port *port, + dev_err(port->dev, "RS485 needs rts-gpio\n"); + return 1; + } + -+ if (port->rs485.flags & SER_RS485_ENABLED) ++ if (rs485conf->flags & SER_RS485_ENABLED) + gpiod_set_value(up->rts_gpiod, + !!(rs485conf->flags & SER_RS485_RTS_AFTER_SEND)); + + port->rs485 = *rs485conf; return 0; } - -- 2.35.1 diff --git a/queue-5.15/serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch b/queue-5.15/serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch deleted file mode 100644 index 04a2f1aad20..00000000000 --- a/queue-5.15/serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 5aa54b067a13313f3088aed18bcc55bbe955e38c Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Sun, 10 Jul 2022 18:44:36 +0200 -Subject: serial: ar933x: Remove superfluous code in ar933x_config_rs485() - -From: Lino Sanfilippo - -[ Upstream commit 184842622c97da2f88f365a981af05432baa5385 ] - -In ar933x_config_rs485() the check for the RTS GPIO is not needed since in -case the GPIO is not available at driver init ar933x_no_rs485 is assigned -to port->rs485_supported and this function is never called. So remove the -check. - -Also in uart_set_rs485_config() the serial core already assigns the passed -serial_rs485 struct to the uart port. So remove the assignment in the -drivers rs485_config() function to avoid redundancy. - -Signed-off-by: Lino Sanfilippo -Link: https://lore.kernel.org/r/20220710164442.2958979-3-LinoSanfilippo@gmx.de -Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: 3a939433ddc1 ("serial: ar933x: Deassert Transmit Enable on ->rs485_config()") -Signed-off-by: Sasha Levin ---- - drivers/tty/serial/ar933x_uart.c | 9 --------- - 1 file changed, 9 deletions(-) - -diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c -index 4379ca4842ae..7e89e563359a 100644 ---- a/drivers/tty/serial/ar933x_uart.c -+++ b/drivers/tty/serial/ar933x_uart.c -@@ -583,15 +583,6 @@ static const struct uart_ops ar933x_uart_ops = { - static int ar933x_config_rs485(struct uart_port *port, - struct serial_rs485 *rs485conf) - { -- struct ar933x_uart_port *up = -- container_of(port, struct ar933x_uart_port, port); -- -- if ((rs485conf->flags & SER_RS485_ENABLED) && -- !up->rts_gpiod) { -- dev_err(port->dev, "RS485 needs rts-gpio\n"); -- return 1; -- } -- port->rs485 = *rs485conf; - return 0; - } - --- -2.35.1 - diff --git a/queue-5.15/series b/queue-5.15/series index 4cc33183d09..bffbf9a7f59 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -3,7 +3,6 @@ scsi-lpfc-adjust-cmf-total-bytes-and-rxmonitor.patch scsi-lpfc-rework-mib-rx-monitor-debug-info-logic.patch scsi-qla2xxx-enhance-driver-tracing-with-separate-tu.patch scsi-qla2xxx-define-static-symbols.patch -serial-ar933x-remove-superfluous-code-in-ar933x_conf.patch serial-ar933x-deassert-transmit-enable-on-rs485_conf.patch kvm-x86-trace-re-injected-exceptions.patch kvm-x86-treat-dbs-from-the-emulator-as-fault-like-co.patch