From patchwork Tue Sep 2 18:54:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Pandruvada X-Patchwork-Id: 4827751 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F16469F314 for ; Tue, 2 Sep 2014 18:54:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06224201DC for ; Tue, 2 Sep 2014 18:54:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 24A02201BC for ; Tue, 2 Sep 2014 18:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754426AbaIBSyd (ORCPT ); Tue, 2 Sep 2014 14:54:33 -0400 Received: from mga02.intel.com ([134.134.136.20]:59716 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbaIBSyc (ORCPT ); Tue, 2 Sep 2014 14:54:32 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 02 Sep 2014 11:54:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,450,1406617200"; d="scan'208";a="567315401" Received: from spandruv-desktop.jf.intel.com ([10.7.199.74]) by orsmga001.jf.intel.com with ESMTP; 02 Sep 2014 11:54:31 -0700 From: Srinivas Pandruvada To: rafael.j.wysocki@intel.com Cc: linux-pm@vger.kernel.org, Srinivas Pandruvada Subject: [PATCH 1/3] PM / sleep: Support freeze as test_suspend option Date: Tue, 2 Sep 2014 11:54:39 -0700 Message-Id: <1409684081-9659-1-git-send-email-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 1.9.3 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Added freeze as one of the option for test_suspend boot param. Signed-off-by: Srinivas Pandruvada --- kernel/power/suspend_test.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/power/suspend_test.c b/kernel/power/suspend_test.c index fe3239b..ede39c8 100644 --- a/kernel/power/suspend_test.c +++ b/kernel/power/suspend_test.c @@ -100,7 +100,14 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state) if (state == PM_SUSPEND_STANDBY) { printk(info_test, pm_states[state]); status = pm_suspend(state); + if (status < 0) + state = PM_SUSPEND_FREEZE; } + if (state == PM_SUSPEND_FREEZE) { + printk(info_test, pm_states[state]); + status = pm_suspend(state); + } + if (status < 0) printk(err_suspend, status);