diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.10/0026-mmc-atmel-mci-don-t-use-dma-features-when-using-DMA-.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.10/0026-mmc-atmel-mci-don-t-use-dma-features-when-using-DMA-.patch | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.10/0026-mmc-atmel-mci-don-t-use-dma-features-when-using-DMA-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.10/0026-mmc-atmel-mci-don-t-use-dma-features-when-using-DMA-.patch new file mode 100644 index 00000000..e2308918 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.10/0026-mmc-atmel-mci-don-t-use-dma-features-when-using-DMA-.patch | |||
@@ -0,0 +1,88 @@ | |||
1 | From 949f9646ccebddaf84ef0a76bf65cbb03d98ca90 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ludovic Desroches <ludovic.desroches@atmel.com> | ||
3 | Date: Thu, 9 Feb 2012 16:33:53 +0100 | ||
4 | Subject: [PATCH 26/95] mmc: atmel-mci: don't use dma features when using DMA | ||
5 | with no chan available | ||
6 | |||
7 | commit ef8781989a1bcd05aa47e853917c37df44917194 upstream. | ||
8 | |||
9 | Some callbacks are set too early -- i.e. we can have dma capabilities but | ||
10 | we can't get a dma channel. So wait to get the dma channel before setting | ||
11 | callbacks and change logs consequently. | ||
12 | |||
13 | Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> | ||
14 | Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> | ||
15 | Signed-off-by: Chris Ball <cjb@laptop.org> | ||
16 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | ||
17 | --- | ||
18 | drivers/mmc/host/atmel-mci.c | 21 ++++++++++----------- | ||
19 | 1 file changed, 10 insertions(+), 11 deletions(-) | ||
20 | |||
21 | diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c | ||
22 | index 72bc756..9896933 100644 | ||
23 | --- a/drivers/mmc/host/atmel-mci.c | ||
24 | +++ b/drivers/mmc/host/atmel-mci.c | ||
25 | @@ -1944,12 +1944,12 @@ static bool atmci_filter(struct dma_chan *chan, void *slave) | ||
26 | } | ||
27 | } | ||
28 | |||
29 | -static void atmci_configure_dma(struct atmel_mci *host) | ||
30 | +static bool atmci_configure_dma(struct atmel_mci *host) | ||
31 | { | ||
32 | struct mci_platform_data *pdata; | ||
33 | |||
34 | if (host == NULL) | ||
35 | - return; | ||
36 | + return false; | ||
37 | |||
38 | pdata = host->pdev->dev.platform_data; | ||
39 | |||
40 | @@ -1966,12 +1966,15 @@ static void atmci_configure_dma(struct atmel_mci *host) | ||
41 | host->dma.chan = | ||
42 | dma_request_channel(mask, atmci_filter, pdata->dma_slave); | ||
43 | } | ||
44 | - if (!host->dma.chan) | ||
45 | - dev_notice(&host->pdev->dev, "DMA not available, using PIO\n"); | ||
46 | - else | ||
47 | + if (!host->dma.chan) { | ||
48 | + dev_warn(&host->pdev->dev, "no DMA channel available\n"); | ||
49 | + return false; | ||
50 | + } else { | ||
51 | dev_info(&host->pdev->dev, | ||
52 | "Using %s for DMA transfers\n", | ||
53 | dma_chan_name(host->dma.chan)); | ||
54 | + return true; | ||
55 | + } | ||
56 | } | ||
57 | |||
58 | static inline unsigned int atmci_get_version(struct atmel_mci *host) | ||
59 | @@ -2081,8 +2084,7 @@ static int __init atmci_probe(struct platform_device *pdev) | ||
60 | |||
61 | /* Get MCI capabilities and set operations according to it */ | ||
62 | atmci_get_cap(host); | ||
63 | - if (host->caps.has_dma) { | ||
64 | - dev_info(&pdev->dev, "using DMA\n"); | ||
65 | + if (host->caps.has_dma && atmci_configure_dma(host)) { | ||
66 | host->prepare_data = &atmci_prepare_data_dma; | ||
67 | host->submit_data = &atmci_submit_data_dma; | ||
68 | host->stop_transfer = &atmci_stop_transfer_dma; | ||
69 | @@ -2092,15 +2094,12 @@ static int __init atmci_probe(struct platform_device *pdev) | ||
70 | host->submit_data = &atmci_submit_data_pdc; | ||
71 | host->stop_transfer = &atmci_stop_transfer_pdc; | ||
72 | } else { | ||
73 | - dev_info(&pdev->dev, "no DMA, no PDC\n"); | ||
74 | + dev_info(&pdev->dev, "using PIO\n"); | ||
75 | host->prepare_data = &atmci_prepare_data; | ||
76 | host->submit_data = &atmci_submit_data; | ||
77 | host->stop_transfer = &atmci_stop_transfer; | ||
78 | } | ||
79 | |||
80 | - if (host->caps.has_dma) | ||
81 | - atmci_configure_dma(host); | ||
82 | - | ||
83 | platform_set_drvdata(pdev, host); | ||
84 | |||
85 | /* We need at least one slot to succeed */ | ||
86 | -- | ||
87 | 1.7.9.4 | ||
88 | |||