Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp503905rdh; Wed, 14 Feb 2024 03:34:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX64yJGmEcOaqIbXInxNJNpxqjLYaDgcDIq1FjIAp+ONTUdrQ5GKb5W+FxH++nUO2qcANc3RjPCekVUhdG62hbEiqywF6JxsxMu56G9pA== X-Google-Smtp-Source: AGHT+IHC1qeHR44+9IxmVeLIeNsTHCUDjTsLOqI8jfbpt7Z53oLE1H5FCNrNSGdJ5v/xwKXuoHiO X-Received: by 2002:a05:6402:398:b0:560:209:c800 with SMTP id o24-20020a056402039800b005600209c800mr1653841edv.18.1707910464675; Wed, 14 Feb 2024 03:34:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707910464; cv=pass; d=google.com; s=arc-20160816; b=UodcyW6xyM67bWnfjEUYgLM9KZDJJ8BN/S9HpLBqVrMmnIYJ8Bs+WFZ+U1mrvJcDG7 3Itqsdaw4iKw1Lbiag8/H/pyL6J1p+nO64z48BFKSZlDyj+rek8QSnNP4T9/dBYhlSj3 IuWVAaNaagXg5W423Q6gYALbRVh3wiIS63duOodyu7lGHNElCObRewaZKOn0OeZQTqnp zqDzQb0tenZtzzWR+VKk1Lyl4yAqjA0lvJE7Yu2LhZv74fwsunTsJmmy5BRWvWO+ydMe rm+7majNvRHV+OLltuJhDOf8fVCX7JXhpDtcnXEQxflxhvmTdy/X8gmaIxlZLBF3y2H1 1m8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OCM1J87s8G9/OmkewnV82bTVzmX7HD7VMShjeCZE8Ec=; fh=TS9QHsF/BCNmihKPni00bKXXYX3mmwyxwdndnatkic8=; b=mk0OPubzMBO2LhJfhVhVBnyW9HP7ykhj7w+k10BnxI1nuY3UNosk/xMYGr1gJDIlbM FVAsj3tj30FtkjvyBcQn6pxFF6k+jmnNmycAXpgmqnADSKu3+IqeKshJZri/FHf59DWe aMLkhsD39xgTlgD7LmTc0pU4GMeD+BHsIZ1T7TUe0YWXgXv/lXC8WMSNcZ+lfqGxSZY7 NwUU7fGoSD7XYEVCdbeY311KJBv0NKNxZwv/obC3X6aW03Z29kUSZUUYNOV3SmW5X2K9 3anUNWPLenDSavB2RJCJce3xxG1KCX2+vpSBgXqFKHC86TwP2fcc3R7HBzYuoHDWWgWr iU7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bD/BNpiy"; 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-65135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65135-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCUN9UUXI9rs+LcXe5vxME04P4o52jiufRJVpsId5UWXg0KdggPruo9yC4gn+ze6bfNp8YT1GAlPN9Yv4HDaSSiKMIvkt79ge3dfdUu0KA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v22-20020a50d596000000b005632057e94asi514388edi.483.2024.02.14.03.34.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:34:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bD/BNpiy"; 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-65135-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65135-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 506441F21417 for ; Wed, 14 Feb 2024 11:34:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A17AC1A28C; Wed, 14 Feb 2024 11:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bD/BNpiy" Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 6601A19473 for ; Wed, 14 Feb 2024 11:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707910450; cv=none; b=MZUXcHNpJRQ7ceyBopTneUDdAXrfRbS6nlVsCQ/k5ba1173tsLA1dsPyzV2UTh/FS+7BU9vXhABaWTJN0K0vBKu4w2dft8AUBXUPYiQBT7wNLb975mgsbQ3wUjicMalnDTrR6wn7lZkxag9oO6Z90ZGSYZOuoy35kYUYLTi/Jd4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707910450; c=relaxed/simple; bh=sJTbIVUz0Hg10hsxyj6838cKmbVkjkxwNJsJNNBj0m8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p2MjNMWfcHTLBrFUeXnk9G8qfo75XuSd3qyuP72s3qh0Wy6PIcDbaZpH9Fx8EUU/+wxQRDtAzkmdvV3mh9K+uqu4pmSju2RSD3sOef0ArODDFmQBPcDcbQiFj/Fn7Px9yiZy49cnVIzrWGev4W2rXRePde2Q0Hhs1ZuDE3Jj5IE= 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=bD/BNpiy; arc=none smtp.client-ip=209.85.214.177 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-pl1-f177.google.com with SMTP id d9443c01a7336-1d94b222a3aso44453475ad.2 for ; Wed, 14 Feb 2024 03:34:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707910449; x=1708515249; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=OCM1J87s8G9/OmkewnV82bTVzmX7HD7VMShjeCZE8Ec=; b=bD/BNpiy7mioZOpp/nN7Ir8qHbkIZPK4oR3AiVTf2boNOMUXjra28FQnV0sVLL9xiW vOt5XQxjg5Uy5GOm0PgBWfJhek3civ4GeGDuQGUzbc7XhhK7LXFFw24Feex9KMAiwNA0 HTguOW7gQN0SpZFD+YgNapFAqBIzPB4KOgQNpOPGzEecEgXQ8L2tewLzFMD81cppYDdk po4ipFftTHK1gm650oDeklkjKsQjpPFHeKInq5v5DXm4sseJ7lDO+yCR0wRc1gPAD+Kf kj0nzvfdpqqyzyL8AQNVpWOnLe6RVw8bw4qzBeV/XH2GGgNZR65Pv0BvZnvTcAe1htQ0 7ieg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707910449; x=1708515249; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OCM1J87s8G9/OmkewnV82bTVzmX7HD7VMShjeCZE8Ec=; b=IcSxkMS3tgkI7OT8EKK87oUDY8jaZU8rf5j1+YW90CnoRAgqhiX7RrcbrekfCOQc4j tw4xTUD91wYZVPRYu9lwroXYkDfqnSkbnGyzLQxavI10CadQV52sUewAsvb6SEwxH+af GsUepa7J6nXQIe1Bh3r3mlhnjvk1MeBhSwIRSLjq9e0L3TpVJgYKqkS2MnIiDqp5FgMx uohz7X7/SnLDtxm+zsykeBHZV4VBKGrks6GHCM+unkR21xM9I/1Y7gYasiY/GluKT//e Q9OKdkkfkU5DuYnnuEg0obsxh8WZtrVExDZq2u3gqpMeKaFLMlYb7nixeB9eaCkeYAs+ 4PnA== X-Forwarded-Encrypted: i=1; AJvYcCWZW11ZlF2EPXFOIgzyb2w1+L9UbM2QXoMbMQrl6Qw49iUpON9Mfd5jNqZpJHntny7gRS7aMnO4e2mg8J2GJ56HnhAdbpAWgH/SlIOQ X-Gm-Message-State: AOJu0YyAsJ8GrjGbYZC8sf2ScaMwHaZopZLGEeQKx/cIvJszPsZWiGws O4uKuTQReC+F0EdKrSuYSJgakCRtKlYvkaw5i2GRQoK4n7G1/2RZ0bD5rznI/g== X-Received: by 2002:a17:902:ba82:b0:1d8:fb17:a1fe with SMTP id k2-20020a170902ba8200b001d8fb17a1femr2247033pls.48.1707910448685; Wed, 14 Feb 2024 03:34:08 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXbQN6Y5OTmeKcUhV2Vqie/s1dT4gMoVzhPVe7L+a52OBKlOQamjaY8zUxxcA5fcX0ghPK7z1XX7ebxxJxylpjMUZDpPUWzeOQET8UKEFh3RAo/6HGFe7LSUelUHR1rNBioPE5UiXp9tREDdtm79ZBKh1SinBMs2Qagq5Zgpe19KpowJehIbvUUXn1gB2/3R4LSnFod0w3GsEO0PdzK0R7cS2r79sZMEq+/aEoxZrJsg1bbTVkab9g+RBZr12p1GwSGUYvvp68Xyc1W1WJ4kD3Csovq2zrGa2CMsOKdxtwi5XXWq2KsYZajqnQnn4IJ5EUGkva6m1d9UU90SyW1pdTaIK7jcYaJ0ZOAmHepwpUISIGSpa56Twkvf7lfrcwMyHuD0fpn3tZT Received: from thinkpad ([103.28.246.124]) by smtp.gmail.com with ESMTPSA id o8-20020a170902778800b001d94a3f3987sm3506312pll.184.2024.02.14.03.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:34:08 -0800 (PST) Date: Wed, 14 Feb 2024 17:04:02 +0530 From: Manivannan Sadhasivam To: Lukas Wunner 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: <20240214113402.GF4618@thinkpad> References: <20240214-pcie-qcom-bridge-v2-1-9dd6dbb1b817@linaro.org> <20240214102837.GA30420@wunner.de> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240214102837.GA30420@wunner.de> On Wed, Feb 14, 2024 at 11:28:37AM +0100, Lukas Wunner wrote: > 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. > Ack. > > > +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. > of_property_present() just calls of_property_read_bool() and it is fairly new. But yeah, the API name itself indicates that it is better suited for the purpose. Will change it. > > > --- 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)). > Sounds good. - Mani -- மணிவண்ணன் சதாசிவம்