From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>, Len Brown <lenb@kernel.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, mika.westerberg@linux.intel.com,
Hsin-Yi Wang <hsinyi@chromium.org>
Subject: Re: [PATCH v5 1/4] PCI/portdrv: Make use of pci_dev::bridge_d3 for checking the D3 possibility
Date: Mon, 5 Aug 2024 18:54:42 +0530 [thread overview]
Message-ID: <20240805132442.GA7274@thinkpad> (raw)
In-Reply-To: <Zq08i2i_ETHsJiKW@wunner.de>
On Fri, Aug 02, 2024 at 10:07:39PM +0200, Lukas Wunner wrote:
> On Fri, Aug 02, 2024 at 01:19:24PM +0200, Rafael J. Wysocki wrote:
> > On Fri, Aug 2, 2024 at 11:49AM Lukas Wunner <lukas@wunner.de> wrote:
> > >
> > > On Fri, Aug 02, 2024 at 11:25:00AM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> > > > PCI core is already caching the value of pci_bridge_d3_possible() in
> > > > pci_dev::bridge_d3 during pci_pm_init(). Since the value is not going to
> > > > change,
> >
> > Is that really the case?
> >
> > Have you seen pci_bridge_d3_update()?
>
> Okay the value may change at runtime, e.g. due to user space
> manipulating d3cold_allowed in sysfs.
>
The last part of the commit message is wrong, but pci_bridge_d3_update() is
already updating pci_dev::bridge_d3. And pci_bridge_d3_possible() is not making
use of any checks that could change dynamically IIUC. So what is wrong in using
pci_dev::bridge_d3?
Even more, if the client drivers have changed the state of pci_dev::bridge_d3
during runtime, then pci_bridge_d3_possible() won't catch that. Or is there a
reason to not do so purposefully?
> > > I don't know if there was a reason to call pci_bridge_d3_possible()
> > > (instead of using the cached value) on probe, remove and shutdown.
> > >
> > > The change is probably safe but it would still be good to get some
> > > positive test results with Thunderbolt laptops etc to raise the
> > > confidence.
> >
> > If I'm not mistaken, the change is not correct.
>
> You're right. Because the value may change, different code paths
> may be chosen on probe, remove and shutdown. Sorry for missing that.
>
Again, pci_bridge_d3_possible() is not making use of values that could change
dynamically.
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-08-05 13:24 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 5:54 [PATCH v5 0/4] PCI: Allow D3Hot for PCI bridges in Devicetree based platforms Manivannan Sadhasivam via B4 Relay
2024-08-02 5:55 ` [PATCH v5 1/4] PCI/portdrv: Make use of pci_dev::bridge_d3 for checking the D3 possibility Manivannan Sadhasivam via B4 Relay
2024-08-02 9:49 ` Lukas Wunner
2024-08-02 11:19 ` Rafael J. Wysocki
2024-08-02 20:07 ` Lukas Wunner
2024-08-05 13:24 ` Manivannan Sadhasivam [this message]
2024-08-06 6:46 ` Lukas Wunner
2024-08-06 11:48 ` Manivannan Sadhasivam
2024-08-02 5:55 ` [PATCH v5 2/4] PCI: Rename pci_bridge_d3_possible() to pci_bridge_d3_allowed() Manivannan Sadhasivam via B4 Relay
2024-08-03 11:03 ` kernel test robot
2024-08-05 13:26 ` Manivannan Sadhasivam
2024-08-02 5:55 ` [PATCH v5 3/4] PCI: Decouple D3Hot and D3Cold handling for bridges Manivannan Sadhasivam via B4 Relay
2024-08-19 12:44 ` Oliver Neukum
2024-08-20 6:00 ` Manivannan Sadhasivam
2024-08-20 23:45 ` Bjorn Helgaas
2024-08-29 6:10 ` Manivannan Sadhasivam
2024-08-21 1:45 ` Bjorn Helgaas
2024-08-28 15:52 ` Manivannan Sadhasivam
2024-08-28 21:07 ` Bjorn Helgaas
2024-08-29 5:22 ` Manivannan Sadhasivam
2024-11-21 18:54 ` Brian Norris
2024-08-02 5:55 ` [PATCH v5 4/4] PCI: Allow PCI bridges to go to D3Hot on all Devicetree based platforms Manivannan Sadhasivam via B4 Relay
2024-08-02 10:13 ` Lukas Wunner
2024-08-05 13:35 ` Manivannan Sadhasivam
2024-08-06 6:53 ` Lukas Wunner
2024-08-06 12:41 ` Manivannan Sadhasivam
2024-08-06 13:02 ` Lukas Wunner
2024-08-06 14:39 ` Manivannan Sadhasivam
2024-08-06 20:20 ` Lukas Wunner
2024-08-19 15:34 ` Manivannan Sadhasivam
2024-08-06 20:58 ` Hsin-Yi Wang
2024-11-21 18:53 ` Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240805132442.GA7274@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=bhelgaas@google.com \
--cc=hsinyi@chromium.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox