From: Manivannan Sadhasivam <mani@kernel.org>
To: Johan Hovold <johan+linaro@kernel.org>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Andy Gross" <agross@kernel.org>,
"Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konrad.dybcio@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Nirmal Patel" <nirmal.patel@linux.intel.com>,
"Jonathan Derrick" <jonathan.derrick@linux.dev>,
linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
"Michael Bottini" <michael.a.bottini@linux.intel.com>,
"David E . Box" <david.e.box@linux.intel.com>
Subject: Re: [PATCH 2/6] PCI: vmd: Fix deadlock when enabling ASPM
Date: Fri, 17 Nov 2023 15:58:29 +0530 [thread overview]
Message-ID: <20231117102829.GK250770@thinkpad> (raw)
In-Reply-To: <20231114135553.32301-3-johan+linaro@kernel.org>
On Tue, Nov 14, 2023 at 02:55:49PM +0100, Johan Hovold wrote:
> The vmd_pm_enable_quirk() helper is called from pci_walk_bus() during
> probe to enable ASPM for controllers with VMD_FEAT_BIOS_PM_QUIRK set.
>
> Since pci_walk_bus() already holds a pci_bus_sem read lock, use the new
> locked helper to enable link states in order to avoid a potential
> deadlock (e.g. in case someone takes a write lock before reacquiring
> the read lock).
>
> Fixes: f492edb40b54 ("PCI: vmd: Add quirk to configure PCIe ASPM and LTR")
> Cc: stable@vger.kernel.org # 6.3
> Cc: Michael Bottini <michael.a.bottini@linux.intel.com>
> Cc: David E. Box <david.e.box@linux.intel.com>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> ---
> drivers/pci/controller/vmd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index 94ba61fe1c44..0452cbc362ee 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -751,7 +751,7 @@ static int vmd_pm_enable_quirk(struct pci_dev *pdev, void *userdata)
> if (!(features & VMD_FEAT_BIOS_PM_QUIRK))
> return 0;
>
> - pci_enable_link_state(pdev, PCIE_LINK_STATE_ALL);
> + pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL);
>
> pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_LTR);
> if (!pos)
> --
> 2.41.0
>
--
மணிவண்ணன் சதாசிவம்
prev parent reply other threads:[~2023-11-17 10:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231114135553.32301-1-johan+linaro@kernel.org>
2023-11-14 13:55 ` [PATCH 1/6] PCI/ASPM: Add locked helper for enabling link state Johan Hovold
2023-11-15 14:26 ` kernel test robot
2023-11-15 16:06 ` Johan Hovold
2023-11-17 10:27 ` Manivannan Sadhasivam
2023-11-17 10:30 ` Johan Hovold
2023-11-17 10:50 ` Manivannan Sadhasivam
2023-11-17 10:28 ` Manivannan Sadhasivam
2023-11-18 0:00 ` David E. Box
2023-11-20 8:33 ` Johan Hovold
2023-11-14 13:55 ` [PATCH 2/6] PCI: vmd: Fix deadlock when enabling ASPM Johan Hovold
2023-11-17 10:28 ` Manivannan Sadhasivam [this message]
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=20231117102829.GK250770@thinkpad \
--to=mani@kernel.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=david.e.box@linux.intel.com \
--cc=johan+linaro@kernel.org \
--cc=jonathan.derrick@linux.dev \
--cc=konrad.dybcio@linaro.org \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=michael.a.bottini@linux.intel.com \
--cc=nirmal.patel@linux.intel.com \
--cc=robh@kernel.org \
--cc=stable@vger.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