diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0026-pch_uart-Fix-dma-channel-unallocated-issue.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0026-pch_uart-Fix-dma-channel-unallocated-issue.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0026-pch_uart-Fix-dma-channel-unallocated-issue.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0026-pch_uart-Fix-dma-channel-unallocated-issue.patch new file mode 100644 index 00000000..e150ebb7 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0026-pch_uart-Fix-dma-channel-unallocated-issue.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 069f7216ddee90ddca6e1d040e58b6735f89fca6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tomoya MORINAGA <tomoya.rohm@gmail.com> | ||
3 | Date: Thu, 12 Apr 2012 10:47:50 +0900 | ||
4 | Subject: [PATCH 026/165] pch_uart: Fix dma channel unallocated issue | ||
5 | |||
6 | commit af6d17cdc8c89aeb3101f0d27cd32fc0592b40b2 upstream. | ||
7 | |||
8 | This driver anticipates pch_uart_verify_port() is not called | ||
9 | during installation. | ||
10 | However, actually pch_uart_verify_port() is called during | ||
11 | installation. | ||
12 | As a result, memory access violation occurs like below. | ||
13 | |||
14 | 0. initial value: use_dma=0 | ||
15 | 1. starup() | ||
16 | - dma channel is not allocated because use_dma=0 | ||
17 | 2. pch_uart_verify_port() | ||
18 | - Set use_dma=1 | ||
19 | 3. UART processing acts DMA mode because use_dma=1 | ||
20 | - memory access violation occurs! | ||
21 | |||
22 | This patch fixes the issue. | ||
23 | |||
24 | Solution: | ||
25 | Whenever pch_uart_verify_port() is called and then | ||
26 | dma channel is not allocated, the channel should be allocated. | ||
27 | |||
28 | Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> | ||
29 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
30 | [bwh: Backported to 3.2: adjust context] | ||
31 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
32 | --- | ||
33 | drivers/tty/serial/pch_uart.c | 4 +++- | ||
34 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
35 | |||
36 | diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c | ||
37 | index da776a0..a4b192d 100644 | ||
38 | --- a/drivers/tty/serial/pch_uart.c | ||
39 | +++ b/drivers/tty/serial/pch_uart.c | ||
40 | @@ -1356,9 +1356,11 @@ static int pch_uart_verify_port(struct uart_port *port, | ||
41 | __func__); | ||
42 | return -EOPNOTSUPP; | ||
43 | #endif | ||
44 | - priv->use_dma = 1; | ||
45 | priv->use_dma_flag = 1; | ||
46 | dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n"); | ||
47 | + if (!priv->use_dma) | ||
48 | + pch_request_dma(port); | ||
49 | + priv->use_dma = 1; | ||
50 | } | ||
51 | |||
52 | return 0; | ||
53 | -- | ||
54 | 1.7.7.6 | ||
55 | |||