summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus
AgeCommit message (Collapse)Author
9 daysMerge tag 'staging-7.4-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big set of staging driver updates for 7.4-rc1. The huge majority of changes in here were to the rtl8723bs driver, which ended up being deleted entirely through the wifi driver tree, so while the work here was nice to have done to get experience by people, the overall goal was achieved in that we have a solid working and sane driver in the real part of the tree now. Other than that, included in here are: - some greybus driver removal of broken drivers that no one ever used - minor coding style cleanups for other staging drivers All of these have been in linux-next with no reported issues, other than the merge conflict of the driver being removed, but that's an obvious one to resolve :)" * tag 'staging-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (145 commits) staging: rtl8723bs: remove unnecessary parentheses rtl8723bs: Remove redundant macro in basic_types.h staging: rtl8723bs: remove spaces before tabs in hal_com_reg.h staging: greybus: Align function arguments staging: greybus: uart: fix argument alignment staging: greybus: Remove unused header declaration to_fw_mgmt_connection staging: most: fix typo in driver_usage.txt staging: vme_user: avoid iterator variable access outside list loop staging: greybus: Remove unused function 'to_fw_mgmt_connection' staging: greybus: replace PTR_ERR() with %pe in error messages staging: octeon: fix misuse of kernel-doc comment staging: nvec: fix GPIO descriptor documentation staging: fbtft: update outdated struct fbtft_ops comment greybus: Discard pm_runtime_put_autosuspend() return value staging: rtl8723bs: remove unused defines in odm.h staging: rtl8723bs: remove commented out code in hal/ files staging: rtl8723bs: remove unused defines in HalBtcOutSrc.h staging: rtl8723bs: remove unused PCI ASPM OSC definitions staging: rtl8723bs: remove unused EEPROM definitions staging: rtl8723bs: return bool from check_pending_xmitbuf ...
11 daysMerge tag 'mmc-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmcLinus Torvalds
Pull MMC updates from Ulf Hansson: "MMC core: - Add a power-off-delay-us DT property to support HW specific delays - Add mmc_send_tuning_timeout() to allow hosts to specify a timeout - Enable hosts to control the re-programming of the crypto keys MMC host: - dw_mmc: Add a common watchdog and convert the various timeouts to use it - dw_mmc: Expose the watchdog state in debugfs - dw_mmc-rockchip: Use a tighter per command tuning timeout - greybus-sdio: Convert to devm_mmc_alloc_host() - meson-gx: Enable the bus pipeline clock on T7 - rtsx_usb_sdmmc: Start card power-up at 3.3V - sdhci-cadence: Add Altera Agilex5 SD6HC support - sdhci-cadence: Add Cadence SD6HC support - sdhci-msm: Add support for the MSM8952 and Maili variants - sdhci-msm: Use pm ops to better manage restoring of crypto keys - sdhci-of-dwcmshc: Disable CQE error halt request for Rockchip - sdhci-pxav3: Disable clock inversion for SD HS cards - sunplus: Fixup initialization for DDR modes - sunxi: Add support for Allwinner B288 - vub300: Remove the driver for the obsolete HW" * tag 'mmc-v7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (43 commits) dt-bindings: mmc: sun4i-a10-mmc: add Allwinner B288 mmc: dw_mmc-rockchip: use a tighter per-command tuning timeout mmc: core: add mmc_send_tuning_timeout() mmc: sdhci-of-dwcmshc: Disable CQE error halt request for Rockchip dt-bindings: mmc: sdhci-msm: Add MSM8952 compatible mmc: use assign_bit() where applicable mmc: sdhci-pci: Replace deprecated PCI functions mmc: sunplus: initialise rd_crc_dly=1 for DDR modes mmc: core: fix stale mmc_start_req() references in comments docs: mmc: fix stale async request documentation docs: mmc: document eMMC health status support in mmc-tools mmc: cavium-thunderx: Drop redundant calls to get|put_device() mmc: core: Turn mmc_alloc|free_host() into static functions staging: greybus: sdio: Convert to devm_mmc_alloc_host() mmc: vub300: Remove the driver for the obsolete HW mmc: dw_mmc: remove unused slot member mmc: sdhci-pxav3: avoid of_node CREDITS: Add Pierre Ossman mmc: fix typos in comments mmc: meson-gx: enable the bus pipeline clock on T7 ...
2026-10-17staging: greybus: Align function argumentsYalagada Pavan Kumar
Align the function arguments to follow the coding style and improve readability, addressing the alignment warning reported by checkpatch.pl Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com> Link: https://patch.msgid.link/20261017084441.12123-1-pavankumaryalagada@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-17staging: greybus: uart: fix argument alignmentOkhuomon Ajayi
Align the msecs_to_jiffies() argument with the opening parenthesis of wait_for_completion_timeout() to address the checkpatch alignment warning. Signed-off-by: Okhuomon Ajayi <okhuomonajayi54@gmail.com> Link: https://patch.msgid.link/20261015213542.68994-1-okhuomonajayi54@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-17staging: greybus: Remove unused header declaration to_fw_mgmt_connectionJeremy Dean Clifton
Commit 3228900f80c2 ("staging: greybus: Remove unused function 'to_fw_mgmt_connection'") removed a function definition but did not remove the function prototype. Remove the prototype. Signed-off-by: Jeremy Dean Clifton <deaner92@yahoo.com> Reviewed-by: Alex Elder <elder@riscstar.com> Link: https://patch.msgid.link/20261015020731.98150-1-deaner92@yahoo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-14staging: greybus: Remove unused function 'to_fw_mgmt_connection'Jeremy Dean Clifton
Remove unused function from greybus driver to_fw_mgmt_connection. This function is not exported or called from anywhere tree-wide. Confirmed with git grep and cscope. Signed-off-by: Jeremy Dean Clifton <deaner92@yahoo.com> Reviewed-by: Alex Elder <elder@riscstar.com> Link: https://patch.msgid.link/20261013181707.29830-1-deaner92@yahoo.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-13staging: greybus: replace PTR_ERR() with %pe in error messagesYalagada Pavan Kumar
Use %pe to print error pointers directly and display their error names. Keep the other PTR_ERR() call because its return value is needed for ret. Signed-off-by: Yalagada Pavan Kumar <pavankumaryalagada@gmail.com> Link: https://patch.msgid.link/20261013022402.6322-1-pavankumaryalagada@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-13greybus: Discard pm_runtime_put_autosuspend() return valueBrian Norris
Returning an error code from pm_runtime_put_autosuspend() merely means that it has not queued up a timer or work item to check whether or not the device can be suspended and there are many perfectly valid situations in which that can happen, like after writing "on" to the device's runtime PM "control" attribute in sysfs for one example. Modify gb_pm_runtime_put_autosuspend() to discard the pm_runtime_put_autosuspend() return value, change its return type to void, and update its caller in the Greybus power supply driver accordingly. Also drop the redundant pm_runtime_mark_last_busy() call from gb_pm_runtime_put_autosuspend() while we're here, as this is already part of pm_runtime_put_autosuspend(). Note that this resolves a bug in the power_supply driver: in tracking 'gbpsy->pm_acquired', it erroneously assumed that pm_runtime_put_autosuspend() would not release a refcount when it returned a non-zero value. That's a false assumption. This will facilitate a planned change of the pm_runtime_put_autosuspend() return type to void in the future, similar to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return type to void"). Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Alex Elder <elder@riscstar.com> Link: https://patch.msgid.link/20261006161337.7.Ib0925681ca623093ddf812cc4de848e10ec07c73@changeid Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: gbphy: use sysfs_emit() instead of sprintf()Park Tae-sun
The sysfs documentation (Documentation/filesystems/sysfs.rst) recommends using sysfs_emit() instead of sprintf() in sysfs show() callbacks. Replace sprintf() with sysfs_emit() in the protocol_id_show() callback. This follows the standard kernel practice and existing use of sysfs_emit() in other Greybus sysfs show functions. No functional change. Signed-off-by: Park Tae-sun <ts930@dgu.ac.kr> Link: https://patch.msgid.link/178991148260.29938.9272611738457436343@naver.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: remove camera driver marked as broken since 2016Ethan Nelson-Moore
The Greybus camera driver has been marked as BROKEN since commit d4f56b47a8fa ("staging: greybus: Add drivers/staging/greybus to the build"). It has not been able to compile since at least commit ec0ad868173d ("staging: greybus: move core include files to include/linux/greybus/") because it includes greybus_protocols.h from its own directory. These two facts make it very clear there is no demand for this driver. Remove it from the kernel. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Link: https://patch.msgid.link/20260918011437.108678-1-enelsonmoore@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: remove driver depending on nonexistent config optionEthan Nelson-Moore
The Greybus Arche Platform driver depends on the config options USB_HSIC_USB3613 or COMPILE_TEST. USB_HSIC_USB3613 has never existed in mainline Linux, and COMPILE_TEST is intended to enable the compilation of drivers on platforms that can't support them to improve code coverage and ease testing of trivial or tree-wide changes. Therefore, it is impossible for anyone to be using this driver with unmodified mainline kernels. Remove it and move the former maintainer to the CREDITS file. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Link: https://patch.msgid.link/20260915020308.83636-1-enelsonmoore@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: remove empty TODO fileEthan Nelson-Moore
drivers/staging/greybus/TODO has been empty since commit d85bef159923 ("staging: greybus: remove completed GPIO conversion task from TODO"). Remove it. Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com> Reviewed-by: Alex Elder <elder@riscstar.com> Link: https://patch.msgid.link/20260918011654.115001-1-enelsonmoore@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01tty: fix saved termios reset raceJohan Hovold
Resetting saved termios state on device registration is needed where a minor number can be reused for an entirely different device and where the old settings may prevent the port from even being opened (e.g. when CLOCAL is not set). Not all TTY drivers guarantee that the minor number is no longer in use when registering devices however, something which can lead to a use-after-free when closing a TTY (and saving its termios) races with re-registration. Add a new TTY_DRIVER_RESET_SAVED_TERMIOS flag to request that any saved termios state is reset on registration and only set it for drivers that make sure that the minor number is no longer in use. Fixes: 93857edd9829 ("tty: reset termios state on device registration") Reported-by: Chengfeng Ye <nicoyip.dev@gmail.com> Link: https://lore.kernel.org/20260926184154.3017929-1-nicoyip.dev@gmail.com Cc: stable@kernel.org # 4.12 Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260930131845.1809256-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-10-01staging: greybus: uart: fix racy TIOCMIWAIT implementationJohan Hovold
Check the wakeup condition after adding the task to the waitqueue and updating the task state to avoid missing a racing modem status update or disconnect. Store the old icount on entry and do not update it in the completion handler to avoid missing events or reporting spurious ones (due to modem status changes before TIOCMIWAIT was called). Fixes: e68453ed28c5 ("greybus: uart-gb: now builds, more framework added") Cc: stable@kernel.org # 4.9 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260907095305.130762-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-09-17staging: greybus: sdio: Convert to devm_mmc_alloc_host()Ulf Hansson
Simplify the code by converting from mmc_alloc_host() to the resource managed devm_mmc_alloc_host(). Signed-off-by: Ulf Hansson <ulfh@kernel.org> Acked-by: Rui Miguel Silva <rui.silva@linaro.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-09-07Merge 7.3-rc2 into staging-nextGreg Kroah-Hartman
We need the staging driver fixes in here to build on. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-09-04treewide: refresh kmalloc_obj() conversionsKees Cook
This is another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci This catches both the set of kmalloc() uses added since the first kmalloc_obj() conversions in v7.0 and adds a large group missed in the first pass due to Coccinelle not interacting well with the cleanup.h scoped_...() family of macros[1]. I worked around this with spatch's "--macro-file" argument to a file with all the scoped_...() macros mapped to Coccinelle's YACFE_ITERATOR[2] as that was the closest viable control flow indicator I could find. Build tested allmodconfig on x86, arm64, arm, loongarch, mips, powerpc, riscv, and s390 with no new warnings. Link: https://lore.kernel.org/lkml/202609021314.8A9C0B8@keescook/ [1] Link: https://github.com/coccinelle/coccinelle/blob/master/standard.h [2] Signed-off-by: Kees Cook <kees+treewide@kernel.org>
2026-09-01staging: greybus: fix checkpatch alignment warnings in loopback.cPedro Amorim
Fix two alignment warnings reported by checkpatch.pl: the wrapped function declaration for gb_loopback_async_transfer_complete(), and the continuation line in the gb_operation_response_alloc() call. Signed-off-by: Pedro Amorim <pedro.aml.dev@gmail.com> Link: https://patch.msgid.link/20260804123132.24986-1-pedro.aml.dev@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-28greybus: audio: Split gb_audio_gb_get_topology() into size query and data fetchAditya Chari
`gb_audio_gb_get_topology()` combined three separate responsibilities into a single call: querying the topology size, allocating a buffer for it, and fetching the topology data into that buffer. This left callers with no way to perform any of these steps independently, and forced the kzalloc() allocation to live inside the protocol‑layer driver rather than the caller, as already flagged by a FIXME comment at the call site in `audio_module.c`. Split the function into two: - `gb_audio_gb_get_topology_size()` – queries only the topology size - `gb_audio_gb_get_topology()` – fetches topology data into a caller‑supplied buffer of a given size Update the only caller, `gb_audio_probe()` in `audio_module.c`, to query the size first, allocate the topology buffer itself, then fetch the data into it, freeing the buffer via the existing `free_topology` error path on failure. The topology size is now stored as `size_t` and validated in the caller before allocation, addressing the earlier TODO and FIXME comments. This resolves both the "TODO: Split into separate calls" comment above the original function in `audio_gb.c` and the FIXME comment at the call site in `audio_module.c`, both of which are removed as part of this change. No functional change in behavior for the existing probe path. Signed-off-by: Aditya Chari S <adi25charis@gmail.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Link: https://patch.msgid.link/20260725155108.7060-1-adi25charis@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-17staging: greybus: uart: return tty_alloc_driver() errorsAlfie Varghese
gb_tty_init() maps any tty_alloc_driver() failure to -ENOMEM. tty_alloc_driver() currently always returns -ENOMEM on failure, so this does not change behavior in practice. However, returning PTR_ERR(gb_tty_driver) is more correct and consistent with kernel conventions, preserving any future error codes the function might return. Signed-off-by: Alfie Varghese <alfievarghese22@gmail.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Link: https://patch.msgid.link/20260714134921.817-1-alfievarghese22@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: hid: fix SET_REPORT return valueHao-Qun Huang
__gb_hid_output_raw_report() stores the result of gb_hid_set_report() in ret and even adjusts it to account for the report ID byte, but then always returns 0. This hides Greybus transport errors from HID_REQ_SET_REPORT callers, and makes hidraw report zero bytes written to user space on success, although hid_hw_raw_request() is expected to return the number of bytes transferred or a negative errno. The sibling GET_REPORT path, __gb_hid_get_raw_report(), already follows this convention. Return ret like the other HID transport drivers do. Fixes: 96eab779e198 ("greybus: hid: add HID class driver") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-fable-5 Signed-off-by: Hao-Qun Huang <alvinhuang0603@gmail.com> Link: https://patch.msgid.link/20260704081613.434445-1-alvinhuang0603@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: vibrator: return device_create() errorsAlfie Varghese
gb_vibrator_probe() maps any device_create() failure to -EINVAL. This loses the real errno returned by the driver core, such as -ENOMEM, and makes probe failures harder to diagnose correctly. Return PTR_ERR(dev) instead so callers receive the actual failure reason while preserving the existing cleanup path. Signed-off-by: Alfie Varghese <alfievarghese22@gmail.com> Link: https://patch.msgid.link/20260618113439.569-1-alfievarghese22@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: power_supply: remove unnecessary parentheses in returnTomasz Unger
return is not a function, so the parentheses around the returned expressions are not needed. Remove them to follow kernel coding style and silence checkpatch.pl RETURN_PARENTHESES warnings. Verified with checkpatch.pl - no errors or warnings. Compiled the power_supply object successfully. Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl> Acked-by: Rui Miguel Silva <rui.silva@linaro.org> Link: https://patch.msgid.link/20260615-greybus-power-supply-return-parens-v1-1-dcad9dabfe79@yahoo.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07greybus: audio: bound the topology section sizes against the fetched sizeBryam Vargas
gb_audio_gb_get_topology() fetches a topology blob of a module-supplied size, and gbaudio_tplg_parse_data() then walks it by adding the module-supplied size_dais, size_controls and size_widgets fields to form the control, widget and route section offsets. Those le32 sizes are never checked against the fetched blob, so a module reporting a small topology size but large section sizes makes the offsets point past the allocation, and parsing reads out of bounds. Reject a topology whose section sizes do not fit within the fetched size before it is parsed. Fixes: 184992e305f1 ("greybus: audio: Add Greybus Audio Device Class Protocol helper routines") Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me> Link: https://patch.msgid.link/20260616-b4-disp-4352e8b0-v1-1-3e09f62e0ad5@proton.me Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: Remove unused macroMichail Tatas
Remove unused macro as indicated by the compiler when building with make W=2 Signed-off-by: Michail Tatas <michail.tatas@gmail.com> Link: https://patch.msgid.link/ahdNZlYqnTO22tQq@michalis-linux Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: audio_codec: remove redundant else-if checkAbdelnasser Hussein
In gbaudio_module_update(), the widget id is validated earlier in the function to ensure it is either snd_soc_dapm_aif_in or snd_soc_dapm_aif_out. Remove the redundant else-if check for snd_soc_dapm_aif_out. The remaining branch can only handle snd_soc_dapm_aif_out, which avoids a compiler warning about a potentially uninitialized variable. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202606140347.gGVWDnbi-lkp@intel.com/ Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com> Link: https://patch.msgid.link/20260614154329.5176-3-abdelnasserhussein11@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: audio_codec: fix sscanf return value checkAbdelnasser Hussein
Smatch static checker warns: drivers/staging/greybus/audio_codec.c:335 gbaudio_module_update() warn: sscanf doesn't return error codes The sscanf() function returns the number of successfully matched input items, not a negative error code. Compare the return value directly with the expected number of conversions (3) instead of storing it in 'ret' and returning it as an error code, which leads to returning a positive value on failure. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Closes: https://lore.kernel.org/all/YoOLnDkHgVltyXK7@kili/ Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com> Link: https://patch.msgid.link/20260614154329.5176-2-abdelnasserhussein11@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: remove unused macro CAP_TIMEOUT_MSRhys Tumelty
The macro CAP_TIMEOUT_MS is defined but never used anywhere in the kernel tree. Remove it to clean up code. Signed-off-by: Rhys Tumelty <rhys@tumelty.co.uk> Reviewed-by: Alex Elder <elder@riscstar.com> Link: https://patch.msgid.link/20260610173026.1105803-1-rhys@tumelty.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-07staging: greybus: audio: correct sscanf() return value checkAlexander A. Klimov
manager_sysfs_add_store() passes 6 pointers to sscanf(), but required latter to return 7 which always failed the operation. I corrected it to 6. Fixes: 49b9137a6002 ("staging: greybus: audio: remove redundant slot field") Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Link: https://patch.msgid.link/20260521182331.22685-1-grandmaster@al2klimov.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-03Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c ↵Uwe Kleine-König (The Capable Hub)
files) Replace the #include of <linux/mod_devicetable.h> by the more specific <linux/device-id/*.h> where applicable. For most cases the include can be dropped completely, only a few drivers need one or two headers added. Acked-by: Danilo Krummrich <dakr@kernel.org> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
2026-06-22Merge tag 'staging-7.2-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big set of staging driver updates for 7.2-rc1. Nothing major in here, just constant grind of tiny cleanups and coding style fixes and wrapper removals. Overall more code was removed than added, always a nice sign that things are progressing forward. Changes outside of drivers/staging/ was due to the octeon driver changes, which for some reason also lives partially in the mips subsystem, someday that all will be untangled and cleaned up, or just removed entirely, it's hard to tell which is going to be its fate. Other than octeon driver cleanups, in here are the usual: - rtl8723bs driver reworking and cleanups, being the bulk of this merge window given all of the issues and wrappers involved in that beast of a driver - most driver cleanups - sm750fb driver cleanups (which might be done, as this really should be moved to the drm layer one of these days...) - other tiny staging driver cleanups and fixes All of these have been in linux-next for many weeks with no reported issues" * tag 'staging-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (199 commits) staging: most: video: avoid double free on video register failure staging: sm750: rename CamelCase variable Bpp to bpp staging: rtl8723bs: delete superfluous switch statement staging: sm750fb: Mark g_noaccel, g_nomtrr and g_dualview as __ro_after_init staging: rtl8723bs: propagate errno through hal xmit path staging: rtl8723bs: propagate errno through xmit enqueue path staging: rtl8723bs: convert rtw_xmit_classifier to return errno staging: rtl8723bs: make rtw_xmit_classifier static staging: rtl8723bs: simplify rtw_xmit_classifier control flow staging: rtl8723bs: make _rtw_enqueue_cmd return 0 on success staging: rtl8723bs: simplify rtw_enqueue_cmd control flow staging: rtl8723bs: make _rtw_enqueue_cmd static staging: rtl8723bs: simplify _rtw_enqueue_cmd control flow staging: rtl8723bs: fix multiple blank lines in more hal/ files staging: rtl8723bs: remove unused TXDESC_64_BYTES code staging: rtl8723bs: remove unused DBG_XMIT_BUF and DBG_XMIT_BUF_EXT code staging: rtl8723bs: fix multiple blank lines in hal/Hal* files staging: rtl8723bs: fix multiple blank lines in hal/ files staging: rtl8723bs: rtw_mlme: add blank line for readability staging: rtl8723bs: rtw_mlme: wrap rtw_sitesurvey_cmd condition ...
2026-05-21spi: fix controller registration API inconsistencyJohan Hovold
The SPI controller API is asymmetric in that a controller is allocated and registered in two step, while it is freed as part of deregistration. [1] This is especially unfortunate as any driver data is freed along with the controller, something which has lead to use-after-free bugs during deregistration when drivers tear down resources after deregistering the controller (or tear down resources that may still be in use before deregistering the controller in an attempt to work around the API). To reduce the risk of such bugs being introduced a device managed allocation interface was added, but this arguably made things even less consistent as now whether the controller gets freed as part of deregistration depends on how it was allocated. [2][3] With most drivers converted to use managed allocation in preparation for fixing the API, the remaining 16 drivers can be converted in one tree-wide change. Ten of those drivers use the bitbang interface and can be converted by simply removing the extra reference already taken by spi_bitbang_start() (and updating the two bitbang drivers that use managed allocation). [4] Fix the API inconsistency by no longer dropping a reference when deregistering non-devres allocated controllers. [1] 68b892f1fdc4 ("spi: document odd controller reference handling") [2] 5e844cc37a5c ("spi: Introduce device-managed SPI controller allocation") [3] 3f174274d224 ("spi: fix misleading controller deregistration kernel-doc") [4] 702a4879ec33 ("spi: bitbang: Let spi_bitbang_start() take a reference to master") Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260521073816.766596-1-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-14Merge tag 'hid-for-linus-2026051401' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - fixes for a few OOB/UAF in several HID drivers (Florian Pradines, Lee Jones, Michael Zaidman, Rosalie Wanders, Sangyun Kim and Tomasz Pakuła) - more general sanitation of input data, dealing with potentially malicious hardware in hid-core (Benjamin Tissoires) - a few device-specific quirks and fixups * tag 'hid-for-linus-2026051401' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (22 commits) HID: logitech-hidpp: Add support for newer Bluetooth keyboards HID: pidff: Fix integer overflow in pidff_rescale HID: i2c-hid: add reset quirk for BLTP7853 touchpad HID: core: introduce hid_safe_input_report() HID: pass the buffer size to hid_report_raw_event HID: google: hammer: stop hardware on devres action failure HID: appletb-kbd: run inactivity autodim from workqueues HID: appletb-kbd: fix UAF in inactivity-timer cleanup path HID: playstation: Clamp num_touch_reports HID: magicmouse: Prevent out-of-bounds (OOB) read during DOUBLE_REPORT_ID HID: mcp2221: fix OOB write in mcp2221_raw_event() HID: quirks: really enable the intended work around for appledisplay HID: hid-sjoy: race between init and usage HID: uclogic: Fix regression of input name assignment HID: intel-thc-hid: Intel-quickspi: Fix some error codes HID: hid-lenovo-go-s: restore OS_TYPE after resume from s2idle HID: elan: Add support for ELAN SB974D touchpad HID: sony: add missing size validation for Rock Band 3 Pro instruments HID: sony: add missing size validation for SMK-Link remotes HID: sony: remove unneeded WARN_ON() in sony_leds_init() ...
2026-05-12HID: pass the buffer size to hid_report_raw_eventBenjamin Tissoires
commit 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()") enforced the provided data to be at least the size of the declared buffer in the report descriptor to prevent a buffer overflow. However, we can try to be smarter by providing both the buffer size and the data size, meaning that hid_report_raw_event() can make better decision whether we should plaining reject the buffer (buffer overflow attempt) or if we can safely memset it to 0 and pass it to the rest of the stack. Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()") Cc: stable@vger.kernel.org Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Acked-by: Johan Hovold <johan@kernel.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.com>
2026-05-04staging: greybus: fix typo in sysfs-bus-greybusMaha Maryam Javaid
Fix spelling mistake: attibute -> attribute Signed-off-by: Maha Maryam Javaid <mahamaryamjavaid@gmail.com> Link: https://patch.msgid.link/20260429033816.11282-1-mahamaryamjavaid@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-04-27staging: greybus: fix alignment to match open parenthesisKosugi Souta
Fix the checkpatch.pl check "Alignment should match open parenthesis" by adjusting the indentation in authenticate.c. Signed-off-by: Kosugi Souta <k.souta0926@gmail.com> Link: https://patch.msgid.link/20260404005939.116701-3-k.souta0926@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31staging: greybus: audio: fix error message for BTN_3 buttonHaoyu Lu
In gbaudio_init_jack(), when setting SND_JACK_BTN_3 key, the error message incorrectly says "Failed to set BTN_0". This should be "Failed to set BTN_3" to match the button being configured. Signed-off-by: Haoyu Lu <hechushiguitu666@gmail.com> Reviewed-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260330083425.266-1-hechushiguitu666@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31greybus: raw: fix use-after-free if write is called after disconnectDamien Riégel
If a user writes to the chardev after disconnect has been called, the kernel panics with the following trace (with CONFIG_INIT_ON_FREE_DEFAULT_ON=y): BUG: kernel NULL pointer dereference, address: 0000000000000218 ... Call Trace: <TASK> gb_operation_create_common+0x61/0x180 gb_operation_create_flags+0x28/0xa0 gb_operation_sync_timeout+0x6f/0x100 raw_write+0x7b/0xc7 [gb_raw] vfs_write+0xcf/0x420 ? task_mm_cid_work+0x136/0x220 ksys_write+0x63/0xe0 do_syscall_64+0xa4/0x290 entry_SYSCALL_64_after_hwframe+0x77/0x7f Disconnect calls gb_connection_destroy, which ends up freeing the connection object. When gb_operation_sync is called in the write file operations, its gets a freed connection as parameter and the kernel panics. The gb_connection_destroy cannot be moved out of the disconnect function, as the Greybus subsystem expect all connections belonging to a bundle to be destroyed when disconnect returns. To prevent this bug, use a rw lock to synchronize access between write and disconnect. This guarantees that the write function doesn't try to use a disconnected connection. Fixes: e806c7fb8e9b ("greybus: raw: add raw greybus kernel driver") Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Damien Riégel <damien.riegel@silabs.com> Link: https://patch.msgid.link/20260324140039.40001-2-damien.riegel@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-31greybus: raw: fix use-after-free on cdev closeDamien Riégel
This addresses a use-after-free bug when a raw bundle is disconnected but its chardev is still opened by an application. When the application releases the cdev, it causes the following panic when init on free is enabled (CONFIG_INIT_ON_FREE_DEFAULT_ON=y): refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 139 at lib/refcount.c:28 refcount_warn_saturate+0xd0/0x130 ... Call Trace: <TASK> cdev_put+0x18/0x30 __fput+0x255/0x2a0 __x64_sys_close+0x3d/0x80 do_syscall_64+0xa4/0x290 entry_SYSCALL_64_after_hwframe+0x77/0x7f The cdev is contained in the "gb_raw" structure, which is freed in the disconnect operation. When the cdev is released at a later time, cdev_put gets an address that points to freed memory. To fix this use-after-free, convert the struct device from a pointer to being embedded, that makes the lifetime of the cdev and of this device the same. Then, use cdev_device_add, which guarantees that the device won't be released until all references to the cdev have been released. Finally, delegate the freeing of the structure to the device release function, instead of freeing immediately in the disconnect callback. Fixes: e806c7fb8e9b ("greybus: raw: add raw greybus kernel driver") Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Damien Riégel <damien.riegel@silabs.com> Link: https://patch.msgid.link/20260324140039.40001-1-damien.riegel@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18staging: greybus: loopback: remove unused argument from macroGiacomo Di Clerico
The gb_dev_loopback_ro_attr macro accepted a 'conn' argument which was never used in its expansion. Remove it from both the macro definition and its invocation. Signed-off-by: Giacomo Di Clerico <giacomodiclerico@gmail.com> Link: https://patch.msgid.link/20260315105853.34609-1-giacomodiclerico@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-18staging: greybus: loopback: use sysfs_emit in sysfs show functionsLuis Soza Rodriguez
As per the kernel's documentation, sysfs_emit() is the preferred way to format strings for sysfs attributes. It handles buffer overruns safely. Replace sprintf calls with sysfs_emit across all loopback sysfs show macros. Signed-off-by: Luis Soza Rodriguez <contact@sluisr.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/20260309230507.4931-1-contact@sluisr.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-09staging: greybus: remove redundant 'int' from unsigned long longOskar Ray-Frayssinet
Replace 'unsigned long long int' with 'unsigned long long' as the 'int' suffix is unnecessary and not preferred by kernel coding style. Signed-off-by: Oskar Ray-Frayssinet <rayfraytech@gmail.com> Link: https://patch.msgid.link/20260304193206.4992-1-rayfraytech@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-09staging: greybus: arche: use sysfs_emit() instead of sprintf()Ruslan Valiyev
Replace sprintf() with sysfs_emit() in state_show() sysfs attribute callbacks in arche-platform.c and arche-apb-ctrl.c. Checkpatch complains about code using sprintf(). This code here is obviously safe as-is, but it would be more appropriate to use sysfs_emit(). Signed-off-by: Ruslan Valiyev <linuxoid@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/20260226074858.67635-1-linuxoid@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-03-09staging: greybus: arche-platform: Use sysfs_emit instead of sprintfShubham Chakraborty
Refactor sprintf to sysfs_emit in the show function of the arche platform driver. This follows the standard kernel practice of using sysfs_emit for sysfs attributes, ensuring consistent output formatting and newline handling. Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com> Link: https://patch.msgid.link/20260226065239.11698-1-chakrabortyshubham66@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-25staging: greybus: audio: drop stale TODO commentHardik Phalet
Modules are removed from modules_list in gb_audio_manager_remove() and gb_audio_manager_remove_all() before kobject_put(). The TODO suggesting list deletion in the kobject release callback is stale and misleading. Signed-off-by: Hardik Phalet <hardik.phalet@pm.me> Link: https://patch.msgid.link/20260224185421.824210-3-hardik.phalet@pm.me Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-25staging: greybus: audio: remove unused gb_audio_manager_get_module()Hardik Phalet
gb_audio_manager_get_module() has no in-tree callers so remove the unused function to avoid carrying dead code. Signed-off-by: Hardik Phalet <hardik.phalet@pm.me> Link: https://patch.msgid.link/20260224185421.824210-2-hardik.phalet@pm.me Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-25staging: greybus: audio: Use sysfs_emit in show functionsShubham Chakraborty
Refactor sprintf to sysfs_emit in all show functions of the greybus audio manager module. This follows the standard kernel practice of using sysfs_emit for sysfs attributes. Signed-off-by: Shubham Chakraborty <chakrabortyshubham66@gmail.com> Link: https://patch.msgid.link/20260225071212.9050-1-chakrabortyshubham66@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-23staging: greybus: sdio: Remove double whitespaceGiorgi Tchankvetadze
Fix double space in variable initialization. Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Link: https://patch.msgid.link/20260216060753.19007-2-giorgitchankvetadze1997@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-23staging: greybus: Fix spelling mistake in KconfigTomasz Unger
Replace 'busses' with 'buses' in help text. Found using codespell. Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl> Reviewed-by: Ethan Tidmore <ethantidmore06@gmail.com> Link: https://patch.msgid.link/20260221110355.9006-1-tomasz.unger@yahoo.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-23staging: greybus: sdio: Fix typo in commentGiorgi Tchankvetadze
Fix a grammatical typo in a comment: change "is" to "if". The sentence should read "check if a stop transmission is pending". Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com> Link: https://patch.msgid.link/20260216055344.17033-2-giorgitchankvetadze1997@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>