No description
Find a file
Dan Williams 81c68e218a PCI: Add missing bridge lock to pci_bus_lock()
[ Upstream commit a4e772898f ]

One of the true positives that the cfg_access_lock lockdep effort
identified is this sequence:

  WARNING: CPU: 14 PID: 1 at drivers/pci/pci.c:4886 pci_bridge_secondary_bus_reset+0x5d/0x70
  RIP: 0010:pci_bridge_secondary_bus_reset+0x5d/0x70
  Call Trace:
   <TASK>
   ? __warn+0x8c/0x190
   ? pci_bridge_secondary_bus_reset+0x5d/0x70
   ? report_bug+0x1f8/0x200
   ? handle_bug+0x3c/0x70
   ? exc_invalid_op+0x18/0x70
   ? asm_exc_invalid_op+0x1a/0x20
   ? pci_bridge_secondary_bus_reset+0x5d/0x70
   pci_reset_bus+0x1d8/0x270
   vmd_probe+0x778/0xa10
   pci_device_probe+0x95/0x120

Where pci_reset_bus() users are triggering unlocked secondary bus resets.
Ironically pci_bus_reset(), several calls down from pci_reset_bus(), uses
pci_bus_lock() before issuing the reset which locks everything *but* the
bridge itself.

For the same motivation as adding:

  bridge = pci_upstream_bridge(dev);
  if (bridge)
    pci_dev_lock(bridge);

to pci_reset_function() for the "bus" and "cxl_bus" reset cases, add
pci_dev_lock() for @bus->self to pci_bus_lock().

Link: https://lore.kernel.org/r/171711747501.1628941.15217746952476635316.stgit@dwillia2-xfh.jf.intel.com
Reported-by: Imre Deak <imre.deak@intel.com>
Closes: http://lore.kernel.org/r/6657833b3b5ae_14984b29437@dwillia2-xfh.jf.intel.com.notmuch
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
[bhelgaas: squash in recursive locking deadlock fix from Keith Busch:
https://lore.kernel.org/r/20240711193650.701834-1-kbusch@meta.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Kalle Valo <kvalo@kernel.org>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:13:03 +02:00
arch riscv: set trap vector earlier 2024-09-12 11:13:02 +02:00
block block: don't call bio_uninit from bio_endio 2024-09-12 11:12:59 +02:00
certs kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
crypto crypto: ecc - Fix off-by-one missing to clear most significant digit 2024-09-08 07:56:40 +02:00
Documentation cgroup/cpuset: Delay setting of CS_CPU_EXCLUSIVE until valid partition 2024-09-12 11:12:50 +02:00
drivers PCI: Add missing bridge lock to pci_bus_lock() 2024-09-12 11:13:03 +02:00
fs btrfs: don't BUG_ON() when 0 reference count at btrfs_lookup_extent_info() 2024-09-12 11:13:02 +02:00
include bpf, net: Fix a potential race in do_sock_getsockopt() 2024-09-12 11:12:57 +02:00
init rust: fix the default format for CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT 2024-08-29 17:35:52 +02:00
io_uring io_uring/kbuf: return correct iovec count from classic buffer peek 2024-09-04 13:30:11 +02:00
ipc Mainly singleton patches, documented in their respective changelogs. 2024-05-19 14:02:03 -07:00
kernel smp: Add missing destroy_work_on_stack() call in smp_call_on_cpu() 2024-09-12 11:13:02 +02:00
lib maple_tree: remove rcu_read_lock() from mt_validate() 2024-09-12 11:12:46 +02:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm userfaultfd: fix checks for huge PMDs 2024-09-12 11:12:47 +02:00
net ethtool: fail closed if we can't get max channel used in indirection tables 2024-09-12 11:13:02 +02:00
rust rust: kbuild: fix export of bss symbols 2024-09-12 11:12:55 +02:00
samples tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
scripts scripts: fix gfp-translate after ___GFP_*_BITS conversion to an enum 2024-09-12 11:12:56 +02:00
security smack: unix sockets: fix accept()ed socket label 2024-09-12 11:12:50 +02:00
sound ASoc: TAS2781: replace beXX_to_cpup with get_unaligned_beXX for potentially broken alignment 2024-09-12 11:13:00 +02:00
tools libbpf: Add NULL checks to bpf_object__{prev_map,next_map} 2024-09-12 11:13:00 +02:00
usr kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
virt KVM fixes for 6.10 2024-06-21 08:03:55 -04:00
.clang-format clang-format: Update with v6.7-rc4's for_each macro list 2023-12-08 23:54:38 +01:00
.cocciconfig
.editorconfig .editorconfig: remove trim_trailing_whitespace option 2024-06-13 16:47:52 +02:00
.get_maintainer.ignore Add Jeff Kirsher to .get_maintainer.ignore 2024-03-08 11:36:54 +00:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore kbuild: create a list of all built DTB files 2024-02-19 18:20:39 +09:00
.mailmap MAINTAINERS: mailmap: update Lorenzo Stoakes's email address 2024-07-06 11:39:51 -07:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING
CREDITS pci-v6.10-fixes-2 2024-07-05 12:33:00 -07:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig
MAINTAINERS Fixes for the I2C testunit, the Renesas R-Car driver and some 2024-07-13 16:34:22 -07:00
Makefile Linux 6.10.9 2024-09-08 07:56:41 +02:00
README README: Fix spelling 2024-03-18 03:36:32 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.