From mboxrd@z Thu Jan 1 00:00:00 1970 From: abhilash jindal Subject: [BUG] mach-msm/msm_vibrator.c - very long vibration if CPU suspends Date: Wed, 4 Sep 2013 17:24:50 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mail-qe0-f43.google.com ([209.85.128.43]:33412 "EHLO mail-qe0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753769Ab3IDVZM (ORCPT ); Wed, 4 Sep 2013 17:25:12 -0400 Received: by mail-qe0-f43.google.com with SMTP id gh4so512640qeb.16 for ; Wed, 04 Sep 2013 14:25:11 -0700 (PDT) Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: linux-arm-msm Cc: davidb@codeaurora.org, dwalker@codeaurora.org, bryanh@codeaurora.org msm_vibrator.c uses hrtimer to switch off the phone vibration as follows- hrtimer_start(&vibe_timer, ktime_set(value / 1000, (value % 1000) * 1000000), HRTIMER_MODE_REL); However, hrtimer does not get fired after the CPU suspends. Hence, if the CPU suspends before the timer gets fired, the phone continues vibrating until the next time when CPU wakes up causing unnecessary battery drain (which can be as long as 15 minutes). IMHO, one way to fix it would be to replace hrtimer by android alarm timer. Thanks Abhilash Jindal