Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp620555rdb; Thu, 22 Feb 2024 14:08:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUr6ExWIyXCc87Z2Ohyn/0cJrIbL/mC931Ez0bvtbMtoR1Y+/WR1aaBOKmM1cllUpClnqQpY1peEsIyOf9VY14H44wdjO7R11z0LGX83g== X-Google-Smtp-Source: AGHT+IExI+b7Mviug1fiHTE4lDcQR5txGXyZs0G2ISw0OXyrEFJZGUg5EJM6UZBWNmsb5sIFrJ2n X-Received: by 2002:aa7:d50a:0:b0:565:6424:6ad1 with SMTP id y10-20020aa7d50a000000b0056564246ad1mr43288edq.14.1708639705609; Thu, 22 Feb 2024 14:08:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708639705; cv=pass; d=google.com; s=arc-20160816; b=CkxpCI7lCeXIiGlZCL05/ZO6anYLWGxcue/raM36KWke3kLjHvn0ZjoCes93cJqxYh /r/079zZe3dBb/3eOJPXTeNu7DCnPPzGJb5IcDN81Pc7VGPFAbi6qILjJ/okOwPIqu9Z XPM66ctpKmZlTaW4tpJ+t9JNxEzSFExhyk59rIihdobLZ4Y8zEJhla0aRvMUpgnEvqAd fQyXhVRusDfnTmdE3Uge7qMakXKXe2Qu6BZ+4cIauKBZ/K/p8S18KjdLhRIynBwzbtD+ +DE2D+yfdmNDhHkyZzpFjChBUpbx8Wc5wXwkGNFeyHJqYWQEjwsFNcAb3RcLJ134lmK6 6KaQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=3WiSUzGx7N9yuMpBuFusMM9XdFCXY77geJNL7kWD7AA=; fh=akqPOcx3mIeNfEDyrQzbGO2yqJCgC4BYenTTxKjVBKc=; b=cBmeThJjEv4loxLbKniSmAvPcPMiD/GWdN5DapUk2PpXb+HXFNL5HjJqX26bl4LKI/ OrdhQ/imQuZ4GbelZPOhvZ0bnrt/d/zbyC7CzE2IAReg5AMZCTHXyRkreXT6hFBYYx0b LVpynvxwnQzWgIditjk3nZwjZvw6AVIYhrg+NXsu5x12T+TUvBomLzA498KS79Q9c5J4 bCtW8dfhdZzsqR4si4kRXnc1UXGmHCUCY3r5f1St/csXbL05DSiMguImWjhFDLpi6KC+ fN/RTulIv8rDkOJEOG63AD6gj9UTOS1EffjkKa7w5s+m4fs57uX7gh8vtFd2H+1SjBdN 5xvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u8FQdZtL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77447-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77447-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u16-20020a50d510000000b0056564752737si111572edi.233.2024.02.22.14.08.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 14:08:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77447-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u8FQdZtL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77447-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77447-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 5D2681F25AF5 for ; Thu, 22 Feb 2024 22:08:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A9A1137903; Thu, 22 Feb 2024 22:08:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="u8FQdZtL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AF33B73F37; Thu, 22 Feb 2024 22:08:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639693; cv=none; b=lMbZqr8Vzq16Xy75IgRWGA/3kdmpD1tChqb2tt5919EdI5avtL6lSDPJI4TyfPrPXgQvEYHO8rG/uVNxU2sGAViOtQuSjv5s2cYvljBQPJk4fhVgESvMvrnqK3rh8F2fkjq0foodwC0tvCRMV8EG7PKWQaPH9e4/bPQU76uIjs8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708639693; c=relaxed/simple; bh=CuQc5x7leFz9R9+zLGnroGX22UpyIfplVvG4ngR5Kso=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=lfCl0gRbFIku/RAkaOMtaEgtsBr+bsi3iiFJrL1RQJqAB32rbeAQaM45hZ1W1PnrP08AD4rE+vpyzgYAxFaY331vXFXEJUOpPpoV5Zfkp7ZIlJOJepvcX9xCPyu3wS1plTd6BpnC4zyn9jT08RYJ+eE5Nh9cyAHCndQ6E+tel3E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u8FQdZtL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC3C4C433C7; Thu, 22 Feb 2024 22:08:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708639693; bh=CuQc5x7leFz9R9+zLGnroGX22UpyIfplVvG4ngR5Kso=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=u8FQdZtLixiIeEa3nlQA2BOqfuEA288VBLVysxbhcTY4n1/4y/QUfks1sYI02qEPM 33YgWKHaHGQGIhkzXWhheAQvDCTrOQUjFnH47obguKW+fwXagbH+/rf+3OMrnay5vW 9qQUH3oPxce+mPGwmLv2a4l3HmTW5c/dsW7NvVE23ojrSrthlUwus4sP22itOfAvwR Y4aUq4zBmJKrK75vOgtzavOIA/viEL1JfBV1NKao6YIvkZNuMsAdv1MuaIu1P1Cz69 OJTXHfOp/FaP7di+biTTklm+hwaP7sWDa0XtaGQj5LarxV09L6bFEhq1qxPVVRXi+/ IhHSr9wDoQ2ag== Date: Thu, 22 Feb 2024 16:08:11 -0600 From: Bjorn Helgaas To: Vidya Sagar Cc: bhelgaas@google.com, rafael@kernel.org, lenb@kernel.org, will@kernel.org, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, frowand.list@gmail.com, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, treding@nvidia.com, jonathanh@nvidia.com, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Subject: Re: [PATCH V3] PCI: Add support for preserving boot configuration Message-ID: <20240222220811.GA31251@bhelgaas> 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: <17a29a7e-b013-4568-8e21-9647969b6b6d@nvidia.com> On Fri, Feb 23, 2024 at 02:48:24AM +0530, Vidya Sagar wrote: > On 22-02-2024 22:36, Bjorn Helgaas wrote: > > On Thu, Feb 22, 2024 at 06:11:10PM +0530, Vidya Sagar wrote: > > > + if (&host_bridge->dev) { > > Checking &host_bridge->dev doesn't seem like the right way to > > determine whether this is an ACPI host bridge. BTW, I think this condition is *always* true, since it's testing the address of a member of a struct. > Honestly, I couldn't find a clear way to differentiate between an > ACPI based host bridge and a DT based host bridge. Hence, the > current code tries to get the information using both ways and since > a system can only be either ACPI or DT based, but one at a time, > preserve_config will be set only once (assuming the system wants it > to be set). Let me know if there is a better approach for this? I'm not sure ACPI and DT will always be mutually exclusive; I think we're headed toward some combinations, e.g., https://lore.kernel.org/linux-pci/1692120000-46900-1-git-send-email-lizhi.hou@amd.com/ But I think "if (ACPI_HANDLE(&host_bridge->dev))" would work. Bjorn