From 995e5cb4b2e6b96af4b63c8ebc3f4f6c6e5c8d0d Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Sat, 26 Sep 2015 23:32:08 +0200 Subject: apalis/colibri_t30: usb: fix performance regression Unfortunately that utmi_phy_remotewake_detected() function gets called one too many times even quite continuously during data transfers and putting an mdelay() in there has a rather adverse effect on the overall system performance including of course degrading USB transfer speeds. Moving the system lock-up avoidance hack further down into the if clause improves the performance again as this typically is only ever evaluated once upon actually plugging something in behind a hub. This fixes a performance regression introduced by the following commit: apalis/colibri_t30: usb: fix low-speed issue hack 629b91fa046df5213ed3312d2e2b8683e6bdd70c --- arch/arm/mach-tegra/tegra3_usb_phy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c index 0ab61758addd..f1a1e0874946 100644 --- a/arch/arm/mach-tegra/tegra3_usb_phy.c +++ b/arch/arm/mach-tegra/tegra3_usb_phy.c @@ -755,12 +755,15 @@ bool utmi_phy_remotewake_detected(struct tegra_usb_phy *phy) unsigned int inst = phy->inst; u32 val; - /* Hack: avoid system lock-up condition upon device hot-plugging */ - mdelay(4); - DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst); val = readl(base + UTMIP_PMC_WAKEUP0); if (val & EVENT_INT_ENB) { + /* + * Hack: avoid system lock-up condition upon device hot-plugging + * behind a hub + */ + mdelay(4); + val = readl(pmc_base + UTMIP_UHSIC_STATUS); if (UTMIP_WAKE_ALARM(inst) & val) { val = readl(pmc_base + PMC_SLEEP_CFG); -- cgit v1.2.3