Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3237348lqp; Tue, 26 Mar 2024 03:49:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULFxVXzF6f6vSOfPOWZsvbFIxQHoEKSdDedOuMD4fPy6PAFBhjIMr2a1VC1dUwiZUauYSTjRdhsBZ8UN1PHlb+/Ge1ELCEk3i4MNEt+Q== X-Google-Smtp-Source: AGHT+IE5iCd7ZQGECC8gRNlF+w0zuFX5qn6djY6pfZ1sJKCjfLtpdoG/+RfZYiujUA5UCelvbE94 X-Received: by 2002:a17:902:da83:b0:1e0:c0b9:589e with SMTP id j3-20020a170902da8300b001e0c0b9589emr1687790plx.25.1711450167251; Tue, 26 Mar 2024 03:49:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711450167; cv=pass; d=google.com; s=arc-20160816; b=jKd0L/i7qwb3e/r9bMi5hY+rVIadt+44GAFGB1Sf3mOx9jUSjZLuv4Er9R1Un8xe4d j+GLxKK/qPPkVn9B2cn0QabU7R3PN1Ikx2Pz2eE2c23ksSI+lsLKi2LRglGyCI+jedqc TZ9n/JX7PNyVFBXfCCXLEcAq0FR9wlqNPYz5SDqt2bhW401SFchF5IUS0iIO7C/3r/KF vOe9Jx+dzyjZ50gw3P0HFSgsd5FP+Z42jqV+fPfGoO+tZEE1a5+jvjIufoZCDqq9Tcn0 ZXUHFRb6SXpA+zdS0ofYgo9yZAY0V9fr9bgIPpmdI4xlayfKwIaZ/5XIjiXXVNYsoZ19 iofQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=f3SaotDWl/4tLhYj27mIQOcHctxJufPLQpgAq2r/Phs=; fh=vNyJ6d7d+JxP6CFQkYWQ8K1y38Zgi0K7DqYc72y2XpM=; b=Q1yqr4RS+3qpFLaTRsIaohdht1c7t6Cm5kLdDloTqe7ogFbPkEpvXunX0I0aeXn22y XXycYn2DQXuehH3mhLYSQ2tNB/q+2ZY7GpMDqnvikuus8nfXFOLIZHG0pzPPrAYjPIHn 3cBmoP57HJrTlI7i2d3AgjshcCM4gdnEDZEWTgEr+ds7WLS+a0gx6olDbjPR0FkiZ1fO AOpVXTMdLvTmqzdt6YpnsoZJOE4X8o5/Nyf11N6EZMWNuqKQgm7Kd/lJyQ4z0gI5YCbh DCBqOYqdKFYgXDyaDpvobCieDW9pQaln1OOw5fHscERDM+j2ykTd58tfeqKFI+Q/A3JM 45Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DKI9rqcO; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-118832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 1-20020a630101000000b005dc432da142si729706pgb.479.2024.03.26.03.49.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 03:49:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DKI9rqcO; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-118832-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118832-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D99652E3348 for ; Tue, 26 Mar 2024 10:49:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EC6417C6B; Tue, 26 Mar 2024 10:49:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DKI9rqcO" Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3DCE14AB8 for ; Tue, 26 Mar 2024 10:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711450143; cv=none; b=livYQj0vvpVorRkECfTrjDLUbuuXemqtriRZ6apY3dKH53NpuoJQdSOIklBdom4quJ7WZFG4FA5QfkEHkW1lV1qb8jiYa7MNWjppTuC1BZuaVc2J4PmIHtv9yV6ozvdixU3Crc4ybv/rjoPrEbfwXfCQzil4frx6nbAXCwFOap4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711450143; c=relaxed/simple; bh=a9jhEQgepLFu1V/9oFFkAbVrqrZxzbztMATHDJFc3OU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WhA1Cu62BIvGIxjWXf7So9JYquXxvXuYyrSP0K9BsyGiMfz2DuoVM3h2k3g52eQZoWlYuFbzgTh8PJg+wr64M+RXFUS0m9i1ZusOf2Fg6vs5v5uSjZcsXoUnrqNIieHrVeWy/uREnkjlhqB4MKitVPAlJlzpHBrG5l9p8myVtJw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DKI9rqcO; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-2a0782f0da5so1066368a91.0 for ; Tue, 26 Mar 2024 03:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711450141; x=1712054941; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=f3SaotDWl/4tLhYj27mIQOcHctxJufPLQpgAq2r/Phs=; b=DKI9rqcOywAd/xF3C0HFG0zlBOPpf6/tdssQ9ECGiIrOYlM0+27o5d8M53lawXcz5L wEQQR80kSaPJX9H9NoAI/cyw0nnVkF1lJedokvO7BKIP0eASiioZv4zv8TpG6PL6A7tw oIyzCv32Yr/nqRn4VRUUBNrfQT6NRqDLWEN7SwKf0zwB00TP3RB49GlIBrYNn9G/0/jf PUS4IZ4ypkc/mHRJh+i9AOCvGzYpnnrqkhHgpmaR6d3Jok8tZISq4kdwhbPRzkPCYNcm ZqGT0VbrkB+yw6q1Ry2+DGb1SSf8JlIIzlhyDxvjH3OXH2vGWjWAx3NPsoZoU3ArFEiA b1mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711450141; x=1712054941; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f3SaotDWl/4tLhYj27mIQOcHctxJufPLQpgAq2r/Phs=; b=NCvC2JntpYO3iuWDSpv30/Y3kNHX7l8FM4P2W63u/egfYF33oCxFv9mmwfh9Jvp5yX /Fd+WJ1uzUHLenOsKRWvEWCYuhPnnq/DIY8GxAh9KhrqHOOXVO/2T08iINWhSH2kbqa8 t4j7akRuTXCI8Rfren1tk/4ozkjwg7EwETNbDOKTZPoByELs55MbB+dDsNcqcY/s40lC qFBSejua7WS1gyAkGDfR/S4FrmfGPLPmQ+ysc++LaUpkIQBTEFnd57/2sIOKN8CggrU+ wQuLk22saGkA+v4qW9TdZUp6UJvjNfQw6zigcpQcDBZ6/yIuwiCAgCjgTSeDQx57yXEe kokA== X-Forwarded-Encrypted: i=1; AJvYcCXe9kmI2iZjECyAlh0T/UiyrqnDe7P1SBDIZ+ACZ0DtOztSpZs9be+yHsnZ1emhpZ2QXjMyTkcUTjsAbtdR9TOY+27hro/xU2Y9YiUy X-Gm-Message-State: AOJu0YyQKhxeMfDwaA74fZnN+jxYnoL3a1tL4xnA07iF2UW5eJpZiP4T HFt82ecZaKrZUUl6PZwB7pqEPJH34eALGIrD6wFvEAVH4PP0JwvEGViGpvhNSgqVFJSQ3Qs25SI = X-Received: by 2002:a17:90a:c788:b0:2a0:8eee:5603 with SMTP id gn8-20020a17090ac78800b002a08eee5603mr706623pjb.6.1711450140840; Tue, 26 Mar 2024 03:49:00 -0700 (PDT) Received: from [127.0.1.1] ([117.207.28.168]) by smtp.gmail.com with ESMTPSA id i22-20020a17090a059600b0029fc196159bsm8777218pji.30.2024.03.26.03.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 03:49:00 -0700 (PDT) From: Manivannan Sadhasivam Date: Tue, 26 Mar 2024 16:18:17 +0530 Subject: [PATCH v4 1/4] PCI/portdrv: Make use of pci_dev::bridge_d3 for checking the D3 possibility Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240326-pci-bridge-d3-v4-1-f1dce1d1f648@linaro.org> References: <20240326-pci-bridge-d3-v4-0-f1dce1d1f648@linaro.org> In-Reply-To: <20240326-pci-bridge-d3-v4-0-f1dce1d1f648@linaro.org> To: Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, lukas@wunner.de, mika.westerberg@linux.intel.com, Manivannan Sadhasivam X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1566; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=a9jhEQgepLFu1V/9oFFkAbVrqrZxzbztMATHDJFc3OU=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBmAqgUbSOKJVFNG5vo+m1rTB5ZtU8V4c/GTGvtz SRWC0jHPCGJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZgKoFAAKCRBVnxHm/pHO 9X8aB/4mHeDmAABHwdZVT2KCy3Oi2k8U3Euk7a/eKi2F/KDGkvTB2juxg6mHFSYM6GAAuFUEMqv H1bqB0ctCMAnm5M9Ic8ML+rjdYiCCs9iX4FoXtSkqIyMg/Ggvcugfyq0z7cSSmSSVchACmFV1zN CxqohHwRG9XlbS9KWYTXkDRs77JklCpTdk4Yb4wTD8sxVCevT9xo0dNymysXSEwDVr8c7oNTTX3 EVeeOnwqSgTgtNxsxVLVRlme4T+xTuZVYT9IXPrPtq0KWXk29YZZ3RvD8R96F3tVWLjByX3oFh9 fmHw26ZXd7Fl0Ca0GWeUwfyszN1gouLii9fer4v1Hb2tPDra X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 PCI core is already caching the value of pci_bridge_d3_possible() in pci_dev::bridge_d3 during pci_pm_init(). Since the value is not going to change, let's make use of the cached value. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/pcie/portdrv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pcie/portdrv.c b/drivers/pci/pcie/portdrv.c index 14a4b89a3b83..1f02e5d7b2e9 100644 --- a/drivers/pci/pcie/portdrv.c +++ b/drivers/pci/pcie/portdrv.c @@ -702,7 +702,7 @@ static int pcie_portdrv_probe(struct pci_dev *dev, dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_NO_DIRECT_COMPLETE | DPM_FLAG_SMART_SUSPEND); - if (pci_bridge_d3_possible(dev)) { + if (dev->bridge_d3) { /* * Keep the port resumed 100ms to make sure things like * config space accesses from userspace (lspci) will not @@ -720,7 +720,7 @@ static int pcie_portdrv_probe(struct pci_dev *dev, static void pcie_portdrv_remove(struct pci_dev *dev) { - if (pci_bridge_d3_possible(dev)) { + if (dev->bridge_d3) { pm_runtime_forbid(&dev->dev); pm_runtime_get_noresume(&dev->dev); pm_runtime_dont_use_autosuspend(&dev->dev); @@ -733,7 +733,7 @@ static void pcie_portdrv_remove(struct pci_dev *dev) static void pcie_portdrv_shutdown(struct pci_dev *dev) { - if (pci_bridge_d3_possible(dev)) { + if (dev->bridge_d3) { pm_runtime_forbid(&dev->dev); pm_runtime_get_noresume(&dev->dev); pm_runtime_dont_use_autosuspend(&dev->dev); -- 2.25.1