diff options
author | Shengzhou Liu <Shengzhou.Liu@freescale.com> | 2013-09-02 01:25:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 19:22:29 -0400 |
commit | eee41b49b80420e3e8c118d18dfacb7da43c1caa (patch) | |
tree | 160ec2054d1625de0ee073feec75c41ec719eb2e /drivers/usb | |
parent | 2606b28aabd7dea1766c23a105e1124c95409c96 (diff) |
USB: fsl/ehci: fix failure of checking PHY_CLK_VALID during reinitialization
In case of usb phy reinitialization:
e.g. insmod usb-module(usb works well) -> rmmod usb-module -> insmod usb-module
It found the PHY_CLK_VALID bit didn't work if it's not with the power-on reset.
So we just check PHY_CLK_VALID bit during the stage with POR, this can be met
by the tricky of checking FSL_SOC_USB_PRICTRL register.
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-fsl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index d3166e693dcb..f2407b2e8a99 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c | |||
@@ -264,8 +264,9 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd, | |||
264 | if (pdata->have_sysif_regs && pdata->controller_ver && | 264 | if (pdata->have_sysif_regs && pdata->controller_ver && |
265 | (phy_mode == FSL_USB2_PHY_ULPI)) { | 265 | (phy_mode == FSL_USB2_PHY_ULPI)) { |
266 | /* check PHY_CLK_VALID to get phy clk valid */ | 266 | /* check PHY_CLK_VALID to get phy clk valid */ |
267 | if (!spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) & | 267 | if (!(spin_event_timeout(in_be32(non_ehci + FSL_SOC_USB_CTRL) & |
268 | PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0)) { | 268 | PHY_CLK_VALID, FSL_USB_PHY_CLK_TIMEOUT, 0) || |
269 | in_be32(non_ehci + FSL_SOC_USB_PRICTRL))) { | ||
269 | printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n"); | 270 | printk(KERN_WARNING "fsl-ehci: USB PHY clock invalid\n"); |
270 | return -EINVAL; | 271 | return -EINVAL; |
271 | } | 272 | } |