summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0001-mfd-Fix-omap-usbhs-crash-when-rmmoding-ehci-or-ohci.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0001-mfd-Fix-omap-usbhs-crash-when-rmmoding-ehci-or-ohci.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0001-mfd-Fix-omap-usbhs-crash-when-rmmoding-ehci-or-ohci.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0001-mfd-Fix-omap-usbhs-crash-when-rmmoding-ehci-or-ohci.patch b/extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0001-mfd-Fix-omap-usbhs-crash-when-rmmoding-ehci-or-ohci.patch
new file mode 100644
index 00000000..c9f1e6a9
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-2.6.39/mfd/0001-mfd-Fix-omap-usbhs-crash-when-rmmoding-ehci-or-ohci.patch
@@ -0,0 +1,67 @@
1From 46be90d202c36db19e27c2991cbff401c6c3ee81 Mon Sep 17 00:00:00 2001
2From: Keshava Munegowda <Keshava_mgowda@ti.com>
3Date: Mon, 16 May 2011 14:24:58 +0530
4Subject: [PATCH 01/13] mfd: Fix omap usbhs crash when rmmoding ehci or ohci
5
6The disabling of clocks and freeing GPIO are changed
7to fix the occurrence of the crash of rmmod of ehci and ohci
8drivers. The GPIOs should be freed after the spin locks are
9unlocked.
10
11Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
12Acked-by: Felipe Balbi <balbi@ti.com>
13Cc: stable@kernel.org
14Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
15---
16 drivers/mfd/omap-usb-host.c | 27 +++++++++++++++++++--------
17 1 files changed, 19 insertions(+), 8 deletions(-)
18
19diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
20index 3ab9ffa..55c5d47 100644
21--- a/drivers/mfd/omap-usb-host.c
22+++ b/drivers/mfd/omap-usb-host.c
23@@ -994,22 +994,33 @@ static void usbhs_disable(struct device *dev)
24 dev_dbg(dev, "operation timed out\n");
25 }
26
27- if (pdata->ehci_data->phy_reset) {
28- if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
29- gpio_free(pdata->ehci_data->reset_gpio_port[0]);
30-
31- if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
32- gpio_free(pdata->ehci_data->reset_gpio_port[1]);
33+ if (is_omap_usbhs_rev2(omap)) {
34+ if (is_ehci_tll_mode(pdata->port_mode[0]))
35+ clk_enable(omap->usbtll_p1_fck);
36+ if (is_ehci_tll_mode(pdata->port_mode[1]))
37+ clk_enable(omap->usbtll_p2_fck);
38+ clk_disable(omap->utmi_p2_fck);
39+ clk_disable(omap->utmi_p1_fck);
40 }
41
42- clk_disable(omap->utmi_p2_fck);
43- clk_disable(omap->utmi_p1_fck);
44 clk_disable(omap->usbtll_ick);
45 clk_disable(omap->usbtll_fck);
46 clk_disable(omap->usbhost_fs_fck);
47 clk_disable(omap->usbhost_hs_fck);
48 clk_disable(omap->usbhost_ick);
49
50+ /* The gpio_free migh sleep; so unlock the spinlock */
51+ spin_unlock_irqrestore(&omap->lock, flags);
52+
53+ if (pdata->ehci_data->phy_reset) {
54+ if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
55+ gpio_free(pdata->ehci_data->reset_gpio_port[0]);
56+
57+ if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
58+ gpio_free(pdata->ehci_data->reset_gpio_port[1]);
59+ }
60+ return;
61+
62 end_disble:
63 spin_unlock_irqrestore(&omap->lock, flags);
64 }
65--
661.6.6.1
67