Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3247369lqp; Tue, 26 Mar 2024 04:09:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtV2gllegrL3R/w1NAljnkmrvM/3hX+sCxt4O7PUJhz+AtOU/NMhxzzR56AU0zquW91P4OnsY6D5SrHzHya6XuGzef0cltJ2vHj6SlWQ== X-Google-Smtp-Source: AGHT+IELQWOMjWOw5KtlXyAUD+FioHEfHovHOyob6M8cmIpVt8q+Lljx7Wf1pjT/Tb35kB5j7opw X-Received: by 2002:a05:6359:4c13:b0:17f:1d66:e0e1 with SMTP id kj19-20020a0563594c1300b0017f1d66e0e1mr7529757rwc.4.1711451351142; Tue, 26 Mar 2024 04:09:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711451351; cv=pass; d=google.com; s=arc-20160816; b=gwu/hlYhGVZAZLmgvtSUHcQNY0fhnLj8OoyW6mF1MiPHQzL58EyCs54EHLR2OxzGgn Xn14CCTEC1X79fsIAyWBg355heD7WaU4ydibogUhbw+HP0AWfmt0MQFLpwnXI6sXNplG 4T2DHODspiXRpFYeWnqdL78B01qPamVzuweUAgqazthphJ5pjGaodU24CQ14DFa8D5EU R6DQ1sZQKF6Jeu7Mm9QtKuEkCgQP8CkoXLtzg+pjxT68W4i5RpsJhyULN0RZRXLbqJ3j yKl/iH7dBU3LelXg0/TZmuT6bcEqvETDOUFTkLsCynSBadCGv1JVH+MD/oi9mdJb6ftN 6spg== 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=vFbJYhdYGvuoH/oaiD2HBWtmIM7M07m8HS3m2IPBo/Q=; fh=1JOZe7DKI+cQ7jz9PC8HSA31XByWbwtPJAa5U72T3K4=; b=ERit6tzU133Q9gddGJc4VaxG1F/d1WUrNSET6LP5cG1j79l/AkrOuPfpygD1US+QE+ nNm3PxLgtDfqom09TEVlnkZtHgDotrHUVBMgqzVFU6VBb03pPSU1Og2bI0v/kCONedUG xrbe9quqEbZnTm+GzIE8WajfMX3D9g6MsrReqQjOf9jmMFMaXRl/MKUOortTS/XccJZc H454jZDRCHkksCWhyotkEwcJ4yMckwwIeHVh+YfMqs2A2+3bTKGzNY+eQ6Zlv8Wsf23W oePE7Aod6xeomdZ2rEnbDHSpa+RQii8Vh6AzBlxDgdFnab2gs/OWKWf+MWQQfRyjApNy vOvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nmb3ZbAU; 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-118835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p3-20020a635b03000000b005d8bef48a86si9154497pgb.876.2024.03.26.04.09.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 04:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nmb3ZbAU; 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-118835-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118835-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2809EB2603F for ; Tue, 26 Mar 2024 10:50:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5ACB5644F; Tue, 26 Mar 2024 10:49:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Nmb3ZbAU" Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 4E8E952F9A for ; Tue, 26 Mar 2024 10:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711450153; cv=none; b=IMbjjWc5hTMRSgQz+306YgToavEWuM/Db4XsasqvVCE2kDL1H9EYEzXZs96G3F/q+L8jYGo5O2GC4N+0S4iMBdX8Mz+0GalKmg0/UogfTd28GL4BvLo2tq51osGpXsLYXk3im+285pvgOWvlTIR0MXIKuCsTVj5ylEvQvO12W2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711450153; c=relaxed/simple; bh=FdIlecklqovWUvrpfyhP9M3zVKU0Sq4nhdASMDLOLeM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F9NyKabRJbe7y2cN5gyf/U0fy/J56QZZXaOBfUdBGfr6ZSw9Nw4KlOxa0oqP+czTrb/4ut/wQMbOA2d6GTo/b0x3kTtaSQJ5tHUzD13uFG0zuGI4HoYMoUN/pcToG/Dizab47E66oiNbJPQ7I9LEOGh63rLEmjV+5GP5LCY53hA= 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=Nmb3ZbAU; arc=none smtp.client-ip=209.85.216.41 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-f41.google.com with SMTP id 98e67ed59e1d1-29ddfd859eeso4445663a91.1 for ; Tue, 26 Mar 2024 03:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711450151; x=1712054951; 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=vFbJYhdYGvuoH/oaiD2HBWtmIM7M07m8HS3m2IPBo/Q=; b=Nmb3ZbAUW1UmI1tzHyg8ILf73dPZJO2fjLqRqpUsnT3d933tWOFlP8PdT/oql1qla7 xmN7olPIjJOMbH7nTulCCwJm9GBq//U1i7fBFMFnEBaUwqUt7KOetgEltqQG5NP3v6n8 gcNRzaXkDDvulv7Er/7uJd9hnqX/40sds7fKgbS3nPXNkUFNerE7zPfXrAfYG6sW3uOj jH2J1Lel1bYEee+47BhEN6fjyu0wC6XyqUZe9Uca291+K3bCZBInZ6Uff/L84QxjACkS sC9iKsvwmFaBSW5VVLypGRThfRQqgti5/PxSdFgv+0Wv4FPXws9DZg7hpNp/3fpQINMt U+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711450151; x=1712054951; 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=vFbJYhdYGvuoH/oaiD2HBWtmIM7M07m8HS3m2IPBo/Q=; b=SGOBklbgmL0pnpihQWSK30jQkhNAA8/Hrk3piYl57vj12z3ap+0hOWsEb67KaGKWGS HZCQp5CEhz9FevljfNKVRvs48t3tUAe3byv/zGkcufFeNK4fwowD/RQKOl8OTY3IfYWu jtDmWYSKTdfJL7hq5KlryN73BVKEWP69yYJH2hBJYg15wNA/0ID9fWXir4/Yv4Trj/jm bt6STK6YwhnOtS4X2ZgGsUUnzjemG8tjU+H4lBVqTUNa1El+yGU0FDIz6SrN0JuBQYza fcmJdfO1vpTVxRLDh19NMm/fI+iSsjnsBFNj3euaiTrOkbjFGeRanF4TuOFdJs7wkebJ OLQQ== X-Forwarded-Encrypted: i=1; AJvYcCU0E+WxHnSFLGFC7uq7LNVBMMcknUebykBxrgx4nJgcZpZljS6e8YU2b/ifGNXcXSvVFY7MXIFI4F7WvFmQer3f+mtlKyENa5fuBuYX X-Gm-Message-State: AOJu0YxC7B7z1u1wQBiT2v3XrN3rIwoc3rlBtu1+DX68R7KnWrf2Esps ozZTqmDWsszDq0Y2QmS5ZsiPMbHkzWEywGtrU3NNwGQQLPaGHv97qF8c/GQwtA== X-Received: by 2002:a17:90a:1305:b0:2a0:4c3b:3454 with SMTP id h5-20020a17090a130500b002a04c3b3454mr7137289pja.47.1711450151523; Tue, 26 Mar 2024 03:49:11 -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.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 03:49:11 -0700 (PDT) From: Manivannan Sadhasivam Date: Tue, 26 Mar 2024 16:18:20 +0530 Subject: [PATCH v4 4/4] PCI: Allow PCI bridges to go to D3Hot on all Devicetree based platforms 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-4-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=1862; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=FdIlecklqovWUvrpfyhP9M3zVKU0Sq4nhdASMDLOLeM=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBmAqgV8B1oRhS/KEisLhilKgX2Z9YTFnu8il8dh f9ajS7O2tWJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZgKoFQAKCRBVnxHm/pHO 9eXUB/9NbhfHS2KhKNmrNgI0BRCyWwQs5Z61KL+HT/cENsQwy5+PBFop3vvKi5jAjCjl2F2llnV azk7wpPnz6M+RGS/kui+2NwlCPvmI2RSGReR8pmDUlW7dUL1MURBFvS9BrbA2GweE46rGR3GwCn zd6e4YlTwdT1bawePXF0Ovy39OdzdchHvn6R9RSCqaMulgoYAPPgdZACD1yY0TZh1bk4AbzGLTI V905mcjIEhpdM0/BDSMVr8EQDY+x6xFxuouAXOFl8RutypXrd6J459cVerSyAICab9gWMzhvoUf JJR1oISium2mQig51ikU2pslp2AlKXazrJbOLS7KrgkQcA3d X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 Unlike ACPI based platforms, there are no known issues with D3Hot for the PCI bridges in the Devicetree based platforms. So let's allow the PCI bridges to go to D3Hot during runtime. It should be noted that the bridges need to be defined in Devicetree for this to work. Currently, D3Cold is not allowed since Vcc supply which is required for transitioning the device to D3Cold is not exposed on all Devicetree based platforms. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/pci.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 48e2ca0cd8a0..2fe9defa69e3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2992,6 +2992,18 @@ static bool pci_bridge_d3_allowed(struct pci_dev *bridge, pci_power_t state) if (pci_bridge_d3_force) return true; + /* + * Allow D3Hot for all Devicetree based platforms having a + * separate node for the bridge. We don't allow D3Cold for now + * since not all platforms are exposing the Vcc supply in + * Devicetree which is required for transitioning the bridge to + * D3Cold. + * + * NOTE: The bridge is expected to be defined in Devicetree. + */ + if (state == PCI_D3hot && dev_of_node(&bridge->dev)) + return true; + /* Even the oldest 2010 Thunderbolt controller supports D3. */ if (bridge->is_thunderbolt) return true; @@ -3042,7 +3054,7 @@ bool pci_bridge_d3cold_allowed(struct pci_dev *bridge) * * This function checks if the bridge is allowed to move to D3Hot. * Currently we only allow D3Hot for recent enough PCIe ports on ACPI based - * platforms and Thunderbolt. + * platforms, Thunderbolt and Devicetree based platforms. */ bool pci_bridge_d3hot_allowed(struct pci_dev *bridge) { -- 2.25.1