OSDN Git Service

usb: dwc3-msm: Bring controller out of LPM early upon system resume
authorHemant Kumar <hemantk@codeaurora.org>
Sun, 29 Mar 2015 07:37:04 +0000 (00:37 -0700)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:06:49 +0000 (11:06 -0700)
In case of host initiated usb bus resume upon system suspend controller
exits from LPM as part of dwc3 PM resume. Since call to dwc3 PM resume
from PM framework involves latency due to which usb device misses the
timeline of response for bus resume. This results into host issuing warm
reset. Hence bring controller out of LPM in power event irq thread context.
Set IRQF_EARLY_RESUME for power event irq which reduces irq level latency
by enabling this irq early during system resume. Also, save power event
irq time stamp to track latency between hard irq and irq thread.

CRs-Fixed: 804476
Change-Id: Ib5470c6046ffbfff55b89e717f040bd6435454da
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/debugfs.c

index d377efb..8997c5c 100644 (file)
@@ -972,6 +972,7 @@ struct dwc3 {
        unsigned                bh_handled_evt_cnt[MAX_INTR_STATS];
        unsigned                bh_dbg_index;
        ktime_t                 irq_start_time[MAX_INTR_STATS];
+       ktime_t                 t_pwr_evt_irq;
        unsigned                irq_completion_time[MAX_INTR_STATS];
        unsigned                irq_event_count[MAX_INTR_STATS];
        unsigned                irq_dbg_index;
index fbbcbf0..4312a8f 100644 (file)
@@ -1172,6 +1172,9 @@ static int dwc3_gadget_int_events_show(struct seq_file *s, void *unused)
                seq_printf(s, "%d\t", dwc->bh_completion_time[i]);
        seq_putc(s, '\n');
 
+       seq_printf(s, "t_pwr evt irq : %lld\t",
+                       ktime_to_us(dwc->t_pwr_evt_irq));
+
        spin_unlock_irqrestore(&dwc->lock, flags);
        return 0;
 }