rpm_resources: Squash of two commits from CAF

msm: rpm_resources.c: Compare sleep time with idle state overhead time

  When determining an idle state to enter do not enter a state
  if the sleep time is less than or equal to the overhead time
  or the time needed to enter an idle state.

  Change-Id: I764002b573ff39db56e69943dee85ae5959ad462
  Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>

msm: rpm_resources: Disable L2 SPM when msm_rpmrs_flush_buffer fails.

  When rpmrs_flush_buffer fails, L2 SPM has to be disabled. Otherwise, it
  could result in L2 being power collapsed when the Cores subsequently
  enter clock gating mode. During clock gating, the L2 doesn't get
  flushed, there by resulting in a crash if L2 SPM isn't disabled.

  Change-Id: I21fb81cac6085bed2e5fc703add9721ae1093e2c
  Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>

Change-Id: Ib1c0d4a9d29da0af4e00d521fba3a2be87a3bada