USB sometimes does not go to LPM #12

Closed
roman-yepishev opened this Issue Jun 12, 2013 · 1 comment

Comments

Projects
None yet
1 participant
Owner

roman-yepishev commented Jun 12, 2013

Despite Acer's workaround, USB sometimes still fails to suspend.
In this case USB subsystem is kept powered and drains the battery.

It also causes CPU to heat up for no reason.

The kernel logs show

<4>[26922.950056] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
<4>[26922.951171] Suspending console(s) (use no_console_suspend to debug)
<6>[26922.970799] usb_platform_suspend
<3>[26922.970844] usb_platform_suspend: error!!!!!! Not in LPM

The overexcited message is printed by Acer code. I've seen similar symptoms on stock firmware but did not check kernel messages at that time.

Also related:
Wall charger is disconnected automatically after an attempt to suspend the device. Upon USB device resume the VBUS is still considered to be 0.

Owner

roman-yepishev commented Jun 12, 2013

With Acer's workaround in place the USB system sometimes does not switch to Low Power Mode (LPM), however when the workarounds are removed then plugging in the charger would enable and then disable charging. Based on these comments there are two separate issues.

  1. Redundant interrupt when USB controller gets powered on:
// software workaround for redundant USB interrupt in resuming procedure, which is
// caused by usb controller power down(MPP22) for power saving mechanism;
// It represent that waking up is not triggered by USB If wakeup_reason
// doesn't equal to 0x1, asking USB driver to enter LPM again.

-- arch/arm/mach-msm/irq-vic.c

  1. Wakelock is held for usb bus when there is no cable connected:
/*
 * Workaround for USB plug in/out quickly problem
 *
 * When plug in/out the usb cable very quickly,
 * sometimes the scheduled works have different order to execute.
 * When this happened, A1 will not sleep all the time because USB hold the wake-lock.
 * We add a check into early_suspend function to ensure the wake-lock is released
 * before suspending if the usb cable is not attached.
*/

-- drivers/usb/otg/msm72k_otg.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment