diff options
author | Keshava Munegowda <Keshava_mgowda@ti.com> | 2011-05-16 04:54:58 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-05-26 13:45:49 -0400 |
commit | 6eb6fbbf3eca6dfba73e72de5ab2eeb52ae41f7a (patch) | |
tree | 471ff9aa1aaf2a30857e69d915807fa9dd803f3c /drivers/mfd | |
parent | 13ca4f66108188231f9ef0358449f4543a0b84a1 (diff) |
mfd: Fix omap usbhs crash when rmmoding ehci or ohci
The disabling of clocks and freeing GPIO are changed
to fix the occurrence of the crash of rmmod of ehci and ohci
drivers. The GPIOs should be freed after the spin locks are
unlocked.
Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Cc: stable@kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/omap-usb-host.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 3ab9ffa00aad..55c5d4732f5f 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c | |||
@@ -994,22 +994,33 @@ static void usbhs_disable(struct device *dev) | |||
994 | dev_dbg(dev, "operation timed out\n"); | 994 | dev_dbg(dev, "operation timed out\n"); |
995 | } | 995 | } |
996 | 996 | ||
997 | if (pdata->ehci_data->phy_reset) { | 997 | if (is_omap_usbhs_rev2(omap)) { |
998 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | 998 | if (is_ehci_tll_mode(pdata->port_mode[0])) |
999 | gpio_free(pdata->ehci_data->reset_gpio_port[0]); | 999 | clk_enable(omap->usbtll_p1_fck); |
1000 | 1000 | if (is_ehci_tll_mode(pdata->port_mode[1])) | |
1001 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | 1001 | clk_enable(omap->usbtll_p2_fck); |
1002 | gpio_free(pdata->ehci_data->reset_gpio_port[1]); | 1002 | clk_disable(omap->utmi_p2_fck); |
1003 | clk_disable(omap->utmi_p1_fck); | ||
1003 | } | 1004 | } |
1004 | 1005 | ||
1005 | clk_disable(omap->utmi_p2_fck); | ||
1006 | clk_disable(omap->utmi_p1_fck); | ||
1007 | clk_disable(omap->usbtll_ick); | 1006 | clk_disable(omap->usbtll_ick); |
1008 | clk_disable(omap->usbtll_fck); | 1007 | clk_disable(omap->usbtll_fck); |
1009 | clk_disable(omap->usbhost_fs_fck); | 1008 | clk_disable(omap->usbhost_fs_fck); |
1010 | clk_disable(omap->usbhost_hs_fck); | 1009 | clk_disable(omap->usbhost_hs_fck); |
1011 | clk_disable(omap->usbhost_ick); | 1010 | clk_disable(omap->usbhost_ick); |
1012 | 1011 | ||
1012 | /* The gpio_free migh sleep; so unlock the spinlock */ | ||
1013 | spin_unlock_irqrestore(&omap->lock, flags); | ||
1014 | |||
1015 | if (pdata->ehci_data->phy_reset) { | ||
1016 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) | ||
1017 | gpio_free(pdata->ehci_data->reset_gpio_port[0]); | ||
1018 | |||
1019 | if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) | ||
1020 | gpio_free(pdata->ehci_data->reset_gpio_port[1]); | ||
1021 | } | ||
1022 | return; | ||
1023 | |||
1013 | end_disble: | 1024 | end_disble: |
1014 | spin_unlock_irqrestore(&omap->lock, flags); | 1025 | spin_unlock_irqrestore(&omap->lock, flags); |
1015 | } | 1026 | } |