]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
usb: host: tegra: no delay for boost frequency
authorMartin Chabot <mchabot@nvidia.com>
Thu, 3 Jul 2014 13:47:31 +0000 (15:47 +0200)
committerTodd Poynter <tpoynter@nvidia.com>
Wed, 8 Oct 2014 03:58:32 +0000 (20:58 -0700)
Apply frequency boost as soon as bus_resume is done
to avoid no scheduling situation when there is a
lot of ehci_irq
Move frequency boost after ehci_resume to keep boost
for high speed device only.

Bug 1480850
Bug 1519865

Change-Id: I7814078a07f9e9abdf3d3352a69f11a20b49332c
Signed-off-by: Martin Chabot <mchabot@nvidia.com>
Reviewed-on: http://git-master/r/552655
(cherry picked from commit 0e81d7f0f1386e416781e23181323327e66ff82c)
Reviewed-on: http://git-master/r/554328
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Neil Patel <neilp@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Neil Patel <neilp@nvidia.com>
Reviewed-by: Todd Poynter <tpoynter@nvidia.com>
drivers/usb/host/ehci-tegra.c

index 3ccf4e279e413e19c412fdc42d5a2df1275a0de8..d11c07264789d2637030d04a6bf7d8f0a3674bc5 100644 (file)
@@ -206,9 +206,9 @@ static void tegra_ehci_boost_cpu_frequency_work(struct work_struct *work)
                struct tegra_ehci_hcd, boost_cpu_freq_work.work);
        if (tegra->cpu_boost_in_work) {
                tegra->boost_requested = true;
-               if (tegra->boost_enable && (tegra_ehci_port_speed(tegra->ehci)
-                                       == USB_SPEED_HIGH))
-                       pm_qos_update_request(&tegra->boost_cpu_freq_req,
+               if (tegra->boost_enable)
+                       pm_qos_update_request(
+                               &tegra->boost_cpu_freq_req,
                                (s32)CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ * 1000);
        }
 }
@@ -441,22 +441,21 @@ static int tegra_ehci_bus_resume(struct usb_hcd *hcd)
        int err = 0;
        EHCI_DBG("%s() BEGIN\n", __func__);
 
-#ifdef CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ
-       tegra->boost_requested = true;
-       if (pm_qos_request_active(&tegra->boost_cpu_freq_req)
-               && tegra->boost_enable) {
-               schedule_delayed_work(&tegra->boost_cpu_freq_work, 4000);
-               tegra->cpu_boost_in_work = true;
-       }
-
-#endif
-
        mutex_lock(&tegra->sync_lock);
        usb_phy_set_suspend(get_usb_phy(tegra->phy), 0);
        err = ehci_bus_resume(hcd);
        mutex_unlock(&tegra->sync_lock);
-       EHCI_DBG("%s() END\n", __func__);
 
+#ifdef CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ
+       tegra->boost_requested = true;
+       if (pm_qos_request_active(&tegra->boost_cpu_freq_req)
+           && tegra->boost_enable
+           && (tegra_ehci_port_speed(tegra->ehci) == USB_SPEED_HIGH))
+               pm_qos_update_request(&tegra->boost_cpu_freq_req,
+                       (s32)CONFIG_TEGRA_EHCI_BOOST_CPU_FREQ * 1000);
+       tegra->cpu_boost_in_work = false;
+#endif
+       EHCI_DBG("%s() END\n", __func__);
        return err;
 }
 #endif