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

Pull TTY fixes from Greg Kroah-Hartman:
"Here are 2 tiny patches for a serial driver to resolve issues that
people have reported with the 3.6-rc tree.

Both of these have been in the linux-next tree for a while now.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'tty-3.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: serial: imx: don't reinit clock in imx_setup_ufcr()
tty: serial: imx: console write routing is unsafe on SMP

+15 -15
+15 -15
drivers/tty/serial/imx.c
··· 132 132 #define UCR4_OREN (1<<1) /* Receiver overrun interrupt enable */ 133 133 #define UCR4_DREN (1<<0) /* Recv data ready interrupt enable */ 134 134 #define UFCR_RXTL_SHF 0 /* Receiver trigger level shift */ 135 + #define UFCR_DCEDTE (1<<6) /* DCE/DTE mode select */ 135 136 #define UFCR_RFDIV (7<<7) /* Reference freq divider mask */ 136 137 #define UFCR_RFDIV_REG(x) (((x) < 7 ? 6 - (x) : 6) << 7) 137 138 #define UFCR_TXTL_SHF 10 /* Transmitter trigger level shift */ ··· 668 667 static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode) 669 668 { 670 669 unsigned int val; 671 - unsigned int ufcr_rfdiv; 672 670 673 - /* set receiver / transmitter trigger level. 674 - * RFDIV is set such way to satisfy requested uartclk value 675 - */ 676 - val = TXTL << 10 | RXTL; 677 - ufcr_rfdiv = (clk_get_rate(sport->clk_per) + sport->port.uartclk / 2) 678 - / sport->port.uartclk; 679 - 680 - if(!ufcr_rfdiv) 681 - ufcr_rfdiv = 1; 682 - 683 - val |= UFCR_RFDIV_REG(ufcr_rfdiv); 684 - 671 + /* set receiver / transmitter trigger level */ 672 + val = readl(sport->port.membase + UFCR) & (UFCR_RFDIV | UFCR_DCEDTE); 673 + val |= TXTL << UFCR_TXTL_SHF | RXTL; 685 674 writel(val, sport->port.membase + UFCR); 686 - 687 675 return 0; 688 676 } 689 677 ··· 744 754 } 745 755 } 746 756 757 + spin_lock_irqsave(&sport->port.lock, flags); 747 758 /* 748 759 * Finally, clear and enable interrupts 749 760 */ ··· 798 807 /* 799 808 * Enable modem status interrupts 800 809 */ 801 - spin_lock_irqsave(&sport->port.lock,flags); 802 810 imx_enable_ms(&sport->port); 803 811 spin_unlock_irqrestore(&sport->port.lock,flags); 804 812 ··· 827 837 { 828 838 struct imx_port *sport = (struct imx_port *)port; 829 839 unsigned long temp; 840 + unsigned long flags; 830 841 842 + spin_lock_irqsave(&sport->port.lock, flags); 831 843 temp = readl(sport->port.membase + UCR2); 832 844 temp &= ~(UCR2_TXEN); 833 845 writel(temp, sport->port.membase + UCR2); 846 + spin_unlock_irqrestore(&sport->port.lock, flags); 834 847 835 848 if (USE_IRDA(sport)) { 836 849 struct imxuart_platform_data *pdata; ··· 862 869 * Disable all interrupts, port and break condition. 863 870 */ 864 871 872 + spin_lock_irqsave(&sport->port.lock, flags); 865 873 temp = readl(sport->port.membase + UCR1); 866 874 temp &= ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN); 867 875 if (USE_IRDA(sport)) 868 876 temp &= ~(UCR1_IREN); 869 877 870 878 writel(temp, sport->port.membase + UCR1); 879 + spin_unlock_irqrestore(&sport->port.lock, flags); 871 880 } 872 881 873 882 static void ··· 1212 1217 struct imx_port *sport = imx_ports[co->index]; 1213 1218 struct imx_port_ucrs old_ucr; 1214 1219 unsigned int ucr1; 1220 + unsigned long flags; 1221 + 1222 + spin_lock_irqsave(&sport->port.lock, flags); 1215 1223 1216 1224 /* 1217 1225 * First, save UCR1/2/3 and then disable interrupts ··· 1240 1242 while (!(readl(sport->port.membase + USR2) & USR2_TXDC)); 1241 1243 1242 1244 imx_port_ucrs_restore(&sport->port, &old_ucr); 1245 + 1246 + spin_unlock_irqrestore(&sport->port.lock, flags); 1243 1247 } 1244 1248 1245 1249 /*