You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge 3.2-rc3 into tty-next to handle merge conflict in tty_ldisc.c
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
@@ -46,6 +46,7 @@ static inline char __dcc_getchar(void)
|
||||
|
||||
asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
|
||||
: "=r" (__c));
|
||||
isb();
|
||||
|
||||
return __c;
|
||||
}
|
||||
@@ -55,6 +56,7 @@ static inline void __dcc_putchar(char c)
|
||||
asm volatile("mcr p14, 0, %0, c0, c5, 0 @ write a char"
|
||||
: /* no output register */
|
||||
: "r" (c));
|
||||
isb();
|
||||
}
|
||||
|
||||
static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
|
||||
|
||||
+7
-5
@@ -66,14 +66,16 @@
|
||||
static int debug;
|
||||
module_param(debug, int, 0600);
|
||||
|
||||
#define T1 (HZ/10)
|
||||
#define T2 (HZ/3)
|
||||
#define N2 3
|
||||
/* Defaults: these are from the specification */
|
||||
|
||||
#define T1 10 /* 100mS */
|
||||
#define T2 34 /* 333mS */
|
||||
#define N2 3 /* Retry 3 times */
|
||||
|
||||
/* Use long timers for testing at low speed with debug on */
|
||||
#ifdef DEBUG_TIMING
|
||||
#define T1 HZ
|
||||
#define T2 (2 * HZ)
|
||||
#define T1 100
|
||||
#define T2 200
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -1581,7 +1581,7 @@ config SERIAL_IFX6X60
|
||||
Support for the IFX6x60 modem devices on Intel MID platforms.
|
||||
|
||||
config SERIAL_PCH_UART
|
||||
tristate "Intel EG20T PCH / OKI SEMICONDUCTOR IOH(ML7213/ML7223) UART"
|
||||
tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) UART"
|
||||
depends on PCI
|
||||
select SERIAL_CORE
|
||||
help
|
||||
@@ -1589,12 +1589,12 @@ config SERIAL_PCH_UART
|
||||
which is an IOH(Input/Output Hub) for x86 embedded processor.
|
||||
Enabling PCH_DMA, this PCH UART works as DMA mode.
|
||||
|
||||
This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
|
||||
Output Hub), ML7213 and ML7223.
|
||||
ML7213 IOH is for IVI(In-Vehicle Infotainment) use and ML7223 IOH is
|
||||
for MP(Media Phone) use.
|
||||
ML7213/ML7223 is companion chip for Intel Atom E6xx series.
|
||||
ML7213/ML7223 is completely compatible for Intel EG20T PCH.
|
||||
This driver also can be used for LAPIS Semiconductor IOH(Input/
|
||||
Output Hub), ML7213, ML7223 and ML7831.
|
||||
ML7213 IOH is for IVI(In-Vehicle Infotainment) use, ML7223 IOH is
|
||||
for MP(Media Phone) use and ML7831 IOH is for general purpose use.
|
||||
ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
|
||||
ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
|
||||
|
||||
config SERIAL_PCH_UART_CONSOLE
|
||||
bool "Support for console on Intel EG20T PCH UART/OKI SEMICONDUCTOR ML7213 IOH"
|
||||
|
||||
@@ -228,7 +228,7 @@ void atmel_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
|
||||
if (rs485conf->flags & SER_RS485_ENABLED) {
|
||||
dev_dbg(port->dev, "Setting UART to RS485\n");
|
||||
atmel_port->tx_done_mask = ATMEL_US_TXEMPTY;
|
||||
if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND)
|
||||
if ((rs485conf->delay_rts_after_send) > 0)
|
||||
UART_PUT_TTGR(port, rs485conf->delay_rts_after_send);
|
||||
mode |= ATMEL_US_USMODE_RS485;
|
||||
} else {
|
||||
@@ -304,7 +304,7 @@ static void atmel_set_mctrl(struct uart_port *port, u_int mctrl)
|
||||
|
||||
if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
|
||||
dev_dbg(port->dev, "Setting UART to RS485\n");
|
||||
if (atmel_port->rs485.flags & SER_RS485_RTS_AFTER_SEND)
|
||||
if ((atmel_port->rs485.delay_rts_after_send) > 0)
|
||||
UART_PUT_TTGR(port,
|
||||
atmel_port->rs485.delay_rts_after_send);
|
||||
mode |= ATMEL_US_USMODE_RS485;
|
||||
@@ -1228,7 +1228,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
|
||||
if (atmel_port->rs485.flags & SER_RS485_ENABLED) {
|
||||
dev_dbg(port->dev, "Setting UART to RS485\n");
|
||||
if (atmel_port->rs485.flags & SER_RS485_RTS_AFTER_SEND)
|
||||
if ((atmel_port->rs485.delay_rts_after_send) > 0)
|
||||
UART_PUT_TTGR(port,
|
||||
atmel_port->rs485.delay_rts_after_send);
|
||||
mode |= ATMEL_US_USMODE_RS485;
|
||||
@@ -1442,16 +1442,6 @@ static void __devinit atmel_of_init_port(struct atmel_uart_port *atmel_port,
|
||||
rs485conf->delay_rts_after_send = rs485_delay[1];
|
||||
rs485conf->flags = 0;
|
||||
|
||||
if (rs485conf->delay_rts_before_send == 0 &&
|
||||
rs485conf->delay_rts_after_send == 0) {
|
||||
rs485conf->flags |= SER_RS485_RTS_ON_SEND;
|
||||
} else {
|
||||
if (rs485conf->delay_rts_before_send)
|
||||
rs485conf->flags |= SER_RS485_RTS_BEFORE_SEND;
|
||||
if (rs485conf->delay_rts_after_send)
|
||||
rs485conf->flags |= SER_RS485_RTS_AFTER_SEND;
|
||||
}
|
||||
|
||||
if (of_get_property(np, "rs485-rx-during-tx", NULL))
|
||||
rs485conf->flags |= SER_RS485_RX_DURING_TX;
|
||||
|
||||
|
||||
@@ -3234,9 +3234,8 @@ rs_write(struct tty_struct *tty,
|
||||
e100_disable_rx(info);
|
||||
e100_enable_rx_irq(info);
|
||||
#endif
|
||||
if ((info->rs485.flags & SER_RS485_RTS_BEFORE_SEND) &&
|
||||
(info->rs485.delay_rts_before_send > 0))
|
||||
msleep(info->rs485.delay_rts_before_send);
|
||||
if (info->rs485.delay_rts_before_send > 0)
|
||||
msleep(info->rs485.delay_rts_before_send);
|
||||
}
|
||||
#endif /* CONFIG_ETRAX_RS485 */
|
||||
|
||||
@@ -3693,10 +3692,6 @@ rs_ioctl(struct tty_struct *tty,
|
||||
|
||||
rs485data.delay_rts_before_send = rs485ctrl.delay_rts_before_send;
|
||||
rs485data.flags = 0;
|
||||
if (rs485data.delay_rts_before_send != 0)
|
||||
rs485data.flags |= SER_RS485_RTS_BEFORE_SEND;
|
||||
else
|
||||
rs485data.flags &= ~(SER_RS485_RTS_BEFORE_SEND);
|
||||
|
||||
if (rs485ctrl.enabled)
|
||||
rs485data.flags |= SER_RS485_ENABLED;
|
||||
@@ -4531,7 +4526,6 @@ static int __init rs_init(void)
|
||||
/* Set sane defaults */
|
||||
info->rs485.flags &= ~(SER_RS485_RTS_ON_SEND);
|
||||
info->rs485.flags |= SER_RS485_RTS_AFTER_SEND;
|
||||
info->rs485.flags &= ~(SER_RS485_RTS_BEFORE_SEND);
|
||||
info->rs485.delay_rts_before_send = 0;
|
||||
info->rs485.flags &= ~(SER_RS485_ENABLED);
|
||||
#endif
|
||||
|
||||
@@ -884,7 +884,6 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
{
|
||||
struct uart_hsu_port *up =
|
||||
container_of(port, struct uart_hsu_port, port);
|
||||
struct tty_struct *tty = port->state->port.tty;
|
||||
unsigned char cval, fcr = 0;
|
||||
unsigned long flags;
|
||||
unsigned int baud, quot;
|
||||
@@ -907,8 +906,7 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
}
|
||||
|
||||
/* CMSPAR isn't supported by this driver */
|
||||
if (tty)
|
||||
tty->termios->c_cflag &= ~CMSPAR;
|
||||
termios->c_cflag &= ~CMSPAR;
|
||||
|
||||
if (termios->c_cflag & CSTOPB)
|
||||
cval |= UART_LCR_STOP;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
*Copyright (C) 2010 OKI SEMICONDUCTOR CO., LTD.
|
||||
*Copyright (C) 2011 LAPIS Semiconductor Co., Ltd.
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify
|
||||
*it under the terms of the GNU General Public License as published by
|
||||
@@ -49,8 +49,8 @@ enum {
|
||||
|
||||
/* Set the max number of UART port
|
||||
* Intel EG20T PCH: 4 port
|
||||
* OKI SEMICONDUCTOR ML7213 IOH: 3 port
|
||||
* OKI SEMICONDUCTOR ML7223 IOH: 2 port
|
||||
* LAPIS Semiconductor ML7213 IOH: 3 port
|
||||
* LAPIS Semiconductor ML7223 IOH: 2 port
|
||||
*/
|
||||
#define PCH_UART_NR 4
|
||||
|
||||
@@ -265,6 +265,8 @@ enum pch_uart_num_t {
|
||||
pch_ml7213_uart2,
|
||||
pch_ml7223_uart0,
|
||||
pch_ml7223_uart1,
|
||||
pch_ml7831_uart0,
|
||||
pch_ml7831_uart1,
|
||||
};
|
||||
|
||||
static struct pch_uart_driver_data drv_dat[] = {
|
||||
@@ -277,6 +279,8 @@ static struct pch_uart_driver_data drv_dat[] = {
|
||||
[pch_ml7213_uart2] = {PCH_UART_2LINE, 2},
|
||||
[pch_ml7223_uart0] = {PCH_UART_8LINE, 0},
|
||||
[pch_ml7223_uart1] = {PCH_UART_2LINE, 1},
|
||||
[pch_ml7831_uart0] = {PCH_UART_8LINE, 0},
|
||||
[pch_ml7831_uart1] = {PCH_UART_2LINE, 1},
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SERIAL_PCH_UART_CONSOLE
|
||||
@@ -638,6 +642,7 @@ static void pch_request_dma(struct uart_port *port)
|
||||
dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Rx)\n",
|
||||
__func__);
|
||||
dma_release_channel(priv->chan_tx);
|
||||
priv->chan_tx = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1225,8 +1230,7 @@ static void pch_uart_shutdown(struct uart_port *port)
|
||||
dev_err(priv->port.dev,
|
||||
"pch_uart_hal_set_fifo Failed(ret=%d)\n", ret);
|
||||
|
||||
if (priv->use_dma_flag)
|
||||
pch_free_dma(port);
|
||||
pch_free_dma(port);
|
||||
|
||||
free_irq(priv->port.irq, priv);
|
||||
}
|
||||
@@ -1290,6 +1294,7 @@ static void pch_uart_set_termios(struct uart_port *port,
|
||||
if (rtn)
|
||||
goto out;
|
||||
|
||||
pch_uart_set_mctrl(&priv->port, priv->port.mctrl);
|
||||
/* Don't rewrite B0 */
|
||||
if (tty_termios_baud_rate(termios))
|
||||
tty_termios_encode_baud_rate(termios, baud, baud);
|
||||
@@ -1710,6 +1715,10 @@ static DEFINE_PCI_DEVICE_TABLE(pch_uart_pci_id) = {
|
||||
.driver_data = pch_ml7223_uart0},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x800D),
|
||||
.driver_data = pch_ml7223_uart1},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8811),
|
||||
.driver_data = pch_ml7831_uart0},
|
||||
{PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8812),
|
||||
.driver_data = pch_ml7831_uart1},
|
||||
{0,},
|
||||
};
|
||||
|
||||
|
||||
@@ -206,6 +206,25 @@ static struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
|
||||
[SCLSR] = sci_reg_invalid,
|
||||
},
|
||||
|
||||
/*
|
||||
* Common SH-2(A) SCIF definitions for ports with FIFO data
|
||||
* count registers.
|
||||
*/
|
||||
[SCIx_SH2_SCIF_FIFODATA_REGTYPE] = {
|
||||
[SCSMR] = { 0x00, 16 },
|
||||
[SCBRR] = { 0x04, 8 },
|
||||
[SCSCR] = { 0x08, 16 },
|
||||
[SCxTDR] = { 0x0c, 8 },
|
||||
[SCxSR] = { 0x10, 16 },
|
||||
[SCxRDR] = { 0x14, 8 },
|
||||
[SCFCR] = { 0x18, 16 },
|
||||
[SCFDR] = { 0x1c, 16 },
|
||||
[SCTFDR] = sci_reg_invalid,
|
||||
[SCRFDR] = sci_reg_invalid,
|
||||
[SCSPTR] = { 0x20, 16 },
|
||||
[SCLSR] = { 0x24, 16 },
|
||||
},
|
||||
|
||||
/*
|
||||
* Common SH-3 SCIF definitions.
|
||||
*/
|
||||
|
||||
+23
-7
@@ -18,6 +18,7 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/ratelimit.h>
|
||||
|
||||
/*
|
||||
* This guards the refcounted line discipline lists. The lock
|
||||
@@ -529,15 +530,16 @@ static void tty_ldisc_flush_works(struct tty_struct *tty)
|
||||
/**
|
||||
* tty_ldisc_wait_idle - wait for the ldisc to become idle
|
||||
* @tty: tty to wait for
|
||||
* @timeout: for how long to wait at most
|
||||
*
|
||||
* Wait for the line discipline to become idle. The discipline must
|
||||
* have been halted for this to guarantee it remains idle.
|
||||
*/
|
||||
static int tty_ldisc_wait_idle(struct tty_struct *tty)
|
||||
static int tty_ldisc_wait_idle(struct tty_struct *tty, long timeout)
|
||||
{
|
||||
int ret;
|
||||
long ret;
|
||||
ret = wait_event_timeout(tty_ldisc_idle,
|
||||
atomic_read(&tty->ldisc->users) == 1, 5 * HZ);
|
||||
atomic_read(&tty->ldisc->users) == 1, timeout);
|
||||
return ret > 0 ? 0 : -EBUSY;
|
||||
}
|
||||
|
||||
@@ -645,7 +647,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
|
||||
|
||||
tty_ldisc_flush_works(tty);
|
||||
|
||||
retval = tty_ldisc_wait_idle(tty);
|
||||
retval = tty_ldisc_wait_idle(tty, 5 * HZ);
|
||||
|
||||
tty_lock();
|
||||
mutex_lock(&tty->ldisc_mutex);
|
||||
@@ -742,8 +744,6 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
|
||||
if (IS_ERR(ld))
|
||||
return -1;
|
||||
|
||||
WARN_ON_ONCE(tty_ldisc_wait_idle(tty));
|
||||
|
||||
tty_ldisc_close(tty, tty->ldisc);
|
||||
tty_ldisc_put(tty->ldisc);
|
||||
tty->ldisc = NULL;
|
||||
@@ -818,7 +818,7 @@ void tty_ldisc_hangup(struct tty_struct *tty)
|
||||
tty_unlock();
|
||||
cancel_work_sync(&tty->buf.work);
|
||||
mutex_unlock(&tty->ldisc_mutex);
|
||||
|
||||
retry:
|
||||
tty_lock();
|
||||
mutex_lock(&tty->ldisc_mutex);
|
||||
|
||||
@@ -827,6 +827,22 @@ void tty_ldisc_hangup(struct tty_struct *tty)
|
||||
it means auditing a lot of other paths so this is
|
||||
a FIXME */
|
||||
if (tty->ldisc) { /* Not yet closed */
|
||||
if (atomic_read(&tty->ldisc->users) != 1) {
|
||||
char cur_n[TASK_COMM_LEN], tty_n[64];
|
||||
long timeout = 3 * HZ;
|
||||
tty_unlock();
|
||||
|
||||
while (tty_ldisc_wait_idle(tty, timeout) == -EBUSY) {
|
||||
timeout = MAX_SCHEDULE_TIMEOUT;
|
||||
printk_ratelimited(KERN_WARNING
|
||||
"%s: waiting (%s) for %s took too long, but we keep waiting...\n",
|
||||
__func__, get_task_comm(cur_n, current),
|
||||
tty_name(tty, tty_n));
|
||||
}
|
||||
mutex_unlock(&tty->ldisc_mutex);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
if (reset == 0) {
|
||||
|
||||
if (!tty_ldisc_reinit(tty, tty->termios->c_line))
|
||||
|
||||
Reference in New Issue
Block a user