提交 0ee50254 编写于 作者: K Kuninori Morimoto 提交者: Paul Mundt

sh: sh7786: modify usb setup timeout judgment bug.

This corrects a race with the PHY RST bit not being set properly if the
PLL status changes right before timeout. This resulted in it potentially
failing even if the device came up in time.

Special thanks to Mr. Juha Leppanen and Iwamatsu-san for reporting this
out and reviewing it.
Reported-by: NJuha Leppanen <juha_motorsportcom@luukku.com>
Reviewed-by: NNobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Tested-by: NPaul Mundt <lethal@linux-sh.org>
Signed-off-by: NKuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 066069e1
...@@ -143,14 +143,14 @@ static void __init sh7786_usb_setup(void) ...@@ -143,14 +143,14 @@ static void __init sh7786_usb_setup(void)
* Set the PHY and PLL enable bit * Set the PHY and PLL enable bit
*/ */
__raw_writel(PHY_ENB | PLL_ENB, USBPCTL1); __raw_writel(PHY_ENB | PLL_ENB, USBPCTL1);
while (i-- && while (i--) {
((__raw_readl(USBST) & ACT_PLL_STATUS) != ACT_PLL_STATUS)) if (ACT_PLL_STATUS == (__raw_readl(USBST) & ACT_PLL_STATUS)) {
/* Set the PHY RST bit */
__raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
printk(KERN_INFO "sh7786 usb setup done\n");
break;
}
cpu_relax(); cpu_relax();
if (i) {
/* Set the PHY RST bit */
__raw_writel(PHY_ENB | PLL_ENB | PHY_RST, USBPCTL1);
printk(KERN_INFO "sh7786 usb setup done\n");
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册