Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2373178pxb; Mon, 20 Sep 2021 20:32:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCVV4oBNmhAPrl65+qIVJy2nIqzsiVcSVJRswnhiFiFexHT+vYX1x0xxbkuORTjx7GxHYH X-Received: by 2002:a17:906:dbdc:: with SMTP id yc28mr18072763ejb.16.1632195163305; Mon, 20 Sep 2021 20:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632195163; cv=none; d=google.com; s=arc-20160816; b=eBhGW+bVvQfi9n4Io/OBpZZshK73Y2Uf8io7L6ExDBDRyFRi0xJ6kJu5n1fmdP9pXe a4M0uq2Lmfpyvsct0L437JOopSbWlo2Ml6yTLAqsSk6yD/ZzfT/7lK8qfMeSW63OBA3P 0beueyvJGm9qgqjesxaRtiLOrfrRAiHi4VUeTApgkVLznADlj9HGko4Cs2MStP3kIRcm kHtGiFAeZsK0TaGUoQEidC6e55j471GU6klItga1QS1YUmliegGYdJurUu9s/vBgIqec di2CIuOQOJLtotRqDTgzG0gnT6GS0anAparxoR/HhFFUkbF0voDFWRX2h0N/sUznc0Vd a06Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xaS4e7smph3Z+iFPU/k5sKOHfT8L3Mzmied/dFRRcSM=; b=Isr2meWGDO3pe+eLjtnb1VaBeXEN/ArSGeOUiJ67rZcGk0aktPQeWHhAKKk+zz0haa cwxohHlfcyV2xFnZCamu5JEGq/ZhA+lR8+Cv4stTEgUZAMpB8acT5VqciNetsUKrwq9P so/xB/8CqBaOtcPfkQE9ZlGu3WHlM1jRsj4SfzK46aWILtahm89YnUigXbpvg5No7KUa NY8n02EUW6JJplrW2t7QN+fzS1JIfnuyDsO/n+97YCHsdy8xWS+N5YJTXV5Ra4P6JZoD saf5Kmpg0zX1AntYfeMuabw9mT61I3Pw+6zmWyx+JU8n5Cq63GwbM+idP1iUmjIgptGc nXXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j22si18200472ejo.706.2021.09.20.20.32.20; Mon, 20 Sep 2021 20:32:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344275AbhITTVh (ORCPT + 99 others); Mon, 20 Sep 2021 15:21:37 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:42334 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347793AbhITTTf (ORCPT ); Mon, 20 Sep 2021 15:19:35 -0400 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 3.0.0) id 77bde04b42c00814; Mon, 20 Sep 2021 21:18:07 +0200 Received: from kreacher.localnet (unknown [213.134.187.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 9FF4F66A65F; Mon, 20 Sep 2021 21:18:06 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PCI Cc: Linux ACPI , LKML , Bjorn Helgaas , Andy Shevchenko , Mika Westerberg Subject: [PATCH v2 6/7] PCI: PM: Do not call platform_pci_power_manageable() unnecessarily Date: Mon, 20 Sep 2021 21:17:33 +0200 Message-ID: <2014133.KlZ2vcFHjT@kreacher> In-Reply-To: <1800633.tdWV9SEqCh@kreacher> References: <1800633.tdWV9SEqCh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.187.25 X-CLIENT-HOSTNAME: 213.134.187.25 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrudeivddgudefgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppedvudefrddufeegrddukeejrddvheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeejrddvhedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdhptghisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohephhgvlhhgrggrsheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnughrihihrdhshhgvvhgt hhgvnhhkoheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehmihhkrgdrfigvshhtvghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Drop two invocations of platform_pci_power_manageable() that are not necessary, because the functions called when it returns 'true' do the requisite "power manageable" checks themselves. Signed-off-by: Rafael J. Wysocki --- v1 -> v2: * Rebase on top of the new [1-5/7]. * Move the acpi_pci_power_manageable() simplification to a separate patch. * Change the subject. --- Index: linux-pm/drivers/pci/pci.c =================================================================== --- linux-pm.orig/drivers/pci/pci.c +++ linux-pm/drivers/pci/pci.c @@ -1191,9 +1191,7 @@ void pci_update_current_state(struct pci */ void pci_refresh_power_state(struct pci_dev *dev) { - if (platform_pci_power_manageable(dev)) - platform_pci_refresh_power_state(dev); - + platform_pci_refresh_power_state(dev); pci_update_current_state(dev, dev->current_state); } @@ -1206,14 +1204,10 @@ int pci_platform_power_transition(struct { int error; - if (platform_pci_power_manageable(dev)) { - error = platform_pci_set_power_state(dev, state); - if (!error) - pci_update_current_state(dev, state); - } else - error = -ENODEV; - - if (error && !dev->pm_cap) /* Fall back to PCI_D0 */ + error = acpi_pci_set_power_state(dev, state); + if (!error) + pci_update_current_state(dev, state); + else if (!dev->pm_cap) /* Fall back to PCI_D0 */ dev->current_state = PCI_D0; return error;