From patchwork Thu Jul 11 07:44:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Brandt X-Patchwork-Id: 2826048 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F7AAC0AB2 for ; Thu, 11 Jul 2013 07:44:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB1D22010C for ; Thu, 11 Jul 2013 07:44:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B701D2010E for ; Thu, 11 Jul 2013 07:44:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755839Ab3GKHoi (ORCPT ); Thu, 11 Jul 2013 03:44:38 -0400 Received: from mga09.intel.com ([134.134.136.24]:16961 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755835Ab3GKHoh convert rfc822-to-8bit (ORCPT ); Thu, 11 Jul 2013 03:44:37 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Jul 2013 00:42:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,1042,1363158000"; d="scan'208";a="368308822" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by orsmga002.jf.intel.com with ESMTP; 11 Jul 2013 00:44:37 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 11 Jul 2013 00:44:37 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.3.95]) by FMSMSX110.amr.corp.intel.com ([169.254.1.147]) with mapi id 14.03.0123.003; Thu, 11 Jul 2013 00:44:36 -0700 From: "Brandt, Todd E" To: "linux-pm@vger.kernel.org" CC: "Wysocki, Rafael J" Subject: [PATCH] increase ftrace coverage in suspend/resume Thread-Topic: [PATCH] increase ftrace coverage in suspend/resume Thread-Index: Ac5+CZ5nGb387M3PT0OJNsnMXBHDAw== Date: Thu, 11 Jul 2013 07:44:35 +0000 Message-ID: <11E08D716F0541429B7042699DD5C1A17064F086@FMSMSX103.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.3.86.135] MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.2 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 This new patch changes where ftrace is disabled and re-enabled during a suspend/resume to allow tracing of device driver pm callbacks. Ftrace is turned off when suspend reaches the disable_nonboot_cpus instead of at the very beginning of system suspend. Ftrace was disabled during suspend/resume back in 2008 by Steven Rostedt as he discovered there was a conflict in the enable_nonboot_cpus call (see commit f42ac38c59e0a03d6da0c24a63fb211393f484b0). This patch preserves his fix by disabling ftrace, but only at the function where it is known to cause problems. I think the first patch might have been a bit overzealous in disabling all of suspend/resume ftrace, but please correct me if I'm wrong. The new patch allows tracing of the device level code for better debug. Signed-off-by: Todd Brandt --- kernel/power/suspend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- Todd Brandt Linux Kernel Developer OTC, Hillsboro OR -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index bef86d1..6c23af7 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -210,6 +210,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) goto Platform_wake; } + ftrace_stop(); error = disable_nonboot_cpus(); if (error || suspend_test(TEST_CPUS)) goto Enable_cpus; @@ -232,6 +233,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) Enable_cpus: enable_nonboot_cpus(); + ftrace_start(); Platform_wake: if (need_suspend_ops(state) && suspend_ops->wake) @@ -265,7 +267,6 @@ int suspend_devices_and_enter(suspend_state_t state) goto Close; } suspend_console(); - ftrace_stop(); suspend_test_start(); error = dpm_suspend_start(PMSG_SUSPEND); if (error) { @@ -285,7 +286,6 @@ int suspend_devices_and_enter(suspend_state_t state) suspend_test_start(); dpm_resume_end(PMSG_RESUME); suspend_test_finish("resume devices"); - ftrace_start(); resume_console(); Close: if (need_suspend_ops(state) && suspend_ops->end)