Received: by 10.223.176.5 with SMTP id f5csp2269781wra; Mon, 5 Feb 2018 00:53:42 -0800 (PST) X-Google-Smtp-Source: AH8x224QX467vUE28ENoYo/oBp3n2FZ7i7i7235vTBe2odygMBDwwyZz98DJvNDsxlZfgblHF+ZE X-Received: by 2002:a17:902:7042:: with SMTP id h2-v6mr12305939plt.217.1517820822754; Mon, 05 Feb 2018 00:53:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517820822; cv=none; d=google.com; s=arc-20160816; b=T8Dkk82LT9U8rtRQcQZo2vgL3tFdfF3Vqc3UTG9UkjREfDMCjM1u55w0mUwIyHe4Nd l7AWUHv8oLmPL226253b1XQFIe5+ByQ8SkwWO+g9fdYVweu63CCrOVBTU1saytclL6cD DX3kNH7VWKsMq9OESlIUwvAre9NwI6oda8/aARIqZdbqmYC3D3cHpYliTwqzc4bftIdb OO3HqQ8lBP+JR310YBK1ST30m4JXEow9IX8vx6+PfIGVF5CmDwbIQpn1E7cDHx0RvDCC po1C0e9BECg7OMP5I18HvgmvtQ3Ov0J2c4Du++i1rNPXrWMfx6vwfx2OkZefOcFlmALR lRng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=SBnpeoMIpiCgDXztIIJ5iNqPhUkCWIN1aB1BSqBTcvk=; b=y0yxeZctFpvlr4tfoNk+vKSeCCMg9REPb1N8XvnPnjIVBI5dgMzJ/8MpzrhtqMyc3I dB/AgvtqzGureScw6sbOPzQjRJbMIxaQEccfdFGR/VdG5dCsDhIeLos/0Fj9PU2+87dD eRqMhM+ioX2PjWyF81ACBFfsHQriCrU1BPL0XqyX5WRlrsW8sQjEr/P1zEcfnZQ0LGpd 2LBEeqwH+twJw6mM/IjzGpD/UV1a7EFRdBA/loHcx4dAwTE9s3kC9JT+W8hkbUh5F7uA 5ZMSu+i4kfzw6mt1j3oEsK+j4u9xFWrTeoUXpZZ4E7W+JeoXhhBV+srd4dAFXp8d+LvC CeOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si4666765pln.401.2018.02.05.00.53.19; Mon, 05 Feb 2018 00:53:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752724AbeBEIwN (ORCPT + 99 others); Mon, 5 Feb 2018 03:52:13 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:59705 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752317AbeBEIwJ (ORCPT ); Mon, 5 Feb 2018 03:52:09 -0500 Received: from 79.184.255.223.ipv4.supernova.orange.pl (79.184.255.223) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 2b8959b32bf47e90; Mon, 5 Feb 2018 09:52:06 +0100 From: "Rafael J. Wysocki" To: Viresh Kumar Cc: Bo Yan , Saravana Kannan , sgurrappadi@nvidia.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: skip cpufreq resume if it's not suspended Date: Mon, 05 Feb 2018 09:50:28 +0100 Message-ID: <1710637.vo8uP0oTBm@aspire.rjw.lan> In-Reply-To: <20180205040118.GB28462@vireshk-i7> References: <1516744675-21233-1-git-send-email-byan@nvidia.com> <20180205040118.GB28462@vireshk-i7> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, February 5, 2018 5:01:18 AM CET Viresh Kumar wrote: > On 02-02-18, 13:28, Bo Yan wrote: > > On 02/02/2018 11:34 AM, Saravana Kannan wrote: > > >I rather have this fixed in the dpm_suspend/resume() code. This is just > > >masking the first issue that's being caused by unbalanced error handling. > > >If that means adding flags in dpm_suspend/resume() then that's what we > > >should do right now and clean it up later if it can be improved. Making > > >cpufreq more messy doesn't seem like the right answer. > > +1 > > > dpm_suspend and dpm_resume by themselves are not balanced in this particular > > case. As it's currently structured, dpm_resume can't be omitted even if > > dpm_suspend is skipped due to earlier failure. I think checking > > cpufreq_suspended flag is a reasonable compromise. If we can find a way to > > make dpm_suspend/dpm_resume also balanced, that will be best. > > I think cpufreq is just one of the users which broke. Others didn't break > because: > > - They don't have a complicated resume part. > - Or we just don't know that they broke. No and no. > Resuming something that never suspended is just broken by design. Yeah, its much > simpler in this particular case to fix cpufreq core but the > suspend/resume/hibernation part is really core kernel and should be fixed to > avoid such band-aids. By design (which I admit may be confusing) it should be fine to call dpm_resume_end() after a failing dpm_suspend_start(), whatever the reason for the failure is. cpufreq_suspend/resume() don't take that into account, everybody else does. Thanks, Rafael