Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp708820rdb; Fri, 2 Feb 2024 01:11:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBkTLYFT6CEiuWlQJ3aSNXzbrDT/EB2XLVM4349zfceHvVH/pqXMCzsOv075b38jxIm3Zm X-Received: by 2002:a05:6808:1512:b0:3bd:a880:d248 with SMTP id u18-20020a056808151200b003bda880d248mr8942093oiw.41.1706865097936; Fri, 02 Feb 2024 01:11:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706865097; cv=pass; d=google.com; s=arc-20160816; b=kzm2aSD3NNQJqoeYR0yuf/BFfrri8Ctb1ZRuUkLd/6A5jzHPtt1UXc8MI0xT2QkNv6 JjxfH/0AxePiF2JJQiC09+Q3TfPD/vH0eXQPPq+VzzdK46XAUvy5vGrWmV54cKergad2 AZMvByzkpG0cro+bACh8ya0eJ8cH06gBapc547c4gBqwfOMf1Bz+mJhNjJLXb0lUutEB W5saT0oA9kwKfwRPGzCS6IAmsnIIsRzd3uvzHshEkVwQi1ApebMEQSeVca+5EswSQOYs JvYlRxMoxYrgSOs4/femQVpQdpGrbqJDe2K/VUJxve0plPAMDGwHAuClaF125r5/idNC lJLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=U8svhigfdHFEbn3ZpOKQgvPLB4MAllbGpBNvvn8k+zM=; fh=PNJdo40HHCKq42YAZrxnnyXvtBs9GHpp7NY9ID650XM=; b=HRAaAVgMbubaw2r61IVD2YrPHawKdlVtlPkqEamKHMbwWYAKFqO/Nabf/COcBZFQUH QvqqeHGpjjVMxWjZi9NAfuR5ItELPJ0D3Jw30YQoBejQKAYAyWj+ZsIfNQYyCy1lD2g4 xELOXd01EE1u1l47bjFOPbBFL7b++gOyyTCtSPPans2+T66ZPbfIoSdDkObBpV6KGlfU h/8wAHxCnQbxnEyi43b/rXgiL2qMPIC+vZ51Su5CMeRJLREtyLPVUiyIRn7GyHYigLAR DXjwzm3d3WJJb/zsbwhIDvI7W7T41+GHIPJtAFoUYhXEvEOh+sDMsJGXj+GKpl9Ps0ec Ue3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-49534-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49534-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVH5O+wKGqdAJWAm3f9LDWE/bnoRNMNbcLsmx5WnmKCRG6L2iRx7NRzIjNgGlV9UN7wKqSA006M83Wx+itpQjyaL7ZYdIbZGzTHuXzt1Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n25-20020a05620a223900b00784f2e6f1d8si1509005qkh.624.2024.02.02.01.11.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 01:11:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49534-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-49534-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49534-linux.lists.archive=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 611B41C270FE for ; Fri, 2 Feb 2024 09:10:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6AF776918; Fri, 2 Feb 2024 09:10:17 +0000 (UTC) Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A83960DF4; Fri, 2 Feb 2024 09:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.223.78.240 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706865017; cv=none; b=ndm4/GUjX3acTBrDbNq62raDIcG/jORlg44eBomtdN8krjrMa4cEVOXF//KVVL6qKYcR4XN6ZpL26feIYe8gG/+G07N5XG36HXAp9yppn5JxdATmjXQKVraxUjuUPDCxpworTcS7+Pd0yeWusESTA8720436EGZJI3rHVSJP75Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706865017; c=relaxed/simple; bh=9Lw3yyGGfLfAKvtWSVgcJ3MOHZlqdZ5nHi2QTFG85R8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ek7OA4WoFSxRM2ZA5m5PqGMi1yhxUQlXgByeIVQQwK6vgsxR6bjTxdTjLdn4212N1q8+4fiZ+dk7xVBMnd06hGSQQtGQrhWzVV1O/UDIqJAlaDWmfqFrI/XyMoQjkXSrSrUX3sI58CiSZP2eE1ImRl1pPvWHtBe1i1z5Rjez55U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=83.223.78.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 99FF62800B3D2; Fri, 2 Feb 2024 10:00:33 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 8C6CE2F6385; Fri, 2 Feb 2024 10:00:33 +0100 (CET) Date: Fri, 2 Feb 2024 10:00:33 +0100 From: Lukas Wunner To: Manivannan Sadhasivam Cc: Bjorn Helgaas , Bjorn Andersson , Konrad Dybcio , Lorenzo Pieralisi , Krzysztof Wilczy??ski , Rob Herring , Mika Westerberg , quic_krichai@quicinc.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 0/2] Enable D3 support for Qualcomm bridges Message-ID: <20240202090033.GA9589@wunner.de> References: <20240202-pcie-qcom-bridge-v1-0-46d7789836c0@linaro.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240202-pcie-qcom-bridge-v1-0-46d7789836c0@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) On Fri, Feb 02, 2024 at 12:24:16PM +0530, Manivannan Sadhasivam wrote: > This series enables D3 support for PCI bridges found in Qcom SoCs. Currently, > PCI core will enable D3 support for PCI bridges only when the following > conditions are met: > > 1. Platform is ACPI based > 2. Thunderbolt controller is used > 3. pcie_port_pm=force passed in cmdline > > While options 1 and 2 do not apply to Qcom SoCs, option 3 will make the life > harder for distro maintainers. Due to this, runtime PM is also not getting > enabled for the bridges. > > Ideally, D3 support should be enabled by default for the recent PCI bridges, > but we do not have a sane way to detect them. So this series adds a new flag > "bridge_d3_capable" to "struct pci_dev" which could be set by the bridge > drivers for capable devices. This will allow the PCI core to enable D3 > support for the bridges during enumeration. I think the right way to do this is to use the existing call to platform_pci_bridge_d3() in pci_bridge_d3_possible(). Please amend platform_pci_bridge_d3() to call a new of_pci_bridge_d3() function which determines whether D3 is supported by the platform. E.g. of_pci_bridge_d3() could contain a whitelist of supported VID/DID tuples. Or it could be defined as a __weak function which always returns false but can be overridden at link time by a function defined somewhere in arch/arm/, arch/arm64/ or in some driver whose Kconfig option is enabled in Qualcomm platforms. Adding a bit to struct pci_dev essentially duplicates the existing platform_pci_bridge_d3() functionality, which seems inelegant. It increases the size of struct pci_dev even on platforms which don't need it (e.g. ACPI). Thanks, Lukas