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)
<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.
Wall charger is disconnected automatically after an attempt to suspend the device. Upon USB device resume the VBUS is still considered to be 0.
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.
// 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.
* 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.