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.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
"Here are some small tty and serial driver fixes to resolve some
reported problems:

- led tty trigger fixes based on review and were acked by the led
maintainer

- revert a max310x serial driver patch as it was causing problems

- revert a pty change as it was also causing problems

All of these have been in linux-next for a while with no reported
problems"

* tag 'tty-5.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
Revert "drivers:tty:pty: Fix a race causing data loss on close"
Revert "serial: max310x: rework RX interrupt handling"
leds: trigger/tty: Use led_set_brightness_sync() from workqueue
leds: trigger: Fix error path to not unlock the unlocked mutex

+13 -47
+4 -7
drivers/leds/trigger/ledtrig-tty.c
··· 51 51 52 52 if (size) { 53 53 ttyname = kmemdup_nul(buf, size, GFP_KERNEL); 54 - if (!ttyname) { 55 - ret = -ENOMEM; 56 - goto out_unlock; 57 - } 54 + if (!ttyname) 55 + return -ENOMEM; 58 56 } else { 59 57 ttyname = NULL; 60 58 } ··· 67 69 68 70 trigger_data->ttyname = ttyname; 69 71 70 - out_unlock: 71 72 mutex_unlock(&trigger_data->mutex); 72 73 73 74 if (ttyname && !running) ··· 122 125 123 126 if (icount.rx != trigger_data->rx || 124 127 icount.tx != trigger_data->tx) { 125 - led_set_brightness(trigger_data->led_cdev, LED_ON); 128 + led_set_brightness_sync(trigger_data->led_cdev, LED_ON); 126 129 127 130 trigger_data->rx = icount.rx; 128 131 trigger_data->tx = icount.tx; 129 132 } else { 130 - led_set_brightness(trigger_data->led_cdev, LED_OFF); 133 + led_set_brightness_sync(trigger_data->led_cdev, LED_OFF); 131 134 } 132 135 133 136 out:
+2 -13
drivers/tty/pty.c
··· 66 66 wake_up_interruptible(&tty->link->read_wait); 67 67 wake_up_interruptible(&tty->link->write_wait); 68 68 if (tty->driver->subtype == PTY_TYPE_MASTER) { 69 - struct file *f; 70 - 69 + set_bit(TTY_OTHER_CLOSED, &tty->flags); 71 70 #ifdef CONFIG_UNIX98_PTYS 72 71 if (tty->driver == ptm_driver) { 73 72 mutex_lock(&devpts_mutex); ··· 75 76 mutex_unlock(&devpts_mutex); 76 77 } 77 78 #endif 78 - 79 - /* 80 - * This hack is required because a program can open a 81 - * pty and redirect a console to it, but if the pty is 82 - * closed and the console is not released, then the 83 - * slave side will never close. So release the 84 - * redirect when the master closes. 85 - */ 86 - f = tty_release_redirect(tty->link); 87 - if (f) 88 - fput(f); 79 + tty_vhangup(tty->link); 89 80 } 90 81 } 91 82
+5 -24
drivers/tty/serial/max310x.c
··· 1056 1056 max310x_port_update(port, MAX310X_MODE1_REG, 1057 1057 MAX310X_MODE1_TRNSCVCTRL_BIT, 0); 1058 1058 1059 - /* Reset FIFOs */ 1060 - max310x_port_write(port, MAX310X_MODE2_REG, 1061 - MAX310X_MODE2_FIFORST_BIT); 1059 + /* Configure MODE2 register & Reset FIFOs*/ 1060 + val = MAX310X_MODE2_RXEMPTINV_BIT | MAX310X_MODE2_FIFORST_BIT; 1061 + max310x_port_write(port, MAX310X_MODE2_REG, val); 1062 1062 max310x_port_update(port, MAX310X_MODE2_REG, 1063 1063 MAX310X_MODE2_FIFORST_BIT, 0); 1064 1064 ··· 1086 1086 /* Clear IRQ status register */ 1087 1087 max310x_port_read(port, MAX310X_IRQSTS_REG); 1088 1088 1089 - /* 1090 - * Let's ask for an interrupt after a timeout equivalent to 1091 - * the receiving time of 4 characters after the last character 1092 - * has been received. 1093 - */ 1094 - max310x_port_write(port, MAX310X_RXTO_REG, 4); 1095 - 1096 - /* 1097 - * Make sure we also get RX interrupts when the RX FIFO is 1098 - * filling up quickly, so get an interrupt when half of the RX 1099 - * FIFO has been filled in. 1100 - */ 1101 - max310x_port_write(port, MAX310X_FIFOTRIGLVL_REG, 1102 - MAX310X_FIFOTRIGLVL_RX(MAX310X_FIFO_SIZE / 2)); 1103 - 1104 - /* Enable RX timeout interrupt in LSR */ 1105 - max310x_port_write(port, MAX310X_LSR_IRQEN_REG, 1106 - MAX310X_LSR_RXTO_BIT); 1107 - 1108 - /* Enable LSR, RX FIFO trigger, CTS change interrupts */ 1109 - val = MAX310X_IRQ_LSR_BIT | MAX310X_IRQ_RXFIFO_BIT | MAX310X_IRQ_TXEMPTY_BIT; 1089 + /* Enable RX, TX, CTS change interrupts */ 1090 + val = MAX310X_IRQ_RXEMPTY_BIT | MAX310X_IRQ_TXEMPTY_BIT; 1110 1091 max310x_port_write(port, MAX310X_IRQEN_REG, val | MAX310X_IRQ_CTS_BIT); 1111 1092 1112 1093 return 0;
+2 -3
drivers/tty/tty_io.c
··· 544 544 * @tty: tty device 545 545 * 546 546 * This is available to the pty code so if the master closes, if the 547 - * slave is a redirect it can release the redirect. It returns the 548 - * filp for the redirect, which must be fput when the operations on 549 - * the tty are completed. 547 + * slave is a redirect it can release the redirect. 550 548 */ 551 549 struct file *tty_release_redirect(struct tty_struct *tty) 552 550 { ··· 559 561 560 562 return f; 561 563 } 564 + EXPORT_SYMBOL_GPL(tty_release_redirect); 562 565 563 566 /** 564 567 * __tty_hangup - actual handler for hangup events