From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97CA5C197A0 for ; Fri, 17 Nov 2023 10:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235741AbjKQK2v (ORCPT ); Fri, 17 Nov 2023 05:28:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235751AbjKQK2o (ORCPT ); Fri, 17 Nov 2023 05:28:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F4581730; Fri, 17 Nov 2023 02:28:38 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C41CFC433C7; Fri, 17 Nov 2023 10:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700216918; bh=QCversjCzEUGiXNxUKjPeJo0oZmncZLcMGfj60HFPUo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k4SzAmwx3eBIGuT+BHJFjLtE1f6T52HZLA5AJsUqVvtMEwIvFzcTw32U/to3g9NBD /lTV9NBlQW7hqkM4qAEnC4ZPGF7/qouW4Y6CtN1T8WaWO8KmZhpG6ge25aI4LRDlTs GSLFNnxtMBO3HedT+Tgk0Ms0R1ImLv9XBM2IdHG947Y3kNRYNsvfaJDRLMkfjvHyQO OBatj4+Arc1qR/Uzue09On/rhS7f2W8yGKhKf3r7WA3wBaxFNMGv0v6MzhCDnHxilY 5k/uFcVrK0LaEPjpIEMp63Q+IHkOt8Bk1YqXgWw0BdvbMS9WfIgjA6MgN3wIaVWkiH 7moQrx0glT4XQ== Date: Fri, 17 Nov 2023 15:58:29 +0530 From: Manivannan Sadhasivam To: Johan Hovold Cc: Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Nirmal Patel , Jonathan Derrick , linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Michael Bottini , "David E . Box" Subject: Re: [PATCH 2/6] PCI: vmd: Fix deadlock when enabling ASPM Message-ID: <20231117102829.GK250770@thinkpad> References: <20231114135553.32301-1-johan+linaro@kernel.org> <20231114135553.32301-3-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231114135553.32301-3-johan+linaro@kernel.org> Precedence: bulk List-ID: X-Mailing-List: stable@vger.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 > Cc: David E. Box > Signed-off-by: Johan Hovold Reviewed-by: Manivannan Sadhasivam - 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 > -- மணிவண்ணன் சதாசிவம்