linux/Documentation/driver-api
Marco Pagani 75a001914a fpga: region: add owner module and take its refcount
[ Upstream commit b7c0e1ecee ]

The current implementation of the fpga region assumes that the low-level
module registers a driver for the parent device and uses its owner pointer
to take the module's refcount. This approach is problematic since it can
lead to a null pointer dereference while attempting to get the region
during programming if the parent device does not have a driver.

To address this problem, add a module owner pointer to the fpga_region
struct and use it to take the module's refcount. Modify the functions for
registering a region to take an additional owner module parameter and
rename them to avoid conflicts. Use the old function names for helper
macros that automatically set the module that registers the region as the
owner. This ensures compatibility with existing low-level control modules
and reduces the chances of registering a region without setting the owner.

Also, update the documentation to keep it consistent with the new interface
for registering an fpga region.

Fixes: 0fa20cdfcc ("fpga: fpga-region: device tree control for FPGA")
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Xu Yilun <yilun.xu@intel.com>
Reviewed-by: Russ Weight <russ.weight@linux.dev>
Signed-off-by: Marco Pagani <marpagan@redhat.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240419083601.77403-1-marpagan@redhat.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:03:39 +02:00
..
80211 docs: net: 80211: reduce docs build time 2020-10-08 10:41:49 +02:00
acpi Documentation: ACPI: fix error script name 2021-06-17 13:21:48 -06:00
backlight
cxl Documentation: cxl: remove dangling kernel-doc reference 2022-08-05 08:41:02 -07:00
dmaengine dmaengine: remove DMA_MEMCPY_SG once again 2022-06-27 12:01:40 +05:30
driver-model Documentation: devres: add missing I2C helper 2022-11-02 21:16:38 +01:00
early-userspace Documentation: Fix intiramfs script name 2021-07-18 23:48:14 +09:00
firmware Driver core / kernfs changes for 6.0-rc1 2022-08-04 11:31:20 -07:00
fpga fpga: region: add owner module and take its refcount 2024-06-12 11:03:39 +02:00
gpio This was a moderately busy cycle for documentation, but nothing all that 2022-08-02 19:24:24 -07:00
hte tegra194-hte.rst: fix reference to its binding 2022-07-07 13:10:00 -06:00
i3c docs: driver-api: i3c: Replace HTTP links with HTTPS ones 2020-07-13 09:32:36 -06:00
iio docs: iio: mark "repeat" sysfs attribute as optional 2021-03-11 20:47:08 +00:00
md
media media: mc: entity: Rewrite media_pipeline_start() 2022-09-24 09:19:42 +02:00
mei docs updates for v5.10-rc1 2020-10-16 15:02:21 -07:00
memory-devices Replace HTTP links with HTTPS ones: Documentation/driver-api 2020-06-26 11:09:04 -06:00
mmc docs: mmc: update maintainer name and URL 2021-10-28 11:54:54 +02:00
mtd Documentation / MTD: Rename the intel-spi driver 2022-02-14 12:53:10 +00:00
nfc nfc: constify nfc_llc_ops 2021-07-25 09:21:21 +01:00
nvdimm nvdimm/blk: Fix title level 2022-03-23 17:52:33 -07:00
pci PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg() 2024-01-25 15:27:44 -08:00
phy
pldmfw Add pldmfw library for PLDM firmware update 2020-07-28 17:07:06 -07:00
pm docs: devices.rst: better reference documentation docs 2021-06-17 13:24:36 -06:00
rapidio Replace HTTP links with HTTPS ones: Documentation/driver-api 2020-06-26 11:09:04 -06:00
serial tty: serial: document uart_get_console() 2022-07-28 10:37:42 +02:00
soundwire docs: soundwire: fix some identation at stream.rst 2020-09-10 10:49:29 -06:00
surface_aggregator platform/surface: aggregator: Allow notifiers to avoid communication on unregistering 2022-06-13 17:25:07 +02:00
thermal docs: driver-api/thermal/intel_dptf: Use copyright symbol 2022-04-05 09:46:06 -06:00
tty Documentation: tty: n_gsm, use power of ReST 2022-04-14 18:24:24 +02:00
usb Docs: usb: update writesize, copy_from_user, usb_fill_bulk_urb, usb_submit_urb 2021-11-17 14:54:58 +01:00
xilinx firmware: xilinx: Remove zynqmp_pm_get_eemi_ops() in IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) 2021-03-01 12:52:07 +01:00
aperture.rst drm: Implement DRM aperture helpers under video/ 2022-06-27 11:07:55 +02:00
auxiliary_bus.rst Documentation/auxiliary_bus: Move the text into the code 2021-12-03 16:41:50 +01:00
basics.rst overflow: Fix kern-doc markup for functions 2022-10-25 14:57:42 -07:00
clk.rst
component.rst
connector.rst net/connector: Add const qualifier to cb_id 2020-12-16 11:06:49 -08:00
console.rst
dcdbas.rst
devfreq.rst
device_link.rst docs: device_link.rst: remove duplicated kernel-doc include 2020-10-15 07:49:42 +02:00
device-io.rst dma-buf-map: Rename to iosys-map 2022-02-07 16:35:35 -08:00
dma-buf.rst dma-buf: add dma_fence_unwrap v2 2022-03-25 14:18:28 +01:00
edac.rst
eisa.rst
firewire.rst Documentation: fix firewire.rst ABI file path error 2022-01-20 17:01:32 -07:00
frame-buffer.rst
generic-counter.rst counter: Update documentation for new counter registration functions 2021-12-30 17:44:06 +01:00
hsi.rst
i2c.rst
index.rst drm: Implement DRM aperture helpers under video/ 2022-06-27 11:07:55 +02:00
infiniband.rst
infrastructure.rst docs: infrastructure.rst: exclude device_link_state from device.h 2020-10-15 07:49:46 +02:00
input.rst Input: remove input_polled_dev implementation 2020-12-02 12:35:14 -08:00
interconnect.rst
io_ordering.rst
io-mapping.rst io-mapping: Provide iomap_local variant 2020-11-24 14:42:09 +01:00
ioctl.rst docs: driver-api: avoid using ReST :doc:foo markup 2021-06-17 13:24:37 -06:00
ipmb.rst
ipmi.rst ipmi: Add docs for the IPMI IPMB driver 2021-10-05 06:54:17 -05:00
isa.rst Remove duplicate words inside documentation 2022-09-27 13:21:43 -06:00
isapnp.rst
libata.rst libata: Improve ATA queued command allocation 2022-04-11 09:27:44 +09:00
mailbox.rst docs: move mailbox.txt to driver-api and rename it 2020-06-26 11:33:38 -06:00
men-chameleon-bus.rst Documentation: document dma device use for mcb 2021-01-11 13:26:13 -07:00
message-based.rst
misc_devices.rst
miscellaneous.rst docs/driver-api/miscellaneous: Remove kernel-doc of serial_core.c 2022-11-09 14:56:05 +01:00
mtdnand.rst docs: mtd: Avoid htmldocs warnings 2020-12-10 22:37:32 +01:00
ntb.rst Documentation/driver-api: ntb: drop doubled word 2020-07-13 11:18:17 -06:00
nvmem.rst doc: nvmem: Update example 2022-02-21 18:00:30 +01:00
parport-lowlevel.rst
pin-control.rst docs/pinctrl: fix the reference to the u300 platform 2021-05-28 02:59:40 +02:00
pps.rst
ptp.rst docs: ptp.rst: add support for Renesas (IDT) ClockMatrix 2020-07-17 10:25:21 -07:00
pwm.rst pwm: core: Get rid of unused devm_of_pwm_get() 2022-09-19 06:17:05 -07:00
regulator.rst docs: get rid of :c:type explicit declarations for structs 2020-10-15 07:49:40 +02:00
reset.rst docs: add a reset controller chapter to the driver API docs 2020-12-08 10:48:04 -07:00
rfkill.rst
s390-drivers.rst
scsi.rst
slimbus.rst
sm501.rst
spi.rst spi: Update reference to struct spi_controller 2022-12-31 13:32:06 +01:00
switchtec.rst
sync_file.rst
target.rst docs: scsi: target.rst: remove iSCSI transport class kernel-doc markup 2020-10-15 07:49:42 +02:00
uio-howto.rst Documentation/driver-api: uio-howto: drop doubled word 2020-07-10 14:58:01 +02:00
vfio-mediated-device.rst vfio/mdev: consolidate all the description sysfs into the core code 2022-10-04 12:06:58 -06:00
vfio-pci-device-specific-driver-acceptance.rst vfio-pci: Provide reviewers and acceptance criteria for variant drivers 2022-03-17 09:57:11 -06:00
vfio.rst vfio: Introduce a vfio_uninit_group_dev() API call 2021-08-11 09:50:10 -06:00
vme.rst vme: move back to staging 2022-06-10 15:38:14 +02:00
w1.rst
xillybus.rst Documentation/driver-api: xillybus: drop doubled word 2020-07-10 14:58:01 +02:00
zorro.rst