diff mbox

[v2,2/2] phy: rockchip-inno-usb2: correct 480MHz output clock stable time

Message ID 1479106911-16049-3-git-send-email-wulf@rock-chips.com (mailing list archive)
State New, archived
Headers show

Commit Message

wuliangfeng Nov. 14, 2016, 7:01 a.m. UTC
We found that the system crashed due to 480MHz output clock of
USB2 PHY was unstable after clock had been enabled by gpu module.

Theoretically, 1 millisecond is a critical value for 480MHz
output clock stable time, so we try to change the delay time
to 1.2 millisecond to avoid this issue.

And the commit ed907fb1d7c3 ("phy: rockchip-inno-usb2: correct
clk_ops callback") used prepare callbacks instead of enable
callbacks to support gate a clk if the operation may sleep. So
we can switch from delay to sleep functions.

Signed-off-by: William Wu <wulf@rock-chips.com>
Changes in v2:
- use usleep_range() function instead of mdelay()

 drivers/phy/phy-rockchip-inno-usb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


kernel test robot Nov. 14, 2016, 8:15 a.m. UTC | #1
Hi William,

[auto build test ERROR on rockchip/for-next]
[also build test ERROR on v4.9-rc5 next-20161114]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/William-Wu/phy-rockchip-inno-usb2-correct-clk_ops-callback/20161114-150723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/phy/phy-rockchip-inno-usb2.c: In function 'rockchip_usb2phy_clk480m_prepare':
>> drivers/phy/phy-rockchip-inno-usb2.c:169:3: error: too few arguments to function 'usleep_range'
   In file included from drivers/phy/phy-rockchip-inno-usb2.c:19:0:
   include/linux/delay.h:48:6: note: declared here
    void usleep_range(unsigned long min, unsigned long max);

vim +/usleep_range +169 drivers/phy/phy-rockchip-inno-usb2.c

   163		if (!property_enabled(rphy, &rphy->phy_cfg->clkout_ctl)) {
   164			ret = property_enable(rphy, &rphy->phy_cfg->clkout_ctl, true);
   165			if (ret)
   166				return ret;
   168			/* waitting for the clk become stable */
 > 169			usleep_range(1200);
   170		}
   172		return 0;

0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox


diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c
index 365e077..578290b 100644
--- a/drivers/phy/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/phy-rockchip-inno-usb2.c
@@ -166,7 +166,7 @@  static int rockchip_usb2phy_clk480m_prepare(struct clk_hw *hw)
 			return ret;
 		/* waitting for the clk become stable */
-		mdelay(1);
+		usleep_range(1200);
 	return 0;