diff options
author | David S. Miller <davem@davemloft.net> | 2005-04-22 01:18:03 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-04-22 01:18:03 -0400 |
commit | b179fb8ca57590eeb0a5d6c8dc99f91773f09c73 (patch) | |
tree | 34490b121e2be5ff1635cdaeaf27f738e7c4bb24 /drivers | |
parent | 623f41eb923d7f34888cbd9e4f50a7b1a79d0ae5 (diff) |
[SPARC64]: In sunsab driver, make sure to set the uart timeout.
This breaks serial consoles badly. Thanks to Eric Brower
for tracking down the problem.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/sunsab.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index 8caaf2e5e47c..39b788d95e39 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c | |||
@@ -682,7 +682,8 @@ static void calc_ebrg(int baud, int *n_ret, int *m_ret) | |||
682 | 682 | ||
683 | /* Internal routine, port->lock is held and local interrupts are disabled. */ | 683 | /* Internal routine, port->lock is held and local interrupts are disabled. */ |
684 | static void sunsab_convert_to_sab(struct uart_sunsab_port *up, unsigned int cflag, | 684 | static void sunsab_convert_to_sab(struct uart_sunsab_port *up, unsigned int cflag, |
685 | unsigned int iflag, int baud) | 685 | unsigned int iflag, unsigned int baud, |
686 | unsigned int quot) | ||
686 | { | 687 | { |
687 | unsigned int ebrg; | 688 | unsigned int ebrg; |
688 | unsigned char dafo; | 689 | unsigned char dafo; |
@@ -766,6 +767,9 @@ static void sunsab_convert_to_sab(struct uart_sunsab_port *up, unsigned int cfla | |||
766 | up->port.ignore_status_mask |= (SAB82532_ISR0_RPF | | 767 | up->port.ignore_status_mask |= (SAB82532_ISR0_RPF | |
767 | SAB82532_ISR0_TCD); | 768 | SAB82532_ISR0_TCD); |
768 | 769 | ||
770 | uart_update_timeout(&up->port, cflag, | ||
771 | (up->port.uartclk / (16 * quot))); | ||
772 | |||
769 | /* Now bang the new settings into the chip. */ | 773 | /* Now bang the new settings into the chip. */ |
770 | sunsab_cec_wait(up); | 774 | sunsab_cec_wait(up); |
771 | sunsab_tec_wait(up); | 775 | sunsab_tec_wait(up); |
@@ -784,10 +788,11 @@ static void sunsab_set_termios(struct uart_port *port, struct termios *termios, | |||
784 | { | 788 | { |
785 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; | 789 | struct uart_sunsab_port *up = (struct uart_sunsab_port *) port; |
786 | unsigned long flags; | 790 | unsigned long flags; |
787 | int baud = uart_get_baud_rate(port, termios, old, 0, 4000000); | 791 | unsigned int baud = uart_get_baud_rate(port, termios, old, 0, 4000000); |
792 | unsigned int quot = uart_get_divisor(port, baud); | ||
788 | 793 | ||
789 | spin_lock_irqsave(&up->port.lock, flags); | 794 | spin_lock_irqsave(&up->port.lock, flags); |
790 | sunsab_convert_to_sab(up, termios->c_cflag, termios->c_iflag, baud); | 795 | sunsab_convert_to_sab(up, termios->c_cflag, termios->c_iflag, baud, quot); |
791 | spin_unlock_irqrestore(&up->port.lock, flags); | 796 | spin_unlock_irqrestore(&up->port.lock, flags); |
792 | } | 797 | } |
793 | 798 | ||
@@ -880,7 +885,7 @@ static int sunsab_console_setup(struct console *con, char *options) | |||
880 | { | 885 | { |
881 | struct uart_sunsab_port *up = &sunsab_ports[con->index]; | 886 | struct uart_sunsab_port *up = &sunsab_ports[con->index]; |
882 | unsigned long flags; | 887 | unsigned long flags; |
883 | int baud; | 888 | unsigned int baud, quot; |
884 | 889 | ||
885 | printk("Console: ttyS%d (SAB82532)\n", | 890 | printk("Console: ttyS%d (SAB82532)\n", |
886 | (sunsab_reg.minor - 64) + con->index); | 891 | (sunsab_reg.minor - 64) + con->index); |
@@ -926,7 +931,8 @@ static int sunsab_console_setup(struct console *con, char *options) | |||
926 | SAB82532_IMR1_XPR; | 931 | SAB82532_IMR1_XPR; |
927 | writeb(up->interrupt_mask1, &up->regs->w.imr1); | 932 | writeb(up->interrupt_mask1, &up->regs->w.imr1); |
928 | 933 | ||
929 | sunsab_convert_to_sab(up, con->cflag, 0, baud); | 934 | quot = uart_get_divisor(&up->port, baud); |
935 | sunsab_convert_to_sab(up, con->cflag, 0, baud, quot); | ||
930 | sunsab_set_mctrl(&up->port, TIOCM_DTR | TIOCM_RTS); | 936 | sunsab_set_mctrl(&up->port, TIOCM_DTR | TIOCM_RTS); |
931 | 937 | ||
932 | spin_unlock_irqrestore(&up->port.lock, flags); | 938 | spin_unlock_irqrestore(&up->port.lock, flags); |