From patchwork Mon Dec 21 06:31:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bibek Basu X-Patchwork-Id: 7893761 X-Patchwork-Delegate: rjw@sisk.pl 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 37CD7BEEE5 for ; Mon, 21 Dec 2015 06:32:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 732A820398 for ; Mon, 21 Dec 2015 06:31:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BD6F20384 for ; Mon, 21 Dec 2015 06:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751134AbbLUGby (ORCPT ); Mon, 21 Dec 2015 01:31:54 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:16050 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123AbbLUGbq (ORCPT ); Mon, 21 Dec 2015 01:31:46 -0500 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Sun, 20 Dec 2015 22:31:56 -0800 Received: from hqemhub02.nvidia.com ([172.20.150.31]) by hqnvupgp08.nvidia.com (PGP Universal service); Sun, 20 Dec 2015 22:28:05 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Sun, 20 Dec 2015 22:28:05 -0800 Received: from bbasu.nvidia.com (172.20.144.16) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.406.0; Sun, 20 Dec 2015 22:31:44 -0800 From: Bibek Basu To: rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz CC: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, bbasu@nvidia.com Subject: [PATCH] PM / sleep: console flush during suspend if no_console_suspend enabled Date: Mon, 21 Dec 2015 12:01:40 +0530 Message-ID: <1450679500-6185-1-git-send-email-bbasu@nvidia.com> X-Mailer: git-send-email 2.1.4 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=-6.9 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 On multicore CPUs, sometimes debug console logs are not flushed if you have VT consoles also enabled. Reason being console_lock is taken by secondary/nonboot cpus which are disabled as part of suspend.This patch flushes the console before disabling nonboot cpus Signed-off-by: Bibek Basu Acked-by: Pavel Machek --- kernel/power/suspend.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index f9fe133..42c5912 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -352,6 +352,16 @@ static int suspend_enter(suspend_state_t state, bool *wakeup) goto Platform_wake; } + /* + * Flush console buffer if console_suspend_enabled cleared. + * This will enable console flush if console_lock is taken + * by nonboot cpus which will soon be disabled below. + */ + if (!console_suspend_enabled) { + console_lock(); + console_unlock(); + } + error = disable_nonboot_cpus(); if (error || suspend_test(TEST_CPUS)) goto Enable_cpus;