]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: Document hybrid devres hazards
authorPhilipp Stanner <pstanner@redhat.com>
Thu, 13 Jun 2024 11:50:19 +0000 (13:50 +0200)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Wed, 10 Jul 2024 04:20:01 +0000 (04:20 +0000)
commit81fcf28e74a3ffda67a6896cd38843d80bc9ec68
treeca35c8bd117969580ad614d67421148ee1114b37
parentd47bde708086c77b1ceeb7643e600089f63dd03b
PCI: Document hybrid devres hazards

These functions:

  pci_request_region()
  pci_request_regions()
  pci_request_regions_exclusive()
  pci_request_selected_regions()
  pci_request_selected_regions_exclusive()
  pci_intx()

are "hybrid" functions that are managed if pcim_enable_device() has been
called, but unmanaged otherwise.

This is confusing and has already caused a bug (in 8558de401b5f
("drm/vboxvideo: use managed pci functions")) because users believe all PCI
functions, such as pci_iomap_range(), can become managed that way, which is
not the case.

Add comments to the relevant functions' docstrings that warn users about
this behavior.

Link: https://lore.kernel.org/r/20240613115032.29098-7-pstanner@redhat.com
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/iomap.c
drivers/pci/pci.c