From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28DA4C468BD for ; Fri, 7 Jun 2019 11:20:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 027CF2146F for ; Fri, 7 Jun 2019 11:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728322AbfFGLUZ (ORCPT ); Fri, 7 Jun 2019 07:20:25 -0400 Received: from mga17.intel.com ([192.55.52.151]:36929 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727754AbfFGLUZ (ORCPT ); Fri, 7 Jun 2019 07:20:25 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jun 2019 04:20:24 -0700 X-ExtLoop1: 1 Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 07 Jun 2019 04:20:22 -0700 Received: by lahna (sSMTP sendmail emulation); Fri, 07 Jun 2019 14:20:21 +0300 Date: Fri, 7 Jun 2019 14:20:21 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Linux PCI , Linux PM , Bjorn Helgaas , LKML Subject: Re: [PATCH 2/2] PCI: PM: Replace pci_dev_keep_suspended() with two functions Message-ID: <20190607112021.GU2781@lahna.fi.intel.com> References: <2958812.87Qy2A3tJo@kreacher> <3991282.doQj0dWKJp@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3991282.doQj0dWKJp@kreacher> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Fri, Jun 07, 2019 at 12:32:31AM +0200, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > The code in pci_dev_keep_suspended() is relatively hard to follow due > to the negative checks in it and in its callers and the function has > a possible side-effect (disabling the PME) which doesn't really match > its role. > > For this reason, move the PME disablig from pci_dev_keep_suspended() ^^^^^^^^ disabling > to a separate function and change the semantics (and name) of the > rest of it, so that 'true' is returned when the device needs to be > resumed (and not the other way around). Change the callers of > pci_dev_keep_suspended() accordingly. > > While at it, make the code flow in pci_pm_poweroff() reflect the > pci_pm_suspend() more closely to avoid arbitrary differences between > them. > > This is a cosmetic change with no intention to alter behavior. > > Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg