summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2026-03-09platform/surface: surfacepro3_button: Convert to a platform driverRafael J. Wysocki1-35/+32
In all cases in which a struct acpi_driver is used for binding a driver to an ACPI device object, a corresponding platform device is created by the ACPI core and that device is regarded as a proper representation of underlying hardware. Accordingly, a struct platform_driver should be used by driver code to bind to that device. There are multiple reasons why drivers should not bind directly to ACPI device objects [1]. Overall, it is better to bind drivers to platform devices than to their ACPI companions, so convert the Surface Pro 3 button ACPI driver to a platform one. After this change, the subordinate input device and wakeup source class device will be registered under the platform device used for driver binding instead of its ACPI companion. While this is not expected to alter functionality, it changes sysfs layout and so it will be visible to user space. Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3207406.CbtlEUcBR6@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09platform/surface: surfacepro3_button: Register ACPI notify handlerRafael J. Wysocki1-2/+13
To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/1881356.TLkxdtWsSY@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09platform/surface: surfacepro3_button: Drop wakeup source on removeRafael J. Wysocki1-0/+1
The wakeup source added by device_init_wakeup() in surface_button_add() needs to be dropped during driver removal, so update the driver to do that. Fixes: 19351f340765 ("platform/x86: surfacepro3: Support for wakeup from suspend-to-idle") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/4368848.1IzOArtZ34@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09dm log: fix out-of-bounds write due to region_count overflowJunrui Luo1-1/+5
The local variable region_count in create_log_context() is declared as unsigned int (32-bit), but dm_sector_div_up() returns sector_t (64-bit). When a device-mapper target has a sufficiently large ti->len with a small region_size, the division result can exceed UINT_MAX. The truncated value is then used to calculate bitset_size, causing clean_bits, sync_bits, and recovering_bits to be allocated far smaller than needed for the actual number of regions. Subsequent log operations (log_set_bit, log_clear_bit, log_test_bit) use region indices derived from the full untruncated region space, causing out-of-bounds writes to kernel heap memory allocated by vmalloc. This can be reproduced by creating a mirror target whose region_count overflows 32 bits: dmsetup create bigzero --table '0 8589934594 zero' dmsetup create mymirror --table '0 8589934594 mirror \ core 2 2 nosync 2 /dev/mapper/bigzero 0 \ /dev/mapper/bigzero 0' The status output confirms the truncation (sync_count=1 instead of 4294967297, because 0x100000001 was truncated to 1): $ dmsetup status mymirror 0 8589934594 mirror 2 254:1 254:1 1/4294967297 ... This leads to a kernel crash in core_in_sync: BUG: scheduling while atomic: (udev-worker)/9150/0x00000000 RIP: 0010:core_in_sync+0x14/0x30 [dm_log] CR2: 0000000000000008 Fixing recursive fault but reboot is needed! Fix by widening the local region_count to sector_t and adding an explicit overflow check before the value is assigned to lc->region_count. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Yuhao Jiang <danisjiang@gmail.com> Signed-off-by: Junrui Luo <moonafterrain@outlook.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2026-03-09dm cache metadata: fix memory leak on metadata abort retryMing-Hung Tsai1-5/+8
When failing to acquire the root_lock in dm_cache_metadata_abort because the block_manager is read-only, the temporary block_manager created outside the root_lock is not properly released, causing a memory leak. Reproduce steps: This can be reproduced by reloading a new table while the metadata is read-only. While the second call to dm_cache_metadata_abort is caused by lack of support for table preload in dm-cache, mentioned in commit 9b1cc9f251af ("dm cache: share cache-metadata object across inactive and active DM tables"), it exposes the memory leak in dm_cache_metadata_abort when the function is called multiple times. Specifically, dm-cache fails to sync the new cache object's mode during preresume, creating the reproducer condition. This issue could also occur through concurrent metadata_operation_failed calls due to races in cache mode updates, but the table preload scenario below provides a reliable reproducer. 1. Create a cache device with some faulty trailing metadata blocks dmsetup create cmeta <<EOF 0 200 linear /dev/sdc 0 200 7992 error EOF dmsetup create cdata --table "0 131072 linear /dev/sdc 8192" dmsetup create corig --table "0 262144 linear /dev/sdc 262144" dd if=/dev/zero of=/dev/mapper/cmeta bs=4k count=1 oflag=direct dmsetup create cache --table "0 131072 cache /dev/mapper/cmeta \ /dev/mapper/cdata /dev/mapper/corig 128 1 writethrough smq 0" 2. Suspend and resume the cache to start a new metadata transaction and trigger metadata io errors on the next metadata commit. dmsetup suspend cache dmsetup resume cache 3. Write to the cache device to update metadata fio --filename=/dev/mapper/cache --name test --rw=randwrite --bs=4k \ --randrepeat=0 --direct=1 --size 64k 4. Preload the same table dmsetup reload cache --table "$(dmsetup table cache)" 5. Resume the new table. This triggers the memory leak. dmsetup suspend cache dmsetup resume cache kmemleak logs: <snip> unreferenced object 0xffff8880080c2010 (size 16): comm "dmsetup", pid 132, jiffies 4294982580 hex dump (first 16 bytes): 00 38 b9 07 80 88 ff ff 6a 6b 6b 6b 6b 6b 6b a5 ... backtrace (crc 3118f31c): kmemleak_alloc+0x28/0x40 __kmalloc_cache_noprof+0x3d9/0x510 dm_block_manager_create+0x51/0x140 dm_cache_metadata_abort+0x85/0x320 metadata_operation_failed+0x103/0x1e0 cache_preresume+0xacd/0xe70 dm_table_resume_targets+0xd3/0x320 __dm_resume+0x1b/0xf0 dm_resume+0x127/0x170 <snip> Fixes: 352b837a5541 ("dm cache: Fix ABBA deadlock between shrink_slab and dm_cache_metadata_abort") Signed-off-by: Ming-Hung Tsai <mtsai@redhat.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2026-03-09block: factor out a bio_integrity_action helperChristoph Hellwig1-2/+4
Split the logic to see if a bio needs integrity metadata from bio_integrity_prep into a reusable helper than can be called from file system code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anuj Gupta <anuj20.g@samsung.com> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Tested-by: Anuj Gupta <anuj20.g@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-03-09platform/x86: intel/smartconnect: Convert ACPI driver to a platform oneRafael J. Wysocki1-11/+12
In all cases in which a struct acpi_driver is used for binding a driver to an ACPI device object, a corresponding platform device is created by the ACPI core and that device is regarded as a proper representation of underlying hardware. Accordingly, a struct platform_driver should be used by driver code to bind to that device. There are multiple reasons why drivers should not bind directly to ACPI device objects [1]. Overall, it is better to bind drivers to platform devices than to their ACPI companions, so convert the Intel Smart Connect disabling ACPI driver to a platform one. While this is not expected to alter functionality, it changes sysfs layout and so it will be visible to user space. Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/24282289.6Emhk5qWAg@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09platform/x86: intel/rst: Convert ACPI driver to a platform oneRafael J. Wysocki1-10/+13
In all cases in which a struct acpi_driver is used for binding a driver to an ACPI device object, a corresponding platform device is created by the ACPI core and that device is regarded as a proper representation of underlying hardware. Accordingly, a struct platform_driver should be used by driver code to bind to that device. There are multiple reasons why drivers should not bind directly to ACPI device objects [1]. Overall, it is better to bind drivers to platform devices than to their ACPI companions, so convert the Intel Rapid Start Technology (rst) ACPI driver to a platform one. While this is not expected to alter functionality, it changes sysfs layout and so it will be visible to user space. Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3599223.QJadu78ljV@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09ublk: don't clear GD_SUPPRESS_PART_SCAN for unprivileged daemonsMing Lei1-1/+3
When UBLK_F_NO_AUTO_PART_SCAN is set, GD_SUPPRESS_PART_SCAN is cleared unconditionally, including for unprivileged daemons. Keep it consistent with the code block for setting GD_SUPPRESS_PART_SCAN by not clearing it for unprivileged daemons. In reality this isn't a problem because ioctl(BLKRRPART) requires CAP_SYS_ADMIN, but it is more reliable to not clear the bit. Cc: Alexander Atanasov <alex@zazolabs.com> Fixes: 8443e2087e70 ("ublk: add UBLK_F_NO_AUTO_PART_SCAN feature flag") Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-03-09platform/x86: eeepc-laptop: Convert ACPI driver to a platform oneRafael J. Wysocki1-15/+17
In all cases in which a struct acpi_driver is used for binding a driver to an ACPI device object, a corresponding platform device is created by the ACPI core and that device is regarded as a proper representation of underlying hardware. Accordingly, a struct platform_driver should be used by driver code to bind to that device. There are multiple reasons why drivers should not bind directly to ACPI device objects [1]. Overall, it is better to bind drivers to platform devices than to their ACPI companions, so convert the EEEPC laptop ACPI driver to a platform one. While this is not expected to alter functionality, it changes sysfs layout and so it will be visible to user space. Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Denis Benato <denis.benato@linux.dev> Link: https://patch.msgid.link/3329436.5fSG56mABF@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09platform/x86: eeepc-laptop: Register ACPI notify handler directlyRafael J. Wysocki1-4/+11
To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Denis Benato <denis.benato@linux.dev> Link: https://patch.msgid.link/3681264.iIbC2pHGDl@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09mmc: tifm_sd: Use min3() to simplify tifm_sd_transfer_data()Thorsten Blum1-3/+1
Use min3() to simplify tifm_sd_transfer_data(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mmc: sdio: Use min3() to simplify sdio_set_block_size()Thorsten Blum1-4/+2
Use min3() to simplify sdio_set_block_size(). Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mmc: renesas_sdhi_sys_dmac: Convert to DEFINE_RUNTIME_DEV_PM_OPS()Geert Uytterhoeven1-8/+4
Convert the Renesas SDHI SD/SDIO controller driver using SYS-DMAC from an open-coded dev_pm_ops structure to DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr(). This simplifies the code, and reduces kernel size in case CONFIG_PM is disabled. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mmc: loongson2: Add Loongson-2K0300 SD/SDIO/eMMC controller driverBinbin Zhou1-0/+27
This patch describes the two MMC controllers of the Loongson-2K0300 SoC, one providing an eMMC interface and the other exporting an SD/SDIO interface. Its hardware design is similar to that of the Loongson-2K2000, but it suffers from hardware defects such as missing CMD48 interrupts. Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mmc: loongson2: Gathering all SoCs private data togetherBinbin Zhou1-16/+16
More Loongson SoCs will be added, gathering all SoC private data (`loongson2_mmc_pdata`) together to make the code clearer. No functional change intended. Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09platform/x86: acer-wireless: Convert ACPI driver to a platform oneRafael J. Wysocki1-19/+22
In all cases in which a struct acpi_driver is used for binding a driver to an ACPI device object, a corresponding platform device is created by the ACPI core and that device is regarded as a proper representation of underlying hardware. Accordingly, a struct platform_driver should be used by driver code to bind to that device. There are multiple reasons why drivers should not bind directly to ACPI device objects [1]. Overall, it is better to bind drivers to platform devices than to their ACPI companions, so convert the Acer wireless ACPI driver to a platform one. After this change, the subordinate input device will be registered under the platform device used for driver binding instead of its ACPI companion. While this is not expected to alter functionality, it changes sysfs layout and so it will be visible to user space. Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2032103.PYKUYFuaPT@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09platform/x86: acer-wireless: Register ACPI notify handler directlyRafael J. Wysocki1-3/+16
To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/10810967.nUPlyArG6x@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-03-09mmc: sdhci-of-bst: Fix memory leak in sdhci_bst_alloc_bounce_buffer()Felix Gu1-1/+3
In sdhci_bst_alloc_bounce_buffer(), if dma_alloc_coherent() fails, the function immediately returns -ENOMEM without releasing the reserved memory, which results in a memory leak. Add the missing of_reserved_mem_device_release() call before returning -ENOMEM to properly clean up the reserved memory. Fixes: 695824f45629 ("mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mmc: Merge the immutable mux branch into nextUlf Hansson6-86/+195
The mux branch contains updates to the mux core along with some corresponding changes for a couple of consumer drivers, including an mmc driver. Let's merge it into the next branch to get it tested and queued for the next release. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mmc: host: renesas_sdhi_core: support selecting an optional muxJosua Mayer1-0/+6
Some hardware designs route data or control signals through a mux to support multiple devices on a single sdhi controller. In particular SolidRun RZ/G2L/G2LC/V2L System on Module use a mux for switching between soldered eMMC and an optional microSD on a carrier board, e.g. for development or provisioning. SD/SDIO/eMMC are not well suited for runtime switching between different cards, however boot-time selection is possible and useful - in particular considering dt overlays. Add support for an optional SD/SDIO/eMMC mux defined in dt, and select it during probe. Similar functionality already exists in other places, e.g. i2c-omap. Signed-off-by: Josua Mayer <josua@solid-run.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mux: add visible config symbol to enable multiplexer subsystemJosua Mayer1-2/+15
The multiplexer subsystem was initially designed to be completely hidden, relying on consumers to "select MULTIPLEXER" explicitly. Drivers implementing multiplexers depend on this hidden symbol. This prevents users from manually enabling both the mux core and any of the multiplexer drivers. All multiplexer drivers in drivers/mux/ can operate standalone without a consumer. This is particularly useful in a device-tree, where a default state can be set through the idle-state property. Over time, several drivers have added "select MULTIPLEXER" dependencies, some of which require a mux and some consider it optional. v7.0-rc1 shows 15 such occurrences in Kconfig files, in a variety of subsystems. The natural step forward to allow enabling mux core and drivers would be adding a prompt and help text to the existing symbol. This violates the general Kbuild advice to avoid selecting visible symbols for all existing consumers of the mux core. Add the new config symbol MUX_CORE with a prompt and help text as a wrapper for users to enable manually. This avoids existing consumers automatically selecting a visible symbol. Change the MULTIPLEXER symbol from tristate to bool. This avoids complex dependencies if users were to attempt a configuration where the mux is a module but one of its consumers is built-in, as well as difficulties keeping the state of visible and invisible symbols in sync. Further convert the "menu ... depends on ..." structure to "if ... menu ... endmenu endif". These are functionally equivalent, but the new structure is more efficient and can support future source statements within the conditional block. Signed-off-by: Josua Mayer <josua@solid-run.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09i2c: omap: switch to new generic helper for getting selected mux-stateJosua Mayer1-19/+5
Multiplexer subsystem has added generic helper functions for getting an already selected mux-state object. Replace existing logic in probe with the equivalent helper function. There is a functional difference in that the mux is now automatically deselected on release, replacing the explicit mux_state_deselect call. This change is only compile-tested. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Andreas Kemnade <andreas@kemnade.info> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Josua Mayer <josua@solid-run.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09phy: renesas: rcar-gen3-usb2: drop helper getting optional mux-stateJosua Mayer1-28/+2
Multiplexer subsystem has now added helpers for getting managed optional mux-state. Switch to the new devm_mux_state_get_optional_selected helper. This change is only compile-tested. Signed-off-by: Josua Mayer <josua@solid-run.com> Acked-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09phy: can-transceiver: drop temporary helper getting optional mux-stateJosua Mayer1-11/+1
Multiplexer subsystem has now added helpers for getting managed optional mux-state. Switch to the new devm_mux_state_get_optional helper. This change is only compile-tested. Acked-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Josua Mayer <josua@solid-run.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09mux: Add helper functions for getting optional and selected mux-stateJosua Mayer1-27/+167
In-tree phy-can-transceiver and phy_rcar_gen3_usb2 have already implemented local versions of devm_mux_state_get_optional. The omap-i2c driver gets and selects an optional mux in its probe function without using any helper. Add new helper functions covering both aforementioned use-cases: - mux_control_get_optional: Get a mux-control if specified in dt, return NULL otherwise. - devm_mux_state_get_optional: Get a mux-state if specified in dt, return NULL otherwise. - devm_mux_state_get_selected: Get and select a mux-state specified in dt, return error otherwise. - devm_mux_state_get_optional_selected: Get and select a mux-state if specified in dt, return error or NULL. Existing mux_get helper function is changed to take an extra argument indicating whether the mux is optional. In this case no error is printed, and NULL returned in case of ENOENT. Calling code is adapted to handle NULL return case, and to pass optional argument as required. To support automatic deselect for _selected helper, a new structure is created storing an exit pointer similar to clock core which is called on release. To facilitate code sharing between optional/mandatory/selected helpers, a new internal helper function is added to handle quiet (optional) and verbose (mandatory) errors, as well as storing the correct callback for devm release: __devm_mux_state_get Due to this structure devm_mux_state_get_*_selected can no longer print a useful error message when select fails. Instead callers should print errors where needed. Commit e153fdea9db04 ("phy: can-transceiver: Re-instate "mux-states" property presence check") noted that "mux_get() always prints an error message in case of an error, including when the property is not present, confusing the user." The first error message covers the case that a mux name is not matched in dt. The second error message is based on of_parse_phandle_with_args return value. In optional case no error is printed and NULL is returned. This ensures that the new helper functions will not confuse the user either. With the addition of optional helper functions it became clear that drivers should compile and link even if CONFIG_MULTIPLEXER was not enabled. Add stubs for all symbols exported by mux core. Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Josua Mayer <josua@solid-run.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09phy: renesas: rcar-gen3-usb2: rename local mux helper to avoid conflictJosua Mayer1-2/+2
Rename the temporary devm_mux_state_get_optional function to avoid conflict with upcoming implementation in multiplexer subsystem. Signed-off-by: Josua Mayer <josua@solid-run.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09phy: can-transceiver: rename temporary helper function to avoid conflictJosua Mayer1-2/+2
Rename the temporary devm_mux_state_get_optional function to avoid conflict with upcoming implementation in multiplexer subsystem. Signed-off-by: Josua Mayer <josua@solid-run.com> Acked-by: Vinod Koul <vkoul@kernel.org> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2026-03-09spi: atcspi200: Fix double-free in atcspi_configure_dma()Felix Gu1-21/+7
The driver uses devm_dma_request_chan() which registers automatic cleanup via devm_add_action_or_reset(). Calling dma_release_channel() manually on the RX channel when TX channel request fails causes a double-free when the devm cleanup runs. Remove the unnecessary manual cleanup and simplify the error handling since devm will properly release channels on probe failure or driver detach. Fixes: 34e3815ea459 ("spi: atcspi200: Add ATCSPI200 SPI controller driver") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Link: https://patch.msgid.link/20260305-atcspi2000-v1-1-eafe08dcca60@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09spi: amlogic: spifc-a4: Fix DMA mapping error handlingFelix Gu1-3/+2
Fix three bugs in aml_sfc_dma_buffer_setup() error paths: 1. Unnecessary goto: When the first DMA mapping (sfc->daddr) fails, nothing needs cleanup. Use direct return instead of goto. 2. Double-unmap bug: When info DMA mapping failed, the code would unmap sfc->daddr inline, then fall through to out_map_data which would unmap it again, causing a double-unmap. 3. Wrong unmap size: The out_map_info label used datalen instead of infolen when unmapping sfc->iaddr, which could lead to incorrect DMA sync behavior. Fixes: 4670db6f32e9 ("spi: amlogic: add driver for Amlogic SPI Flash Controller") Signed-off-by: Felix Gu <ustc.gu@gmail.com> Link: https://patch.msgid.link/20260306-spifc-a4-v1-1-f22c9965f64a@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-09fbdev: defio: Move pageref array to struct fb_deferred_io_stateThomas Zimmermann1-28/+27
The pageref array stores all pageref structures for a device's defio helpers. Move it into struct fb_deferred_io_state to not expose it to drivers. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09fbdev: defio: Move variable state into struct fb_deferred_io_stateThomas Zimmermann1-15/+22
Move variable fields from struct fb_deferred_io into struct fb_deferred_io_state. These fields are internal to the defio code and should not be exposed to drivers. At some later point, struct fb_defered_io might become const in all defio code. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09fbdev: defio: Keep module reference from VMAsThomas Zimmermann1-0/+6
Acquire a module reference on each mmap and VMA open; hold it until the kernel closes the VMA. Protects against unloading the module while user space still has a mapping of the graphics memory. The VMA page-fault handling would then call into undefined code. This situation can happen if the underlying device has been unplugged and the driver has been unloaded. It would then be possible to trigger the bug by unloading the fbdev core module. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_infoThomas Zimmermann1-36/+142
Hold state of deferred I/O in struct fb_deferred_io_state. Allocate an instance as part of initializing deferred I/O and remove it only after the final mapping has been closed. If the fb_info and the contained deferred I/O meanwhile goes away, clear struct fb_deferred_io_state.info to invalidate the mapping. Any access will then result in a SIGBUS signal. Fixes a long-standing problem, where a device hot-unplug happens while user space still has an active mapping of the graphics memory. The hot- unplug frees the instance of struct fb_info. Accessing the memory will operate on undefined state. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 60b59beafba8 ("fbdev: mm: Deferred IO support") Cc: Helge Deller <deller@gmx.de> Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: stable@vger.kernel.org # v2.6.22+ Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09fbdev: macfb: Replace deprecated strcpy with strscpyThorsten Blum1-19/+19
strcpy() has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the safer strscpy(). No functional changes. Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1] Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09fbdev: tdfxfb: Make the VGA register initialisation a bit more obviousDaniel Palmer1-54/+55
For a while I was trying to get this working on m68k, for some reason the card doesn't display anything if it's own video BIOS didn't run.. Anyhow, I spent a long time looking up what each of these offsets were to work out what the code is configuring and eventually replaced them with the human readable defines in video/vga.h. Functionally there is no change but maybe it makes it a bit easier to look at for the next person that finds themselves in here. Tested on a real voodoo 3 on x86_64. Signed-off-by: Daniel Palmer <daniel@thingy.jp> Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09fbdev: wmt_ge_rops: use devm_platform_ioremap_resource()Amin GATTOUT1-14/+4
Replace the open-coded platform_get_resource() + ioremap() pair with devm_platform_ioremap_resource(), which requests the memory region and maps it in a single call, with automatic cleanup on device removal. Also reset regbase to NULL in remove() so that the single-instance guard in probe() works correctly if the device is re-probed. Signed-off-by: Amin GATTOUT <amin.gattout@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09fbdev: goldfishfb: use devm_platform_ioremap_resource()Amin GATTOUT1-11/+3
Replace the open-coded platform_get_resource() + ioremap() pair with devm_platform_ioremap_resource(), which requests the memory region and maps it in a single call, with automatic cleanup on device removal. Signed-off-by: Amin GATTOUT <amin.gattout@gmail.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Helge Deller <deller@gmx.de>
2026-03-09i2c: tiny-usb: drop redundant device referenceJohan Hovold1-10/+3
Driver core holds a reference to the USB interface and its parent USB device while the interface is bound to a driver and there is no need to take additional references unless the structures are needed after disconnect. Drop the redundant device reference to reduce cargo culting, make it easier to spot drivers where an extra reference is needed, and reduce the risk of memory leaks when drivers fail to release it. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2026-03-09i2c: diolan-u2c: drop redundant device referenceJohan Hovold1-9/+3
Driver core holds a reference to the USB interface and its parent USB device while the interface is bound to a driver and there is no need to take additional references unless the structures are needed after disconnect. Drop the redundant device reference to reduce cargo culting, make it easier to spot drivers where an extra reference is needed, and reduce the risk of memory leaks when drivers fail to release it. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2026-03-09i2c: robotfuzz-osif: drop redundant device referenceJohan Hovold1-3/+1
Driver core holds a reference to the USB interface and its parent USB device while the interface is bound to a driver and there is no need to take additional references unless the structures are needed after disconnect. Drop the redundant device reference to reduce cargo culting, make it easier to spot drivers where an extra reference is needed, and reduce the risk of memory leaks when drivers fail to release it. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2026-03-09thunderbolt: Fix property read in nhi_wake_supported()Konrad Dybcio1-1/+1
device_property_read_foo() returns 0 on success and only then modifies 'val'. Currently, val is left uninitialized if the aforementioned function returns non-zero, making nhi_wake_supported() return true almost always (random != 0) if the property is not present in device firmware. Invert the check to make it make sense. Fixes: 3cdb9446a117 ("thunderbolt: Add support for Intel Ice Lake") Cc: stable@vger.kernel.org Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
2026-03-09dmaengine: idxd: fix possible wrong descriptor completion in llist_abort_desc()Tuo Li1-1/+1
At the end of this function, d is the traversal cursor of flist, but the code completes found instead. This can lead to issues such as NULL pointer dereferences, double completion, or descriptor leaks. Fix this by completing d instead of found in the final list_for_each_entry_safe() loop. Fixes: aa8d18becc0c ("dmaengine: idxd: add callback support for iaa crypto") Signed-off-by: Tuo Li <islituo@gmail.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/20260106032428.162445-1-islituo@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: sh: rz_dmac: add RZ/{T2H,N2H} supportCosmin Tanislav1-0/+7
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs use a completely different ICU unit compared to RZ/V2H, which requires a separate implementation. Add support for them. RZ/N2H will use RZ/T2H as a fallback. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260105114445.878262-5-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: sh: rz_dmac: make register_dma_req() chip-specificCosmin Tanislav1-29/+36
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs use a completely different ICU unit compared to RZ/V2H, which requires a separate implementation. To prepare for adding support for these SoCs, add a chip-specific structure and put a pointer to the rzv2h_icu_register_dma_req() function in the .register_dma_req field of the chip-specific structure to allow for other implementations. Do the same for the default request value, RZV2H_ICU_DMAC_REQ_NO_DEFAULT, and place it into .dma_req_no_default. While at it, factor out the logic that calls .register_dma_req() or rz_dmac_set_dmars_register() into a separate function to remove some code duplication. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260105114445.878262-3-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: sh: rz_dmac: make error interrupt optionalCosmin Tanislav1-10/+9
The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs do not have an error interrupt for the DMACs, and the current driver implementation does not make much use of it. To prepare for adding support for these SoCs, do not error out if the error interrupt is missing. Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260105114445.878262-2-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: fsl-qdma: Use dev_err_probe() to simplify codeFrank Li1-28/+19
Use dev_err_probe() to simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-13-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: fsl-edma: Use dev_err_probe() to simplify codeFrank Li1-27/+20
Use dev_err_probe() to simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-12-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: fsl-edma: Use managed API dmaenginem_async_device_register()Frank Li1-6/+2
Use managed API dmaenginem_async_device_register() and devm_of_dma_controller_register() to simple code. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-11-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
2026-03-09dmaengine: imx-sdma: Use dev_err_probe() to simplify codeFrank Li1-8/+5
Use dev_err_probe() to simplify code. No functional change. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260225-mxsdma-module-v3-10-8f798b13baa6@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>