TTY/Serial driver fixes for 3.10-rc4
Here are some small bugfixes, and one revert, of serial driver issues that have been reported. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEABECAAYFAlGwzMgACgkQMUfUDdst+ykFHgCgwaBKNKG1fYpfdasryDCluK+P YT8An2wg7ogl6/IaENORK3/D3j0sjpFw =pYSh -----END PGP SIGNATURE----- Merge tag 'tty-3.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver fixes from Greg Kroah-Hartman: "Here are some small bugfixes, and one revert, of serial driver issues that have been reported" * tag 'tty-3.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: Revert "serial: 8250: Make SERIAL_8250_RUNTIME_UARTS work correctly" serial: samsung: enable clock before clearing pending interrupts during init serial/imx: disable hardware flow control at startup
This commit is contained in:
commit
3b285cb2f7
3 changed files with 22 additions and 7 deletions
|
@ -2755,7 +2755,7 @@ static void __init serial8250_isa_init_ports(void)
|
|||
if (nr_uarts > UART_NR)
|
||||
nr_uarts = UART_NR;
|
||||
|
||||
for (i = 0; i < UART_NR; i++) {
|
||||
for (i = 0; i < nr_uarts; i++) {
|
||||
struct uart_8250_port *up = &serial8250_ports[i];
|
||||
struct uart_port *port = &up->port;
|
||||
|
||||
|
@ -2916,7 +2916,7 @@ static int __init serial8250_console_setup(struct console *co, char *options)
|
|||
* if so, search for the first available port that does have
|
||||
* console support.
|
||||
*/
|
||||
if (co->index >= UART_NR)
|
||||
if (co->index >= nr_uarts)
|
||||
co->index = 0;
|
||||
port = &serial8250_ports[co->index].port;
|
||||
if (!port->iobase && !port->membase)
|
||||
|
@ -2957,7 +2957,7 @@ int serial8250_find_port(struct uart_port *p)
|
|||
int line;
|
||||
struct uart_port *port;
|
||||
|
||||
for (line = 0; line < UART_NR; line++) {
|
||||
for (line = 0; line < nr_uarts; line++) {
|
||||
port = &serial8250_ports[line].port;
|
||||
if (uart_match_port(p, port))
|
||||
return line;
|
||||
|
@ -3110,7 +3110,7 @@ static int serial8250_remove(struct platform_device *dev)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < UART_NR; i++) {
|
||||
for (i = 0; i < nr_uarts; i++) {
|
||||
struct uart_8250_port *up = &serial8250_ports[i];
|
||||
|
||||
if (up->port.dev == &dev->dev)
|
||||
|
@ -3178,7 +3178,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
|
|||
/*
|
||||
* First, find a port entry which matches.
|
||||
*/
|
||||
for (i = 0; i < UART_NR; i++)
|
||||
for (i = 0; i < nr_uarts; i++)
|
||||
if (uart_match_port(&serial8250_ports[i].port, port))
|
||||
return &serial8250_ports[i];
|
||||
|
||||
|
@ -3187,7 +3187,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
|
|||
* free entry. We look for one which hasn't been previously
|
||||
* used (indicated by zero iobase).
|
||||
*/
|
||||
for (i = 0; i < UART_NR; i++)
|
||||
for (i = 0; i < nr_uarts; i++)
|
||||
if (serial8250_ports[i].port.type == PORT_UNKNOWN &&
|
||||
serial8250_ports[i].port.iobase == 0)
|
||||
return &serial8250_ports[i];
|
||||
|
@ -3196,7 +3196,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
|
|||
* That also failed. Last resort is to find any entry which
|
||||
* doesn't have a real port associated with it.
|
||||
*/
|
||||
for (i = 0; i < UART_NR; i++)
|
||||
for (i = 0; i < nr_uarts; i++)
|
||||
if (serial8250_ports[i].port.type == PORT_UNKNOWN)
|
||||
return &serial8250_ports[i];
|
||||
|
||||
|
|
|
@ -761,6 +761,8 @@ static int imx_startup(struct uart_port *port)
|
|||
|
||||
temp = readl(sport->port.membase + UCR2);
|
||||
temp |= (UCR2_RXEN | UCR2_TXEN);
|
||||
if (!sport->have_rtscts)
|
||||
temp |= UCR2_IRTS;
|
||||
writel(temp, sport->port.membase + UCR2);
|
||||
|
||||
if (USE_IRDA(sport)) {
|
||||
|
|
|
@ -1166,6 +1166,18 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
|
|||
ourport->tx_irq = ret;
|
||||
|
||||
ourport->clk = clk_get(&platdev->dev, "uart");
|
||||
if (IS_ERR(ourport->clk)) {
|
||||
pr_err("%s: Controller clock not found\n",
|
||||
dev_name(&platdev->dev));
|
||||
return PTR_ERR(ourport->clk);
|
||||
}
|
||||
|
||||
ret = clk_prepare_enable(ourport->clk);
|
||||
if (ret) {
|
||||
pr_err("uart: clock failed to prepare+enable: %d\n", ret);
|
||||
clk_put(ourport->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Keep all interrupts masked and cleared */
|
||||
if (s3c24xx_serial_has_interrupt_mask(port)) {
|
||||
|
@ -1180,6 +1192,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
|
|||
|
||||
/* reset the fifos (and setup the uart) */
|
||||
s3c24xx_serial_resetport(port, cfg);
|
||||
clk_disable_unprepare(ourport->clk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue