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

Pull tty/serial fixes from Greg KH:
"Here are a few fixes for 3.13-rc5 that resolve a number of reported
tty and serial driver issues"

* tag 'tty-3.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: xuartps: Properly guard sysrq specific code
n_tty: Fix apparent order of echoed output
serial: 8250_dw: add new ACPI IDs
serial: 8250_dw: Fix LCR workaround regression
tty: Fix hang at ldsem_down_read()

+27 -6
+6 -1
drivers/tty/n_tty.c
··· 93 93 size_t canon_head; 94 94 size_t echo_head; 95 95 size_t echo_commit; 96 + size_t echo_mark; 96 97 DECLARE_BITMAP(char_map, 256); 97 98 98 99 /* private to n_tty_receive_overrun (single-threaded) */ ··· 337 336 { 338 337 ldata->read_head = ldata->canon_head = ldata->read_tail = 0; 339 338 ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0; 339 + ldata->echo_mark = 0; 340 340 ldata->line_start = 0; 341 341 342 342 ldata->erasing = 0; ··· 789 787 size_t head; 790 788 791 789 head = ldata->echo_head; 790 + ldata->echo_mark = head; 792 791 old = ldata->echo_commit - ldata->echo_tail; 793 792 794 793 /* Process committed echoes if the accumulated # of bytes ··· 814 811 size_t echoed; 815 812 816 813 if ((!L_ECHO(tty) && !L_ECHONL(tty)) || 817 - ldata->echo_commit == ldata->echo_tail) 814 + ldata->echo_mark == ldata->echo_tail) 818 815 return; 819 816 820 817 mutex_lock(&ldata->output_lock); 818 + ldata->echo_commit = ldata->echo_mark; 821 819 echoed = __process_echoes(tty); 822 820 mutex_unlock(&ldata->output_lock); 823 821 ··· 826 822 tty->ops->flush_chars(tty); 827 823 } 828 824 825 + /* NB: echo_mark and echo_head should be equivalent here */ 829 826 static void flush_echoes(struct tty_struct *tty) 830 827 { 831 828 struct n_tty_data *ldata = tty->disc_data;
+6 -2
drivers/tty/serial/8250/8250_dw.c
··· 96 96 if (offset == UART_LCR) { 97 97 int tries = 1000; 98 98 while (tries--) { 99 - if (value == p->serial_in(p, UART_LCR)) 99 + unsigned int lcr = p->serial_in(p, UART_LCR); 100 + if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR)) 100 101 return; 101 102 dw8250_force_idle(p); 102 103 writeb(value, p->membase + (UART_LCR << p->regshift)); ··· 133 132 if (offset == UART_LCR) { 134 133 int tries = 1000; 135 134 while (tries--) { 136 - if (value == p->serial_in(p, UART_LCR)) 135 + unsigned int lcr = p->serial_in(p, UART_LCR); 136 + if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR)) 137 137 return; 138 138 dw8250_force_idle(p); 139 139 writel(value, p->membase + (UART_LCR << p->regshift)); ··· 457 455 static const struct acpi_device_id dw8250_acpi_match[] = { 458 456 { "INT33C4", 0 }, 459 457 { "INT33C5", 0 }, 458 + { "INT3434", 0 }, 459 + { "INT3435", 0 }, 460 460 { "80860F0A", 0 }, 461 461 { }, 462 462 };
+2
drivers/tty/serial/xilinx_uartps.c
··· 240 240 continue; 241 241 } 242 242 243 + #ifdef SUPPORT_SYSRQ 243 244 /* 244 245 * uart_handle_sysrq_char() doesn't work if 245 246 * spinlocked, for some reason ··· 254 253 } 255 254 spin_lock(&port->lock); 256 255 } 256 + #endif 257 257 258 258 port->icount.rx++; 259 259
+13 -3
drivers/tty/tty_ldsem.c
··· 86 86 return atomic_long_add_return(delta, (atomic_long_t *)&sem->count); 87 87 } 88 88 89 + /* 90 + * ldsem_cmpxchg() updates @*old with the last-known sem->count value. 91 + * Returns 1 if count was successfully changed; @*old will have @new value. 92 + * Returns 0 if count was not changed; @*old will have most recent sem->count 93 + */ 89 94 static inline int ldsem_cmpxchg(long *old, long new, struct ld_semaphore *sem) 90 95 { 91 - long tmp = *old; 92 - *old = atomic_long_cmpxchg(&sem->count, *old, new); 93 - return *old == tmp; 96 + long tmp = atomic_long_cmpxchg(&sem->count, *old, new); 97 + if (tmp == *old) { 98 + *old = new; 99 + return 1; 100 + } else { 101 + *old = tmp; 102 + return 0; 103 + } 94 104 } 95 105 96 106 /*