Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tty-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty fixes from Greg KH:
"Here are some small tty/serial fixes for 5.10-rc5 that resolve some
reported issues:

- speakup crash when telling the kernel to use a device that isn't
really there

- imx serial driver fixes for reported problems

- ar933x_uart driver fix for probe error handling path

All have been in linux-next for a while with no reported issues"

* tag 'tty-5.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
serial: ar933x_uart: disable clk on error handling path in probe
tty: serial: imx: keep console clocks always on
speakup: Do not let the line discipline be used several times
tty: serial: imx: fix potential deadlock

+26 -22
+11 -1
drivers/accessibility/speakup/spk_ttyio.c
··· 49 49 50 50 if (!tty->ops->write) 51 51 return -EOPNOTSUPP; 52 + 53 + mutex_lock(&speakup_tty_mutex); 54 + if (speakup_tty) { 55 + mutex_unlock(&speakup_tty_mutex); 56 + return -EBUSY; 57 + } 52 58 speakup_tty = tty; 53 59 54 60 ldisc_data = kmalloc(sizeof(*ldisc_data), GFP_KERNEL); 55 - if (!ldisc_data) 61 + if (!ldisc_data) { 62 + speakup_tty = NULL; 63 + mutex_unlock(&speakup_tty_mutex); 56 64 return -ENOMEM; 65 + } 57 66 58 67 init_completion(&ldisc_data->completion); 59 68 ldisc_data->buf_free = true; 60 69 speakup_tty->disc_data = ldisc_data; 70 + mutex_unlock(&speakup_tty_mutex); 61 71 62 72 return 0; 63 73 }
+4 -2
drivers/tty/serial/ar933x_uart.c
··· 789 789 goto err_disable_clk; 790 790 791 791 up->gpios = mctrl_gpio_init(port, 0); 792 - if (IS_ERR(up->gpios) && PTR_ERR(up->gpios) != -ENOSYS) 793 - return PTR_ERR(up->gpios); 792 + if (IS_ERR(up->gpios) && PTR_ERR(up->gpios) != -ENOSYS) { 793 + ret = PTR_ERR(up->gpios); 794 + goto err_disable_clk; 795 + } 794 796 795 797 up->rts_gpiod = mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS); 796 798
+11 -19
drivers/tty/serial/imx.c
··· 942 942 struct imx_port *sport = dev_id; 943 943 unsigned int usr1, usr2, ucr1, ucr2, ucr3, ucr4; 944 944 irqreturn_t ret = IRQ_NONE; 945 + unsigned long flags = 0; 945 946 946 - spin_lock(&sport->port.lock); 947 + /* 948 + * IRQs might not be disabled upon entering this interrupt handler, 949 + * e.g. when interrupt handlers are forced to be threaded. To support 950 + * this scenario as well, disable IRQs when acquiring the spinlock. 951 + */ 952 + spin_lock_irqsave(&sport->port.lock, flags); 947 953 948 954 usr1 = imx_uart_readl(sport, USR1); 949 955 usr2 = imx_uart_readl(sport, USR2); ··· 1019 1013 ret = IRQ_HANDLED; 1020 1014 } 1021 1015 1022 - spin_unlock(&sport->port.lock); 1016 + spin_unlock_irqrestore(&sport->port.lock, flags); 1023 1017 1024 1018 return ret; 1025 1019 } ··· 2008 2002 unsigned int ucr1; 2009 2003 unsigned long flags = 0; 2010 2004 int locked = 1; 2011 - int retval; 2012 - 2013 - retval = clk_enable(sport->clk_per); 2014 - if (retval) 2015 - return; 2016 - retval = clk_enable(sport->clk_ipg); 2017 - if (retval) { 2018 - clk_disable(sport->clk_per); 2019 - return; 2020 - } 2021 2005 2022 2006 if (sport->port.sysrq) 2023 2007 locked = 0; ··· 2043 2047 2044 2048 if (locked) 2045 2049 spin_unlock_irqrestore(&sport->port.lock, flags); 2046 - 2047 - clk_disable(sport->clk_ipg); 2048 - clk_disable(sport->clk_per); 2049 2050 } 2050 2051 2051 2052 /* ··· 2143 2150 2144 2151 retval = uart_set_options(&sport->port, co, baud, parity, bits, flow); 2145 2152 2146 - clk_disable(sport->clk_ipg); 2147 2153 if (retval) { 2148 - clk_unprepare(sport->clk_ipg); 2154 + clk_disable_unprepare(sport->clk_ipg); 2149 2155 goto error_console; 2150 2156 } 2151 2157 2152 - retval = clk_prepare(sport->clk_per); 2158 + retval = clk_prepare_enable(sport->clk_per); 2153 2159 if (retval) 2154 - clk_unprepare(sport->clk_ipg); 2160 + clk_disable_unprepare(sport->clk_ipg); 2155 2161 2156 2162 error_console: 2157 2163 return retval;