Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Dan Williams <dan.j.williams@intel.com>, bhelgaas@google.com
Cc: linux-pci@vger.kernel.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2 2/3] PCI: Warn on missing cfg_access_lock during secondary bus reset
Date: Fri, 31 May 2024 11:06:08 -0700	[thread overview]
Message-ID: <5de124d1-8c53-45c7-ab4b-17282c56d1b1@intel.com> (raw)
In-Reply-To: <171711746953.1628941.4692125082286867825.stgit@dwillia2-xfh.jf.intel.com>



On 5/30/24 6:04 PM, Dan Williams wrote:
> The recent adventure with adding lockdep tracking for cfg_access_lock,
> while it yielded many false positives [1], it did catch a true positive in
> the pci_reset_bus() path [2].
> 
> So, while lockdep is difficult to deploy, open coding a check that
> cfg_access_lock is held during the reset is feasible.
> 
> While this does not offer a full backtrace, it should be sufficient to
> implicate the caller of pci_bridge_secondary_bus_reset() as a path that
> needs investigation.
> 
> Link: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_134186v1/shard-dg2-1/igt@device_reset@unbind-reset-rebind.html [1]
> Link: http://lore.kernel.org/r/cfb50601-5d2a-4676-a958-1bd3f1b06654@intel.com [2]
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/pci/pci.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 35fb1f17a589..8df32a3a0979 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -4883,6 +4883,9 @@ void __weak pcibios_reset_secondary_bus(struct pci_dev *dev)
>   */
>  int pci_bridge_secondary_bus_reset(struct pci_dev *dev)
>  {
> +	if (!dev->block_cfg_access)
> +		pci_warn_once(dev, "unlocked secondary bus reset via: %pS\n",
> +			      __builtin_return_address(0));
>  	pcibios_reset_secondary_bus(dev);
>  
>  	return pci_bridge_wait_for_secondary_bus(dev, "bus reset");
> 

  reply	other threads:[~2024-05-31 18:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31  1:04 [PATCH v2 0/3] PCI: Revert / replace the cfg_access_lock lockdep mechanism Dan Williams
2024-05-31  1:04 ` [PATCH v2 1/3] PCI: Revert " Dan Williams
2024-05-31 18:05   ` Dave Jiang
2024-06-04  8:03   ` Kalle Valo
2024-06-04 17:11     ` Bjorn Helgaas
2024-06-06 10:04       ` Leon Romanovsky
2024-05-31  1:04 ` [PATCH v2 2/3] PCI: Warn on missing cfg_access_lock during secondary bus reset Dan Williams
2024-05-31 18:06   ` Dave Jiang [this message]
2024-05-31  1:04 ` [PATCH v2 3/3] PCI: Add missing bridge lock to pci_bus_lock() Dan Williams
2024-05-31 18:07   ` Dave Jiang
2024-06-28 19:25   ` Keith Busch
2024-05-31 21:31 ` [PATCH v2 0/3] PCI: Revert / replace the cfg_access_lock lockdep mechanism Bjorn Helgaas
2024-06-03 19:49 ` Hans de Goede
2024-06-03 20:37   ` Bjorn Helgaas

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=5de124d1-8c53-45c7-ab4b-17282c56d1b1@intel.com \
    --to=dave.jiang@intel.com \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-pci@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