Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp473152rdh; Wed, 14 Feb 2024 02:28:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXiGCdPPxdTHUm/AnJbeNoe9KVug+ncs8/y7anGl6GplzV3QWLKPS7+l/DVhjEVIKX7O4F8PHkjzODqfZNrTtZQ3/d3ZDVLWc6ULsYjgg== X-Google-Smtp-Source: AGHT+IGX1LOjwuWnc1a6wwNDQhaJOgsK+JPl+5kneuBw0KY4RBqg700U/3PKh20rwYJ0xzDsDpCu X-Received: by 2002:aa7:cfd4:0:b0:55e:f37f:7fc5 with SMTP id r20-20020aa7cfd4000000b0055ef37f7fc5mr1634606edy.14.1707906538850; Wed, 14 Feb 2024 02:28:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707906538; cv=pass; d=google.com; s=arc-20160816; b=QMVttQ2nkBWaEPbgfQ0DUma157i/5+CEImM/fJ4a2xqQVlPmT9YWkR2JX7SgCwVU8v 5fQGR+QhqwEofHCLtKrQ7wDn09tykkgXXJBXluL2HGdmT98qDdXqri4YCzSHTWB1ucdR IpT9N6B0xuh0jZBKvYDJ9YX+JA4cgMs0tFCCth3Db/nybZBtey6I5XcC7+JFg0/f/xhf XKssHQ7smbE7N9SeoGM5YYnIcg0OGyvVFnp/3ufmiWNwUFH6Xp9FsVhmzsaVUVzOfju6 rwq3EEoKacxhfPAyO6vSciSF3ZUMEtzOQrl7sPXrINov92GnMdPHrm5Zxt00diZ0RmJW JTXw== 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=gD/yTeC+YUuhmu7smA3czFRF7eI/dqMp72ZS2g6obsU=; fh=Xrb1tebxK/MtgzS3HcwsPBbTdX47Itnt4vU0V3r+hn0=; b=QqpUe9XHIi6dNYIaeOk33wD4jtEY/M5QqEIfCJd4jWsW/1dA373ng7U0GInGU99e7E qq6CKsYE7wdcg6JtS9gdYU+t5C+DLob6PnKalLDhYwDo7O8qBGMBcEunw8IvSymALbIi Zlnvb95uZglS7X3wjaZkpYlQunBrLYE2nEwtSdm/WUFxyrk2DcoXAHYk5/EhgTVbU8Tz vYAQag7CIbMUkc3GP47edg1vHERR+EcAJg9ejaslDl9204sb6Ed8f/GuNDEjv69qyxeg 61bi1SE48F7vMrRBenjSeZtpqFTG5NDk6kueqeoToM/02raAVHKFrzjMdcNsyzoS5EW6 2BHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-65049-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65049-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVmxgcw77oO8zXV0lkSlAoXUPPbcb2h44ktLqatTTgn0KInicVDOtsCDiRkF9BC8iDd6PgDVn/HYm5nOCpsnMw3U/65OoVjxMVasv14hQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id en20-20020a056402529400b0055f8efcea96si4734275edb.499.2024.02.14.02.28.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 02:28:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65049-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-65049-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65049-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8C5E81F21CA7 for ; Wed, 14 Feb 2024 10:28:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EB3E175B9; Wed, 14 Feb 2024 10:28:50 +0000 (UTC) Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [83.223.95.100]) (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 D4FFE1759D; Wed, 14 Feb 2024 10:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.223.95.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707906529; cv=none; b=VzFRSZNUiwZGMxHLOc/R8uit2giBuIWbEuCrHpJvHz8izihLax/gMNEj7kX0T03INQ5WeiUAYQPBsJoRC+wr0+Ld+GE3axB/Gij54xJxeiae+7U/cTKAYPUbL6jqw1gRFESOJXTavpTwFwxU8c7P++Iyu8E0wz96oljxJoFgAIM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707906529; c=relaxed/simple; bh=8/XhGqCAuGX08PlCEKi60aMtlMVFlwsETgvlqDwir/o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rI9XOEFjn+J+/OGx62nf93frKK5JGw5yto7PnluDBX78TGkY6z0m7ILSlbKozv44Ji4hHnNeMADK7gBfcRi+LyF/8yXgE3y1ep0wwEPiLdnta2/k2b52pDHr5VtgWasKBHfyGLgwwxHFl72jdn68wji3zkr3AqHcI4o+rhxRTwE= 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.95.100 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 [IPv6:2a01:37:1000::53df:5f1c:0]) (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 bmailout1.hostsharing.net (Postfix) with ESMTPS id 0AD2A300000BE; Wed, 14 Feb 2024 11:28:38 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id F36764EE665; Wed, 14 Feb 2024 11:28:37 +0100 (CET) Date: Wed, 14 Feb 2024 11:28:37 +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 v2] PCI: Add D3 support for PCI bridges in DT based platforms Message-ID: <20240214102837.GA30420@wunner.de> References: <20240214-pcie-qcom-bridge-v2-1-9dd6dbb1b817@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: <20240214-pcie-qcom-bridge-v2-1-9dd6dbb1b817@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) On Wed, Feb 14, 2024 at 02:18:31PM +0530, Manivannan Sadhasivam wrote: > +/** > + * of_pci_bridge_d3 - Check if the bridge is supporting D3 states or not > + * > + * @node: device tree node of the bridge > + * > + * Return: True if the bridge is supporting D3 states, False otherwise. A lot of kernel-doc uses %true and %false. > +bool of_pci_bridge_d3(struct device_node *node) > +{ > + return of_property_read_bool(node, "supports-d3"); > +} What's the difference between of_property_read_bool() and of_property_present()? When should one use which? The former has 691 occurrences in the tree, the latter 120. The latter would seem more "literary" / readable here, but maybe that's just me. > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -1142,6 +1142,9 @@ static inline bool platform_pci_bridge_d3(struct pci_dev *dev) > if (pci_use_mid_pm()) > return false; > > + if (dev->dev.of_node) > + return of_pci_bridge_d3(dev->dev.of_node); > + > return acpi_pci_bridge_d3(dev); > } This will result in an unnecessary test on non-DT platforms (e.g. ACPI) whether dev->dev.of_node is set. Please use dev_of_node() instead of "dev->dev.of_node" so that the code added here can be optimized away by the compiler on non-DT platforms (due to the IS_ENABLED(CONFIG_OF)). Thanks, Lukas