- Sep 23, 2024
-
-
Dave Jiang authored
Create a kernel documentation to describe how the CXL shared upstream link bandwidth is calculated. Suggested-by:
Dan Williams <dan.j.williams@intel.com> Reviewed-by:
Alison Schofield <alison.schofield@intel.com> Acked-by:
Dan Williams <dan.j.williams@intel.com> Link: https://patch.msgid.link/20240904001316.1688225-4-dave.jiang@intel.com Signed-off-by:
Dave Jiang <dave.jiang@intel.com>
-
- Sep 08, 2024
-
-
Takashi Sakamoto authored
In packet-per-buffer mode for isochronous context of 1394 OHCI, software can schedule hardIRQ to the buffer in which the content of isochronous packet is processed. The actual behaviour is different between isochronous receive (IR) and transmit (IT) contexts in respect to isochronous cycle in which the hardIRQ occurs. In IR context, the hardIRQ occurs when the buffer is filled actually by the content of received packet. If there are any isochronous cycles in which the packet transmission is skipped, it is postponed to generate the hardIRQ in respect to the isochronous cycle. In IT context, software can schedule the content of packet every isochronous cycle including skipping, therefore the hardIRQ occurs in the isochronous cycle to which the software scheduled. ALSA firewire stack uses the packet-per-buffer mode for both IR/IT contexts. To process time stamp per packet (or per sample in some cases) steadily for media clock recovery against unexpected transmission skips, it uses an IT context to operate all of isochronous contexts by calls of fw_iso_context_flush_completions() in the bottom-half of hardIRQ for the IT context. Although it looks well to handle all of isochronous contexts in a single bottom-half context, it relatively takes longer time. In the future code integration (not yet), it is possible to apply parallelism method to process these context. In the case, it is useful to allow unit drivers to schedule work items to process these isochronous contexts. As a preparation, this commit exposes fw_iso_context_schedule_flush_completions() as a kernel API available by unit drivers. It is renamed from fw_iso_context_queue_work() since it is a counter part of fw_iso_context_flush_completions(). Link: https://lore.kernel.org/r/20240908040549.75304-2-o-takashi@sakamocchi.jp Signed-off-by:
Takashi Sakamoto <o-takashi@sakamocchi.jp>
-
- Sep 05, 2024
-
-
Avri Altman authored
Add missing documentation for mmc_test. Reviewed-by:
Christian Loehle <christian.loehle@arm.com> Signed-off-by:
Avri Altman <avri.altman@wdc.com> Link: https://lore.kernel.org/r/20240903133855.3589845-1-avri.altman@wdc.com Signed-off-by:
Ulf Hansson <ulf.hansson@linaro.org>
-
- Sep 01, 2024
-
-
Wolfram Sang authored
"i2c-adapter" class entries are deprecated since 2009. Switch to the proper location. Reported-by:
Heiner Kallweit <hkallweit1@gmail.com> Closes: https://lore.kernel.org/r/80c4a898-5867-4162-ac85-bdf7c7c68746@gmail.com Fixes: 25930707 ("ipmi: Add SMBus interface driver (SSIF)") Signed-off-by:
Wolfram Sang <wsa+renesas@sang-engineering.com> Message-Id: <20240901090211.3797-2-wsa+renesas@sang-engineering.com> Signed-off-by:
Corey Minyard <corey@minyard.net>
-
- Aug 27, 2024
-
-
Arkadiusz Kubalewski authored
Implement and document new pin attributes for providing Embedded SYNC capabilities to the DPLL subsystem users through a netlink pin-get do/dump messages. Allow the user to set Embedded SYNC frequency with pin-set do netlink message. Reviewed-by:
Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by:
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Reviewed-by:
Jiri Pirko <jiri@nvidia.com> Link: https://patch.msgid.link/20240822222513.255179-2-arkadiusz.kubalewski@intel.com Signed-off-by:
Jakub Kicinski <kuba@kernel.org>
-
- Aug 26, 2024
-
-
Thorsten Scherer authored
Add missing 'devices' folder in the /sys/bus/iio path. Signed-off-by:
Thorsten Scherer <t.scherer@eckelmann.de> Signed-off-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240805120357.21135-1-t.scherer@eckelmann.de
-
- Aug 24, 2024
-
-
Laurent Pinchart authored
The graph walk API has been deprecated in commit eac564de ("media: mc: entity: Add entity iterator for media_pipeline") in favour of pipelien iterators, but the MC documentation hasn't been updated accordingly. It still documents the deprecated API as the only option. Fix it by dropping the deprecated function, and documenting the new API. Signed-off-by:
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20240822212445.2037-5-laurent.pinchart+renesas@ideasonboard.com Signed-off-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-
- Aug 23, 2024
-
-
Rafael J. Wysocki authored
There are no more callers of thermal_zone_bind_cooling_device() and thermal_zone_unbind_cooling_device(), so drop them along with all of the corresponding headers, code and documentation. Moreover, because the .bind() and .unbind() thermal zone callbacks would only be used when the above functions, respectively, were called, drop them as well along with all of the code related to them. Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Zhang Rui <rui.zhang@intel.com> Acked-by:
Huisong Li <lihuisong@huawei.com> Reviewed-by:
Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://patch.msgid.link/4251116.1IzOArtZ34@rjwysocki.net
-
- Aug 22, 2024
-
-
Bartosz Golaszewski authored
Describe what the subsystem does, how the consumers and providers work and add API reference generated from kerneldocs. Acked-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240821100818.13763-1-brgl@bgdev.pl Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Aug 16, 2024
-
-
Philipp Stanner authored
The documentation states that pcim_enable_device() will make "all PCI ops" managed. This is totally false, only a small subset of PCI functions become managed that way. Implicating otherwise has caused at least one bug so far, namely in commit 8558de40 ("drm/vboxvideo: use managed pci functions"). Change the function summary so the functions dangerous behavior becomes obvious. Signed-off-by:
Philipp Stanner <pstanner@redhat.com> Acked-by:
Bjorn Helgaas <bhelgaas@google.com> Signed-off-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240809095248.14220-2-pstanner@redhat.com
-
- Aug 02, 2024
-
-
Rafael J. Wysocki authored
There are no more users of get_thermal_instance(), so drop it. While at it, replace get_instance() returning a pointer to struct thermal_instance with thermal_instance_present() returning a bool which is more straightforward. No functional impact. Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Lukasz Luba <lukasz.luba@arm.com> Link: https://patch.msgid.link/2014591.usQuhbGJ8B@rjwysocki.net [ rjw: Dropped get_thermal_instance() documentation ] Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-
Rafael J. Wysocki authored
The thermal sysfs API document is outdated. One of the problems with it is that is still documents thermal_zone_device_register() which does not exit any more and it does not reflect the current thermal zone operations definition. Replace the thermal_zone_device_register() description in it with a thermal_zone_device_register_with_trips() description, including an update of the thermal zone operations list. Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by:
Lukasz Luba <lukasz.luba@arm.com> Link: https://patch.msgid.link/2767845.mvXUDI8C0e@rjwysocki.net
-
- Jul 16, 2024
-
-
Marc Ferland authored
Small typo. The device name in the example should be "foo-i2c.0" and not "foo-i2c.o". Signed-off-by:
Marc Ferland <marc.ferland@sonatest.com> Signed-off-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240709183919.3337131-1-marc.ferland@sonatest.com
-
- Jul 12, 2024
-
-
Eric Biggers authored
Update the documented struct platform_driver to match the code. Signed-off-by:
Eric Biggers <ebiggers@google.com> Signed-off-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240711200421.11428-1-ebiggers@kernel.org
-
- Jul 10, 2024
-
-
Vincent Whitchurch authored
Add a software PWM which toggles a GPIO from a high-resolution timer. This will naturally not be as accurate or as efficient as a hardware PWM, but it is useful in some cases. I have for example used it for evaluating LED brightness handling (via leds-pwm) on a board where the LED was just hooked up to a GPIO, and for a simple verification of the timer frequency on another platform. Since high-resolution timers are used, sleeping GPIO chips are not supported and are rejected in the probe function. Signed-off-by:
Vincent Whitchurch <vincent.whitchurch@axis.com> Co-developed-by:
Stefan Wahren <wahrenst@gmx.net> Signed-off-by:
Stefan Wahren <wahrenst@gmx.net> Co-developed-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Andy Shevchenko <andy@kernel.org> Signed-off-by:
Linus Walleij <linus.walleij@linaro.org> Reviewed-by:
Dhruva Gole <d-gole@ti.com> Link: https://lore.kernel.org/r/20240604-pwm-gpio-v7-2-6b67cf60db92@linaro.org Signed-off-by:
Uwe Kleine-König <ukleinek@kernel.org>
-
- Jul 09, 2024
-
-
Richard Genoud authored
The http://processors.wiki.ti.com EOL in january 2021 The old documentation is still available through the wayback machine. Signed-off-by:
Richard Genoud <richard.genoud@bootlin.com> Signed-off-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240618151938.1827064-1-richard.genoud@bootlin.com
-
- Jul 08, 2024
-
-
Dan Williams authored
Provide a survey of the work-in-progress maturity (implementation status) of various aspects of the CXL subsystem. Clarify that in addition to ongoing upkeep relative to specification updates, there are some long running themes in the driver that respond to the discovery of new corner cases (bugs) and new use cases (feature extensions). The primary audience is distribution maintainers, but it also serves as a guide for kernel developers to understand what aspects of the CXL subsystem need more help. It is a landing page to document ongoing progress, and a guide to discern exposure to work-in-progress features. Reviewed-by:
Adam Manzanares <a.manzanares@samsung.com> Signed-off-by:
Dan Williams <dan.j.williams@intel.com> Reviewed-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by:
Ira Weiny <ira.weiny@intel.com> Reviewed-by:
Alison Schofield <alison.schofield@intel.com> Link: https://patch.msgid.link/172005486862.2048248.6668794717827294862.stgit@dwillia2-xfh.jf.intel.com Signed-off-by:
Dave Jiang <dave.jiang@intel.com>
-
- Jul 03, 2024
-
-
Dmitry Torokhov authored
libps2 has been using kerneldoc to document its methods, but was not actually plugged into driver-api. Signed-off-by:
Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by:
Randy Dunlap <rdunlap@infradead.org> Tested-by:
Randy Dunlap <rdunlap@infradead.org> Signed-off-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/ZoMQhkyUQYi1Bx4t@google.com
-
- Jun 25, 2024
-
-
Yao Xingtao authored
Add the missing files into cxl driver api and fix the compile warning. Suggested-by:
Dan Williams <dan.j.williams@intel.com> Suggested-by:
Alison Schofield <alison.schofield@intel.com> Signed-off-by:
Yao Xingtao <yaoxt.fnst@fujitsu.com> Reviewed-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://patch.msgid.link/20240614084755.59503-3-yaoxt.fnst@fujitsu.com Signed-off-by:
Dave Jiang <dave.jiang@intel.com>
-
- Jun 24, 2024
-
-
Devarsh Thakkar authored
Enable documentation for v4l2-jpeg header related helper functions which are useful for parsing jpeg files while decoding or creating jpeg headers while encoding. Signed-off-by:
Devarsh Thakkar <devarsht@ti.com> Signed-off-by:
Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
- Jun 22, 2024
-
-
David Lechner authored
This adds a new helper function devm_spi_optimize_message() that automatically registers spi_unoptimize_message() to be called when the device is removed. Signed-off-by:
David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240621-devm_spi_optimize_message-v1-2-3f9dcba6e95e@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
David Lechner authored
A few SPI devm_* helpers were missing from the devres documentation. This patch adds them. Signed-off-by:
David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20240621-devm_spi_optimize_message-v1-1-3f9dcba6e95e@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- Jun 21, 2024
-
-
Paul Cercueil authored
Document the dmaengine_prep_peripheral_dma_vec() API function, the device_prep_peripheral_dma_vec() backend function, and the dma_vec struct. Signed-off-by:
Paul Cercueil <paul@crapouillou.net> Reviewed-by:
Bagas Sanjaya <bagasdotme@gmail.com> Link: https://lore.kernel.org/r/20240620122726.41232-8-paul@crapouillou.net Signed-off-by:
Vinod Koul <vkoul@kernel.org>
-
- Jun 11, 2024
-
-
Andrew Davis authored
GPIO chips should be added with driver-private data associated with the chip. If none is needed, NULL can be used. All users already do this except one, fix that here. With no more users of the base gpiochip_add() we can drop this function so no more users show up later. Signed-off-by:
Andrew Davis <afd@ti.com> Acked-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20240610135313.142571-1-afd@ti.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 27, 2024
-
-
Andy Shevchenko authored
In order to discourage people to use old and legacy GPIO APIs remove the respective documentation completely. It also helps further cleanups of the legacy GPIO API leftovers, which is ongoing task. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Hu Haowen <2023002089@link.tyut.edu.cn> Link: https://lore.kernel.org/r/20240508101703.830066-1-andriy.shevchenko@linux.intel.com Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- May 10, 2024
-
-
foryun.ma authored
remove an extra semicolon from the example code Signed-off-by:
foryun.ma <foryun.ma@jaguarmicro.com> Link: https://lore.kernel.org/r/20240510003735.2766-1-foryun.ma@jaguarmicro.com Signed-off-by:
Alex Williamson <alex.williamson@redhat.com>
-
- May 06, 2024
-
-
Yosry Ahmed authored
These knobs offer more fine-grained control to userspace than needed and directly expose/influence kernel implementation; remove them. For disabling same_filled handling, there is no logical reason to refuse storing same-filled pages more efficiently and opt for compression. Scanning pages for patterns may be an argument, but the page contents will be read into the CPU cache anyway during compression. Also, removing the same_filled handling code does not move the needle significantly in terms of performance anyway [1]. For disabling non_same_filled handling, it was added when the compressed pages in zswap were not being properly charged to memcgs, as workloads could escape the accounting with compression [2]. This is no longer the case after commit f4840ccf ("zswap: memcg accounting"), and using zswap without compression does not make much sense. [1]https://lore.kernel.org/lkml/CAJD7tkaySFP2hBQw4pnZHJJwe3bMdjJ1t9VC2VJd=khn1_TXvA@mail.gmail.com/ [2]https://lore.kernel.org/lkml/19d5cdee-2868-41bd-83d5-6da75d72e940@maciej.szmigiero.name/ [yosryahmed@google.com: remove same_filled_pages from docs] Link: https://lkml.kernel.org/r/ZhxFVggdyvCo79jc@google.com Link: https://lkml.kernel.org/r/20240413022407.785696-5-yosryahmed@google.com Signed-off-by:
Yosry Ahmed <yosryahmed@google.com> Acked-by:
Johannes Weiner <hannes@cmpxchg.org> Reviewed-by:
Nhat Pham <nphamcs@gmail.com> Reviewed-by:
Chengming Zhou <chengming.zhou@linux.dev> Cc: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org>
-
- May 03, 2024
-
-
Arnd Bergmann authored
This is one of the hackiest Alpha machines, and the only one without PCI support. Removing this allows cleaning up code in eise and tty drivers in addition to the architecture code. Acked-by:
Paul E. McKenney <paulmck@kernel.org> Acked-by:
Matt Turner <mattst88@gmail.com> Signed-off-by:
Arnd Bergmann <arnd@arndb.de>
-
David Lechner authored
A common use case for regulators is to supply a reference voltage to an analog input or output device. This adds a new devres API to get, enable, and get the voltage in a single call. This allows eliminating boilerplate code in drivers that use reference supplies in this way. Signed-off-by:
David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20240429-regulator-get-enable-get-votlage-v2-1-b1f11ab766c1@baylibre.com Signed-off-by:
Mark Brown <broonie@kernel.org>
-
- May 02, 2024
-
-
Remington Brasga authored
Fix spelling and grammar in Docs descriptions Signed-off-by:
Remington Brasga <rbrasga@uci.edu> Reviewed-by:
Randy Dunlap <rdunlap@infradead.org> Signed-off-by:
Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20240429225527.2329-1-rbrasga@uci.edu
-
- Apr 29, 2024
-
-
Bingbu Cao authored
Add a documentation for an overview of IPU6 hardware and describe the main the components of IPU6 driver. Signed-off-by:
Bingbu Cao <bingbu.cao@intel.com> Signed-off-by:
Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
- Apr 23, 2024
-
-
Marco Pagani authored
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: 0fa20cdf ("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>
-
- Apr 18, 2024
-
-
Baruch Siach authored
Use 'supported' instead of 'support'. 'support' makes no sense in this context. Signed-off-by:
Baruch Siach <baruch@tkos.co.il> Link: https://patchwork.freedesktop.org/patch/msgid/505484b83fedebce3c65b10b076b34df075074b6.1713329988.git.baruch@tkos.co.il Signed-off-by:
Christian König <christian.koenig@amd.com>
-
- Apr 12, 2024
-
-
Andy Shevchenko authored
Code blocks are indented with two spaces. If there's a leading TAB, the syntax highlighting might be broken in some editors. To prevent that, unify all code blocks by using spaces instead of leading TAB(s). Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> [Bartosz: tweaked the commit message] Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Apr 09, 2024
-
-
Randy Dunlap authored
- Change http to https where the latter works - Drop references to I2O (Intelligent I/O) - Use lore.kernel.org instead of marc.info for email links - Update the location of the scsi_debug documentation Signed-off-by:
Randy Dunlap <rdunlap@infradead.org> Link: https://lore.kernel.org/r/20240408025425.18778-3-rdunlap@infradead.org Signed-off-by:
Martin K. Petersen <martin.petersen@oracle.com>
-
- Apr 08, 2024
-
-
Krzysztof Kozlowski authored
Modules registering driver with register_virtio_driver() might forget to set .owner field. i2c-virtio.c for example has it missing. The field is used by some other kernel parts for reference counting (try_module_get()), so it is expected that drivers will set it. Solve the problem by moving this task away from the drivers to the core virtio code, just like we did for platform_driver in commit 9447057e ("platform_device: use a macro instead of platform_driver_register"). Fixes: 3cfc8838 ("i2c: virtio: add a virtio i2c frontend driver") Cc: "Jie Deng" <jie.deng@intel.com> Signed-off-by:
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Message-Id: <20240331-module-owner-virtio-v2-1-98f04bfaf46a@linaro.org> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
- Apr 03, 2024
-
-
Andy Shevchenko authored
No more users. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Yanteng Si <siyanteng@loongson.cn> Signed-off-by:
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-
- Apr 02, 2024
-
-
Jerry Snitselaar authored
This cleans up the following issues I ran into when trying to use the scripts and commands in the iaa-crypto.rst document. - Fix incorrect arguments being passed to accel-config config-wq. - Replace --device_name with --driver-name. - Replace --driver_name with --driver-name. - Replace --size with --wq-size. - Add missing --priority argument. - Add missing accel-config config-engine command after the config-wq commands. - Fix wq name passed to accel-config config-wq. - Add rmmod/modprobe of iaa_crypto to script that disables, then enables all devices and workqueues to avoid enable-wq failing with -EEXIST when trying to register to compression algorithm. - Fix device name in cases where iaa was used instead of iax. Cc: Jonathan Corbet <corbet@lwn.net> Cc: linux-crypto@vger.kernel.org Cc: linux-doc@vger.kernel.org Signed-off-by:
Jerry Snitselaar <jsnitsel@redhat.com> Reviewed-by:
Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by:
Herbert Xu <herbert@gondor.apana.org.au>
-
Tom Zanussi authored
Currently, the wq_stats output also includes the global stats, while the individual global stats are also available as separate debugfs files. Since these are all read-only, there's really no reason to have them as separate files, especially since we already display them as global stats in the wq_stats. It makes more sense to just add a separate global_stats file to display those, and remove them from the wq_stats, as well as removing the individual stats files. Signed-off-by:
Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by:
Herbert Xu <herbert@gondor.apana.org.au>
-
- Mar 31, 2024
-
-
Marco Pagani authored
The current implementation of the fpga bridge 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 bridge if the parent device does not have a driver. To address this problem, add a module owner pointer to the fpga_bridge struct and use it to take the module's refcount. Modify the function for registering a bridge to take an additional owner module parameter and rename it to avoid conflicts. Use the old function name for a helper macro that automatically sets the module that registers the bridge as the owner. This ensures compatibility with existing low-level control modules and reduces the chances of registering a bridge without setting the owner. Also, update the documentation to keep it consistent with the new interface for registering an fpga bridge. Other changes: opportunistically move put_device() from __fpga_bridge_get() to fpga_bridge_get() and of_fpga_bridge_get() to improve code clarity since the bridge device is taken in these functions. Fixes: 21aeda95 ("fpga: add fpga bridge framework") 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/20240322171839.233864-1-marpagan@redhat.com Signed-off-by:
Xu Yilun <yilun.xu@linux.intel.com>
-