[opensuse-kernel] [PATCH 0/6] Backport RS485 support for BeagleBoneBlack to Leap 42.2
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com> Hello, Please, consider applying this series to openSUSE-42.2 branch. The following patch series is to enable RS485 support for BeagleBone Black (armv7l architecture). When we moved from deprecated BeagleBone Black serial driver (ttyOx) to new one (ttySx) in master branch, TIOCSRS485 ioctl support in user-space disappeared due to this migration. The support has been brought back in 4.6 using new implementation. The following patches are taken from 4.6 linux kernel release: Matwey V. Kornilov (5): tty: Move serial8250_stop_rx() in front of serial8250_start_tx() tty: Add software emulated RS485 support for 8250 tty: 8250_omap: Use software emulated RS485 direction control tty: serial: Use GFP_ATOMIC instead of GFP_KERNEL in serial8250_em485_init() tty: serial: 8250: Cleanup p->em485 in serial8250_unregister_port Yegor Yefremov (1): tty/serial/8250: fix RS485 half-duplex RX drivers/tty/serial/8250/8250.h | 2 + drivers/tty/serial/8250/8250_core.c | 9 ++ drivers/tty/serial/8250/8250_omap.c | 31 +++++ drivers/tty/serial/8250/8250_port.c | 252 ++++++++++++++++++++++++++++++++++-- include/linux/serial_8250.h | 8 ++ 5 files changed, 288 insertions(+), 14 deletions(-) -- 2.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
From: "Matwey V. Kornilov" <matwey@sai.msu.ru> Software RS485 emultaion is to be added in the following commit. serial8250_start_tx() will need to refer serial8250_stop_rx(). Move serial8250_stop_rx() in front of serial8250_start_tx() in order to avoid function forward declaration. Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch-mainline: v4.6 Git-commit: a07a70bcb72e4a766c8d3173986a773cef842d30 Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> --- drivers/tty/serial/8250/8250_port.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 283f471..6766c11 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1282,6 +1282,19 @@ static void autoconfig_irq(struct uart_8250_port *up) port->irq = (irq > 0) ? irq : 0; } +static void serial8250_stop_rx(struct uart_port *port) +{ + struct uart_8250_port *up = up_to_u8250p(port); + + serial8250_rpm_get(up); + + up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); + up->port.read_status_mask &= ~UART_LSR_DR; + serial_port_out(port, UART_IER, up->ier); + + serial8250_rpm_put(up); +} + static inline void __stop_tx(struct uart_8250_port *p) { if (p->ier & UART_IER_THRI) { @@ -1349,19 +1362,6 @@ static void serial8250_unthrottle(struct uart_port *port) port->unthrottle(port); } -static void serial8250_stop_rx(struct uart_port *port) -{ - struct uart_8250_port *up = up_to_u8250p(port); - - serial8250_rpm_get(up); - - up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); - up->port.read_status_mask &= ~UART_LSR_DR; - serial_port_out(port, UART_IER, up->ier); - - serial8250_rpm_put(up); -} - static void serial8250_disable_ms(struct uart_port *port) { struct uart_8250_port *up = -- 2.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
From: "Matwey V. Kornilov" <matwey@sai.msu.ru> Implementation of software emulation of RS485 direction handling is based on omap_serial driver. Before and after transmission RTS is set to the appropriate value. Note that before calling serial8250_em485_init() the caller has to ensure that UART will interrupt when shift register empty. Otherwise, emultaion cannot be used. Both serial8250_em485_init() and serial8250_em485_destroy() are idempotent functions. Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch-mainline: v4.6 Git-commit: e490c9144cfaa8e2242c1e5d5187230928f27417 Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> --- drivers/tty/serial/8250/8250.h | 2 + drivers/tty/serial/8250/8250_port.c | 223 +++++++++++++++++++++++++++++++++++- include/linux/serial_8250.h | 8 ++ 3 files changed, 229 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index d54dcd8..ce587c0 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -117,6 +117,8 @@ static inline void serial_dl_write(struct uart_8250_port *up, int value) struct uart_8250_port *serial8250_get_port(int line); void serial8250_rpm_get(struct uart_8250_port *p); void serial8250_rpm_put(struct uart_8250_port *p); +int serial8250_em485_init(struct uart_8250_port *p); +void serial8250_em485_destroy(struct uart_8250_port *p); #if defined(__alpha__) && !defined(CONFIG_PCI) /* diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 6766c11..8f2d439 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -37,6 +37,7 @@ #include <linux/slab.h> #include <linux/uaccess.h> #include <linux/pm_runtime.h> +#include <linux/timer.h> #include <asm/io.h> #include <asm/irq.h> @@ -506,6 +507,20 @@ static void serial8250_clear_fifos(struct uart_8250_port *p) } } +static inline void serial8250_em485_rts_after_send(struct uart_8250_port *p) +{ + unsigned char mcr = serial_in(p, UART_MCR); + + if (p->port.rs485.flags & SER_RS485_RTS_AFTER_SEND) + mcr |= UART_MCR_RTS; + else + mcr &= ~UART_MCR_RTS; + serial_out(p, UART_MCR, mcr); +} + +static void serial8250_em485_handle_start_tx(unsigned long arg); +static void serial8250_em485_handle_stop_tx(unsigned long arg); + void serial8250_clear_and_reinit_fifos(struct uart_8250_port *p) { serial8250_clear_fifos(p); @@ -530,6 +545,73 @@ void serial8250_rpm_put(struct uart_8250_port *p) } EXPORT_SYMBOL_GPL(serial8250_rpm_put); +/** + * serial8250_em485_init() - put uart_8250_port into rs485 emulating + * @p: uart_8250_port port instance + * + * The function is used to start rs485 software emulating on the + * &struct uart_8250_port* @p. Namely, RTS is switched before/after + * transmission. The function is idempotent, so it is safe to call it + * multiple times. + * + * The caller MUST enable interrupt on empty shift register before + * calling serial8250_em485_init(). This interrupt is not a part of + * 8250 standard, but implementation defined. + * + * The function is supposed to be called from .rs485_config callback + * or from any other callback protected with p->port.lock spinlock. + * + * See also serial8250_em485_destroy() + * + * Return 0 - success, -errno - otherwise + */ +int serial8250_em485_init(struct uart_8250_port *p) +{ + if (p->em485 != NULL) + return 0; + + p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_KERNEL); + if (p->em485 == NULL) + return -ENOMEM; + + setup_timer(&p->em485->stop_tx_timer, + serial8250_em485_handle_stop_tx, (unsigned long)p); + setup_timer(&p->em485->start_tx_timer, + serial8250_em485_handle_start_tx, (unsigned long)p); + p->em485->active_timer = NULL; + + serial8250_em485_rts_after_send(p); + + return 0; +} +EXPORT_SYMBOL_GPL(serial8250_em485_init); + +/** + * serial8250_em485_destroy() - put uart_8250_port into normal state + * @p: uart_8250_port port instance + * + * The function is used to stop rs485 software emulating on the + * &struct uart_8250_port* @p. The function is idempotent, so it is safe to + * call it multiple times. + * + * The function is supposed to be called from .rs485_config callback + * or from any other callback protected with p->port.lock spinlock. + * + * See also serial8250_em485_init() + */ +void serial8250_em485_destroy(struct uart_8250_port *p) +{ + if (p->em485 == NULL) + return; + + del_timer(&p->em485->start_tx_timer); + del_timer(&p->em485->stop_tx_timer); + + kfree(p->em485); + p->em485 = NULL; +} +EXPORT_SYMBOL_GPL(serial8250_em485_destroy); + /* * These two wrappers ensure that enable_runtime_pm_tx() can be called more than * once and disable_runtime_pm_tx() will still disable RPM because the fifo is @@ -1295,7 +1377,56 @@ static void serial8250_stop_rx(struct uart_port *port) serial8250_rpm_put(up); } -static inline void __stop_tx(struct uart_8250_port *p) +static void __do_stop_tx_rs485(struct uart_8250_port *p) +{ + if (!p->em485) + return; + + serial8250_em485_rts_after_send(p); + /* + * Empty the RX FIFO, we are not interested in anything + * received during the half-duplex transmission. + */ + if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) + serial8250_clear_fifos(p); +} + +static void serial8250_em485_handle_stop_tx(unsigned long arg) +{ + struct uart_8250_port *p = (struct uart_8250_port *)arg; + struct uart_8250_em485 *em485 = p->em485; + unsigned long flags; + + spin_lock_irqsave(&p->port.lock, flags); + if (em485 && + em485->active_timer == &em485->stop_tx_timer) { + __do_stop_tx_rs485(p); + em485->active_timer = NULL; + } + spin_unlock_irqrestore(&p->port.lock, flags); +} + +static void __stop_tx_rs485(struct uart_8250_port *p) +{ + struct uart_8250_em485 *em485 = p->em485; + + if (!em485) + return; + + /* + * __do_stop_tx_rs485 is going to set RTS according to config + * AND flush RX FIFO if required. + */ + if (p->port.rs485.delay_rts_after_send > 0) { + em485->active_timer = &em485->stop_tx_timer; + mod_timer(&em485->stop_tx_timer, jiffies + + p->port.rs485.delay_rts_after_send * HZ / 1000); + } else { + __do_stop_tx_rs485(p); + } +} + +static inline void __do_stop_tx(struct uart_8250_port *p) { if (p->ier & UART_IER_THRI) { p->ier &= ~UART_IER_THRI; @@ -1304,6 +1435,28 @@ static inline void __stop_tx(struct uart_8250_port *p) } } +static inline void __stop_tx(struct uart_8250_port *p) +{ + struct uart_8250_em485 *em485 = p->em485; + + if (em485) { + unsigned char lsr = serial_in(p, UART_LSR); + /* + * To provide required timeing and allow FIFO transfer, + * __stop_tx_rs485 must be called only when both FIFO and + * shift register are empty. It is for device driver to enable + * interrupt on TEMT. + */ + if ((lsr & BOTH_EMPTY) != BOTH_EMPTY) + return; + + del_timer(&em485->start_tx_timer); + em485->active_timer = NULL; + } + __do_stop_tx(p); + __stop_tx_rs485(p); +} + static void serial8250_stop_tx(struct uart_port *port) { struct uart_8250_port *up = up_to_u8250p(port); @@ -1321,12 +1474,10 @@ static void serial8250_stop_tx(struct uart_port *port) serial8250_rpm_put(up); } -static void serial8250_start_tx(struct uart_port *port) +static inline void __start_tx(struct uart_port *port) { struct uart_8250_port *up = up_to_u8250p(port); - serial8250_rpm_get_tx(up); - if (up->dma && !up->dma->tx_dma(up)) return; @@ -1352,6 +1503,70 @@ static void serial8250_start_tx(struct uart_port *port) } } +static inline void start_tx_rs485(struct uart_port *port) +{ + struct uart_8250_port *up = up_to_u8250p(port); + struct uart_8250_em485 *em485 = up->em485; + unsigned char mcr; + + if (!(up->port.rs485.flags & SER_RS485_RX_DURING_TX)) + serial8250_stop_rx(&up->port); + + del_timer(&em485->stop_tx_timer); + em485->active_timer = NULL; + + mcr = serial_in(up, UART_MCR); + if (!!(up->port.rs485.flags & SER_RS485_RTS_ON_SEND) != + !!(mcr & UART_MCR_RTS)) { + if (up->port.rs485.flags & SER_RS485_RTS_ON_SEND) + mcr |= UART_MCR_RTS; + else + mcr &= ~UART_MCR_RTS; + serial_out(up, UART_MCR, mcr); + + if (up->port.rs485.delay_rts_before_send > 0) { + em485->active_timer = &em485->start_tx_timer; + mod_timer(&em485->start_tx_timer, jiffies + + up->port.rs485.delay_rts_before_send * HZ / 1000); + return; + } + } + + __start_tx(port); +} + +static void serial8250_em485_handle_start_tx(unsigned long arg) +{ + struct uart_8250_port *p = (struct uart_8250_port *)arg; + struct uart_8250_em485 *em485 = p->em485; + unsigned long flags; + + spin_lock_irqsave(&p->port.lock, flags); + if (em485 && + em485->active_timer == &em485->start_tx_timer) { + __start_tx(&p->port); + em485->active_timer = NULL; + } + spin_unlock_irqrestore(&p->port.lock, flags); +} + +static void serial8250_start_tx(struct uart_port *port) +{ + struct uart_8250_port *up = up_to_u8250p(port); + struct uart_8250_em485 *em485 = up->em485; + + serial8250_rpm_get_tx(up); + + if (em485 && + em485->active_timer == &em485->start_tx_timer) + return; + + if (em485) + start_tx_rs485(port); + else + __start_tx(port); +} + static void serial8250_throttle(struct uart_port *port) { port->throttle(port); diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index faa0e03..4348797 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -76,6 +76,12 @@ struct uart_8250_ops { void (*release_irq)(struct uart_8250_port *); }; +struct uart_8250_em485 { + struct timer_list start_tx_timer; /* "rs485 start tx" timer */ + struct timer_list stop_tx_timer; /* "rs485 stop tx" timer */ + struct timer_list *active_timer; /* pointer to active timer */ +}; + /* * This should be used by drivers which want to register * their own 8250 ports without registering their own @@ -122,6 +128,8 @@ struct uart_8250_port { /* 8250 specific callbacks */ int (*dl_read)(struct uart_8250_port *); void (*dl_write)(struct uart_8250_port *, int); + + struct uart_8250_em485 *em485; }; static inline struct uart_8250_port *up_to_u8250p(struct uart_port *up) -- 2.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
From: "Matwey V. Kornilov" <matwey@sai.msu.ru> Use software emulated RS485 direction control to provide RS485 API existed in omap_serial driver. Note that 8250_omap issues interrupt on shift register empty which is single prerequesite for using software emulated RS485. Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch-mainline: v4.6 Git-commit: 344cee2470ff70801c95c62ab2762da0834c8c6c Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> --- drivers/tty/serial/8250/8250_omap.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index a2c0734..d710985 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -697,6 +697,36 @@ static void omap_8250_throttle(struct uart_port *port) pm_runtime_put_autosuspend(port->dev); } +static int omap_8250_rs485_config(struct uart_port *port, + struct serial_rs485 *rs485) +{ + struct uart_8250_port *up = up_to_u8250p(port); + + /* Clamp the delays to [0, 100ms] */ + rs485->delay_rts_before_send = min(rs485->delay_rts_before_send, 100U); + rs485->delay_rts_after_send = min(rs485->delay_rts_after_send, 100U); + + port->rs485 = *rs485; + + /* + * Both serial8250_em485_init and serial8250_em485_destroy + * are idempotent + */ + if (rs485->flags & SER_RS485_ENABLED) { + int ret = serial8250_em485_init(up); + + if (ret) { + rs485->flags &= ~SER_RS485_ENABLED; + port->rs485.flags &= ~SER_RS485_ENABLED; + } + return ret; + } + + serial8250_em485_destroy(up); + + return 0; +} + static void omap_8250_unthrottle(struct uart_port *port) { unsigned long flags; @@ -1146,6 +1176,7 @@ static int omap8250_probe(struct platform_device *pdev) up.port.shutdown = omap_8250_shutdown; up.port.throttle = omap_8250_throttle; up.port.unthrottle = omap_8250_unthrottle; + up.port.rs485_config = omap_8250_rs485_config; if (pdev->dev.of_node) { const struct of_device_id *id; -- 2.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
From: "Matwey V. Kornilov" <matwey@sai.msu.ru> serial8250_em485_init() is supposed to be protected with p->port.lock spinlock. This may lead to issues when kmalloc sleeps, so it is better to use GFP_ATOMIC in this spinlocked context. Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") Reported-by: Ильяс Гасанов <torso.nafi@gmail.com> Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch-mainline: v4.6 Git-commit: b18a183eaac25bd8dc51eab85437c7253f5c31d1 Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> --- drivers/tty/serial/8250/8250_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 8f2d439..9f7fb04 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -570,7 +570,7 @@ int serial8250_em485_init(struct uart_8250_port *p) if (p->em485 != NULL) return 0; - p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_KERNEL); + p->em485 = kmalloc(sizeof(struct uart_8250_em485), GFP_ATOMIC); if (p->em485 == NULL) return -ENOMEM; -- 2.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
From: "Matwey V. Kornilov" <matwey@sai.msu.ru> Formally, currently there is no memory leak, but if serial8250_ports[line] is reused with other 8250 driver, then em485 will be already activated and it will cause issues. Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch-mainline: v4.6 Git-commit: bf2a0be45ffc5ab706f9be71a2cdc3f4600cb444 Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> --- drivers/tty/serial/8250/8250_core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 3912646..2483959 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -1067,6 +1067,15 @@ void serial8250_unregister_port(int line) struct uart_8250_port *uart = &serial8250_ports[line]; mutex_lock(&serial_mutex); + + if (uart->em485) { + unsigned long flags; + + spin_lock_irqsave(&uart->port.lock, flags); + serial8250_em485_destroy(uart); + spin_unlock_irqrestore(&uart->port.lock, flags); + } + uart_remove_one_port(&serial8250_reg, &uart->port); if (serial8250_isa_devs) { uart->port.flags &= ~UPF_BOOT_AUTOCONF; -- 2.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
From: Yegor Yefremov <yegorslists@googlemail.com> When in half-duplex mode RX will be disabled before TX, but not enabled after deactivating transmitter. This patch enables UART_IER_RLSI and UART_IER_RDI interrupts after TX is over. Cc: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250") Acked-by: Matwey V. Kornilov <matwey@sai.msu.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Patch-mainline: v4.6 Git-commit: 0c66940d584d1aac92f6a78460dc0ba2efd3b7ba Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> --- drivers/tty/serial/8250/8250_port.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 9f7fb04..9ef080a 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1386,9 +1386,18 @@ static void __do_stop_tx_rs485(struct uart_8250_port *p) /* * Empty the RX FIFO, we are not interested in anything * received during the half-duplex transmission. + * Enable previously disabled RX interrupts. */ - if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) + if (!(p->port.rs485.flags & SER_RS485_RX_DURING_TX)) { serial8250_clear_fifos(p); + + serial8250_rpm_get(p); + + p->ier |= UART_IER_RLSI | UART_IER_RDI; + serial_port_out(&p->port, UART_IER, p->ier); + + serial8250_rpm_put(p); + } } static void serial8250_em485_handle_stop_tx(unsigned long arg) -- 2.1.4 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, 02 Jun 2016 14:57:51 +0200, matwey@sai.msu.ru wrote:
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Hello,
Please, consider applying this series to openSUSE-42.2 branch. The following patch series is to enable RS485 support for BeagleBone Black (armv7l architecture).
When we moved from deprecated BeagleBone Black serial driver (ttyOx) to new one (ttySx) in master branch, TIOCSRS485 ioctl support in user-space disappeared due to this migration. The support has been brought back in 4.6 using new implementation. The following patches are taken from 4.6 linux kernel release:
Well, I really would like to avoid openSUSE-42.2 specific kernel patches. One of the important point in Leap is the sharing of the code base with SLE. And for 42.2, the kernel code is shared with SLE12-SP2. The difference is only the config. The code is very much same. 42.1 was an individual kernel because of the timing, but 42.2 is a different story. That said, these should go through SLE12-SP2, if they are really mandatory. It's not only about this patchset, but any patches to 42.2 kernel in general. Though, I'm not entirely sure which path would work most effectively. For any bugs, usually Bugzilla would be the best place. Furthermore, it sounds like that it's a kernel regression that dropped the support. If so, they should be merged through stable 4.4.x branch as well. thanks, Takashi
Matwey V. Kornilov (5): tty: Move serial8250_stop_rx() in front of serial8250_start_tx() tty: Add software emulated RS485 support for 8250 tty: 8250_omap: Use software emulated RS485 direction control tty: serial: Use GFP_ATOMIC instead of GFP_KERNEL in serial8250_em485_init() tty: serial: 8250: Cleanup p->em485 in serial8250_unregister_port
Yegor Yefremov (1): tty/serial/8250: fix RS485 half-duplex RX
drivers/tty/serial/8250/8250.h | 2 + drivers/tty/serial/8250/8250_core.c | 9 ++ drivers/tty/serial/8250/8250_omap.c | 31 +++++ drivers/tty/serial/8250/8250_port.c | 252 ++++++++++++++++++++++++++++++++++-- include/linux/serial_8250.h | 8 ++ 5 files changed, 288 insertions(+), 14 deletions(-)
-- 2.1.4
-- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, Jun 2, 2016 at 9:30 AM, Takashi Iwai <tiwai@suse.de> wrote:
Furthermore, it sounds like that it's a kernel regression that dropped the support. If so, they should be merged through stable 4.4.x branch as well.
As noted by Richard Brown recently, the 4.4.x LTS kernel is getting a huge amount of changes: === https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.1 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.2 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.3 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.4 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.5 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.6 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.7 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.8 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.9 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.10 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.11 That is over FOURTY THOUSAND lines of changelog entries alone. Not code. _changelog_ === So there does seem to any political reason to not ask to have the fix backported via the official upstream kernel. Greg -- Greg Freemyer www.IntelligentAvatar.net -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, 02 Jun 2016 18:19:31 +0200, Greg Freemyer wrote:
On Thu, Jun 2, 2016 at 9:30 AM, Takashi Iwai <tiwai@suse.de> wrote:
Furthermore, it sounds like that it's a kernel regression that dropped the support. If so, they should be merged through stable 4.4.x branch as well.
As noted by Richard Brown recently, the 4.4.x LTS kernel is getting a huge amount of changes:
=== https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.1 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.2 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.3 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.4 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.5 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.6 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.7 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.8 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.9 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.10 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.4.11
That is over FOURTY THOUSAND lines of changelog entries alone. Not code. _changelog_ ===
So there does seem to any political reason to not ask to have the fix backported via the official upstream kernel.
It makes little sense to count lines, really. 99% of such cases are just because of lack of Cc to stable in the commit log. Usually the patch author is supposed to put Cc to stable when the patch is for fixing a regression. But people often forget it, and maintainers don't pay extra attention always to that, either. If the patches are confirmed indeed for fixing real bugs, especially regressions at a later stage, and if they are backportable, they can go to stable kernels at any time later, too. You just need to test the patches, and send/inform to stable maintainers which commits to be backported to which kernel. This can be done by anyone, including you :) Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Thu, 02 Jun 2016 15:30:42 +0200, Takashi Iwai wrote:
On Thu, 02 Jun 2016 14:57:51 +0200, matwey@sai.msu.ru wrote:
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Hello,
Please, consider applying this series to openSUSE-42.2 branch. The following patch series is to enable RS485 support for BeagleBone Black (armv7l architecture).
When we moved from deprecated BeagleBone Black serial driver (ttyOx) to new one (ttySx) in master branch, TIOCSRS485 ioctl support in user-space disappeared due to this migration. The support has been brought back in 4.6 using new implementation. The following patches are taken from 4.6 linux kernel release:
Well, I really would like to avoid openSUSE-42.2 specific kernel patches. One of the important point in Leap is the sharing of the code base with SLE. And for 42.2, the kernel code is shared with SLE12-SP2. The difference is only the config. The code is very much same.
42.1 was an individual kernel because of the timing, but 42.2 is a different story.
That said, these should go through SLE12-SP2, if they are really mandatory. It's not only about this patchset, but any patches to 42.2 kernel in general.
Though, I'm not entirely sure which path would work most effectively. For any bugs, usually Bugzilla would be the best place.
Matwey, could you open a Bugzilla entry for tracking the bug and your patches? Then we can evaluate there and merge to SLE12-SP2 and openSUSE-42.2 branch. Also we can try to push to stable 4.4.x tree if appropriate. thanks, Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
2016-06-03 16:46 GMT+03:00 Takashi Iwai <tiwai@suse.de>:
On Thu, 02 Jun 2016 15:30:42 +0200, Takashi Iwai wrote:
On Thu, 02 Jun 2016 14:57:51 +0200, matwey@sai.msu.ru wrote:
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Hello,
Please, consider applying this series to openSUSE-42.2 branch. The following patch series is to enable RS485 support for BeagleBone Black (armv7l architecture).
When we moved from deprecated BeagleBone Black serial driver (ttyOx) to new one (ttySx) in master branch, TIOCSRS485 ioctl support in user-space disappeared due to this migration. The support has been brought back in 4.6 using new implementation. The following patches are taken from 4.6 linux kernel release:
Well, I really would like to avoid openSUSE-42.2 specific kernel patches. One of the important point in Leap is the sharing of the code base with SLE. And for 42.2, the kernel code is shared with SLE12-SP2. The difference is only the config. The code is very much same.
42.1 was an individual kernel because of the timing, but 42.2 is a different story.
That said, these should go through SLE12-SP2, if they are really mandatory. It's not only about this patchset, but any patches to 42.2 kernel in general.
Though, I'm not entirely sure which path would work most effectively. For any bugs, usually Bugzilla would be the best place.
Matwey, could you open a Bugzilla entry for tracking the bug and your patches? Then we can evaluate there and merge to SLE12-SP2 and openSUSE-42.2 branch. Also we can try to push to stable 4.4.x tree if appropriate.
Hello, Sorry for the delay with answer. I'll create the bugreport. Should I attach the patches as files or may just put link here? I think that this series does not fulfill kernel stable rules. From the formal point of view, it adds new feature. Issue in openSUSE that we have two mutual kernel modules for the same hardware (the modules can not been compiled or run together) and each module implements its own set of features, so I am trying to add the most required missed feature. I've started this series development in Nov 2015 based on 4.3, so this definitely worked on 4.3, not only on 4.6. -- With best regards, Matwey V. Kornilov. Sternberg Astronomical Institute, Lomonosov Moscow State University, Russia 119991, Moscow, Universitetsky pr-k 13, +7 (495) 9392382 -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Fri, 03 Jun 2016 18:28:50 +0200, Matwey V. Kornilov wrote:
2016-06-03 16:46 GMT+03:00 Takashi Iwai <tiwai@suse.de>:
On Thu, 02 Jun 2016 15:30:42 +0200, Takashi Iwai wrote:
On Thu, 02 Jun 2016 14:57:51 +0200, matwey@sai.msu.ru wrote:
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Hello,
Please, consider applying this series to openSUSE-42.2 branch. The following patch series is to enable RS485 support for BeagleBone Black (armv7l architecture).
When we moved from deprecated BeagleBone Black serial driver (ttyOx) to new one (ttySx) in master branch, TIOCSRS485 ioctl support in user-space disappeared due to this migration. The support has been brought back in 4.6 using new implementation. The following patches are taken from 4.6 linux kernel release:
Well, I really would like to avoid openSUSE-42.2 specific kernel patches. One of the important point in Leap is the sharing of the code base with SLE. And for 42.2, the kernel code is shared with SLE12-SP2. The difference is only the config. The code is very much same.
42.1 was an individual kernel because of the timing, but 42.2 is a different story.
That said, these should go through SLE12-SP2, if they are really mandatory. It's not only about this patchset, but any patches to 42.2 kernel in general.
Though, I'm not entirely sure which path would work most effectively. For any bugs, usually Bugzilla would be the best place.
Matwey, could you open a Bugzilla entry for tracking the bug and your patches? Then we can evaluate there and merge to SLE12-SP2 and openSUSE-42.2 branch. Also we can try to push to stable 4.4.x tree if appropriate.
Hello,
Sorry for the delay with answer. I'll create the bugreport. Should I attach the patches as files or may just put link here?
At best, attach files.
I think that this series does not fulfill kernel stable rules. From the formal point of view, it adds new feature. Issue in openSUSE that we have two mutual kernel modules for the same hardware (the modules can not been compiled or run together) and each module implements its own set of features, so I am trying to add the most required missed feature. I've started this series development in Nov 2015 based on 4.3, so this definitely worked on 4.3, not only on 4.6.
Hrm, but if something worked and it doesn't work in the later version, it's called a regression. And we should fix the regression. If these patches do actually fix the regression, it's still worth to put as stable kernels. In anyway, let's continue discussion on bugzilla. thanks, Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
On Fri, 03 Jun 2016 18:28:50 +0200, Matwey V. Kornilov wrote:
2016-06-03 16:46 GMT+03:00 Takashi Iwai <tiwai@suse.de>:
On Thu, 02 Jun 2016 15:30:42 +0200, Takashi Iwai wrote:
On Thu, 02 Jun 2016 14:57:51 +0200, matwey@sai.msu.ru wrote:
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Hello,
Please, consider applying this series to openSUSE-42.2 branch. The following patch series is to enable RS485 support for BeagleBone Black (armv7l architecture).
When we moved from deprecated BeagleBone Black serial driver (ttyOx) to new one (ttySx) in master branch, TIOCSRS485 ioctl support in user-space disappeared due to this migration. The support has been brought back in 4.6 using new implementation. The following patches are taken from 4.6 linux kernel release:
Well, I really would like to avoid openSUSE-42.2 specific kernel patches. One of the important point in Leap is the sharing of the code base with SLE. And for 42.2, the kernel code is shared with SLE12-SP2. The difference is only the config. The code is very much same.
42.1 was an individual kernel because of the timing, but 42.2 is a different story.
That said, these should go through SLE12-SP2, if they are really mandatory. It's not only about this patchset, but any patches to 42.2 kernel in general.
Though, I'm not entirely sure which path would work most effectively. For any bugs, usually Bugzilla would be the best place.
Matwey, could you open a Bugzilla entry for tracking the bug and your patches? Then we can evaluate there and merge to SLE12-SP2 and openSUSE-42.2 branch. Also we can try to push to stable 4.4.x tree if appropriate.
Hello,
Sorry for the delay with answer. I'll create the bugreport. Should I attach the patches as files or may just put link here? I think that this series does not fulfill kernel stable rules. From the formal point of view, it adds new feature.
Right. But if the patches serve to filling the gap for user-space with the previously working setup, it can be seen as a "fix", too. At least, it's worth to give it a try. The patches aren't intrusive and small enough, so I guess you have some good chance to get them merged to stable tree. Takashi -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (4)
-
Greg Freemyer
-
Matwey V. Kornilov
-
matwey@sai.msu.ru
-
Takashi Iwai