Skip to contentSkip to conversation

Compile-time thread-safety checking

RFC PATCH Applied Bart Van Assche 11 participants 66 messages Feb 6, 2025 – Feb 12, 2025

Subsystems (428)
lore
Share & tools
lore

Bart Van Assche

author maintainer
#0 lore raw

cover Compile-time thread-safety checking

Hi Peter,

As you may know the Clang compiler can perform certain thread-safety checks at compile time. This includes checking whether locking calls in a function match the function attributes and also whether annotated structure members are protected by the synchronization objects declared with GUARDED_BY(). As one can see this patch series includes a significant number of fixes for locking bugs. All these locking bugs have been discovered by the Clang thread-safety checker. I think this shows that it is useful to enable compile-time thread-safety checks.

The Clang thread-safety infrastructure is not new. Some user space code in the kernel tree already uses it. See also the header file tools/perf/util/mutex.h. There are other projects that started using this infrastructure a while ago, e.g. Qemu. The header file include/qemu/clang-tsa.h was added more than two years ago to the Qemu project.

This patch series has been posted as an RFC because at this stage my goal is to gather feedback about the following:
- Whether or not to enable compile-time thread-safety checking in the Linux kernel.
- The names of the macros in header file include/linux/thread_safety.h. The proposed names come from the Clang documentation (ACQUIRE(), RELEASE(), REQUIRES(), ...). In the Qemu header file for thread-safety support these macros have a prefix (TSA_ = Thread-Safety Analysis).
- The changes made in header file include/linux/cleanup.h that support annotating constructor functions with function attributes.
- Whether or not to split the two treewide patches in this series into one patch per kernel driver.
- How to merge this patch series. The second last patch in this series modifies 888 source files. If it is split into one patch per driver, this patch series will become too large to be posted as a single patch series.

Annotating struct mutex is a first step. Once struct mutex is annotated, driver contributors and/or maintainers can annotate structure members with GUARDED_BY() where this is considered useful.

There are more synchronization objects that can be annotated with thread-safety attributes, e.g. spinlocks. This patch series only annotates struct mutex because annotating other synchronization objects too would have made this patch series too large.

Thanks,

Bart.

Bart Van Assche (33):
scsi, usb: Rename the RESERVE and RELEASE constants
s390: Comment out the RELEASE constant
locking: Introduce <linux/thread_safety.h> include/linux/cleanup.h: Support thread-safety analysis locking/mutex: Change the atomic_dec_and_mutex_lock() return type locking/mutex: Annotate struct mutex and mutex functions driver core: Annotate locking functions in <linux/device.h>
kref: Add thread-safety annotations in <linux/kref.h>
refcount: Add thread-safety annotations in <linux/refcount.h>
treewide: Modify mutex_lock_interruptible() return value checks
PNP: isapnp: Check the isapnp_cfg_begin() return value
scsi: mpi3mr: Fix locking in an error path
scsi: mpt3sas: Fix a locking bug in an error path
ice: Split ice_dcb_rebuild()
ice: Fix a locking bug in an error path
net/mlx5e: Make the code easier to analyze
Input: synaptics-rmi4 - fix a locking bug in an error path
misc: nsm: Fix a locking bug in an error path drm/amdgpu: Unlock a mutex before destroying it drm/amdgpu: Fix a locking bug in an error path drm/amdgpu: Fix locking bugs in error paths
drm: bridge: cdns-mhdp8546: Fix a locking bug in an error path
drm: bridge: cdns-mhdp8546: Fix a locking bug in an error path
drm: zynqmp_dp: Fix a deadlock in zynqmp_dp_ignore_hpd_set()
wifi: ath12k: Fix locking in error paths
mctp i3c: Fix locking in error paths
iavf: Fix a locking bug in an error path
wifi: mt76: mt7925: Fix a locking bug in an error path
hwmon: (it87) Check the it87_lock() return value drivers/net/ethernet/marvell/octeontx2/nic: Fix locking in an error
path
md/raid*: Fix raid*_set_queue_limits()
treewide: Annotate all struct mutex users
kbuild: clang: Unconditionally enable thread-safety checking

 Documentation/locking/mutex-design.rst        |   2 +-
 arch/arm64/kvm/arm.c                          |   2 +
 arch/powerpc/kernel/rtas.c                    |   1 +
 arch/powerpc/platforms/powermac/low_i2c.c     |   6 +
 arch/powerpc/platforms/pseries/papr-vpd.c     |   2 +
 arch/x86/events/core.c                        |   1 +
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c     |   1 +
 arch/x86/kernel/cpu/resctrl/rdtgroup.c        |   2 +
 arch/x86/kernel/cpu/sgx/encl.c                |   2 +
 arch/x86/kernel/ftrace.c                      |   2 +
 arch/x86/kernel/module.c                      |   1 +
 arch/x86/kvm/svm/sev.c                        |   6 +
 block/bdev.c                                  |   3 +
 block/blk-cgroup.c                            |   2 +
 block/ioctl.c                                 |   1 +
 drivers/accel/amdxdna/aie2_error.c            |   5 +-
 drivers/accel/qaic/qaic_control.c             |   1 +
 drivers/acpi/scan.c                           |   5 +
 drivers/ata/libata-core.c                     |  31 +++-
 drivers/ata/libata-eh.c                       |   2 +
 drivers/ata/libata.h                          |   6 +-
 drivers/base/bus.c                            |   1 +
 drivers/base/core.c                           |   7 +
 drivers/base/dd.c                             |   2 +
 drivers/base/power/clock_ops.c                |   4 +
 drivers/base/power/main.c                     |   2 +
 drivers/base/regmap/regmap-irq.c              |   2 +
 drivers/base/regmap/regmap.c                  |   2 +
 drivers/block/drbd/drbd_bitmap.c              |   2 +
 drivers/block/drbd/drbd_main.c                |   7 +
 drivers/block/drbd/drbd_nl.c                  |   1 +
 drivers/block/drbd/drbd_receiver.c            |   1 +
 drivers/block/drbd/drbd_state.c               |   4 +
 drivers/block/loop.c                          |   2 +
 drivers/block/nbd.c                           |   3 +
 drivers/block/null_blk/zoned.c                |   2 +
 drivers/block/rnbd/rnbd-clt.c                 |   2 +
 drivers/bus/fsl-mc/mc-sys.c                   |   1 +
 drivers/bus/vexpress-config.c                 |   2 +
 drivers/cdx/cdx_msi.c                         |   2 +
 drivers/char/ipmi/ipmi_msghandler.c           |   1 +
 drivers/char/misc.c                           |   2 +
 drivers/char/powernv-op-panel.c               |   2 +
 drivers/char/tpm/tpm-chip.c                   |   3 +
 drivers/char/xillybus/xillybus_core.c         |   1 +
 drivers/clk/clk.c                             |   4 +
 drivers/comedi/comedi_fops.c                  |   2 +
 drivers/comedi/drivers.c                      |   1 +
 drivers/comedi/drivers/usbduxsigma.c          |   1 +
 drivers/counter/rz-mtu3-cnt.c                 |   3 +
 drivers/cpuidle/cpuidle.c                     |   2 +
 drivers/crypto/exynos-rng.c                   |   1 +
 drivers/crypto/hisilicon/qm.c                 |   4 +
 drivers/crypto/intel/qat/qat_common/adf_cfg.c |   2 +
 .../qat/qat_common/adf_transport_debug.c      |   4 +
 drivers/cxl/core/port.c                       |   2 +
 drivers/devfreq/devfreq.c                     |   1 +
 drivers/dpll/dpll_netlink.c                   |   6 +
 drivers/firmware/arm_ffa/driver.c             |   1 +
 drivers/firmware/arm_scmi/notify.c            |   1 +
 .../firmware/arm_scmi/transports/mailbox.c    |   2 +
 drivers/firmware/arm_scmi/transports/optee.c  |   2 +
 .../firmware/qcom/qcom_qseecom_uefisecapp.c   |   2 +
 drivers/fpga/fpga-bridge.c                    |   2 +
 drivers/fpga/fpga-region.c                    |   3 +
 drivers/gpio/gpio-adnp.c                      |   2 +
 drivers/gpio/gpio-crystalcove.c               |   2 +
 drivers/gpio/gpio-dln2.c                      |   2 +
 drivers/gpio/gpio-ljca.c                      |   2 +
 drivers/gpio/gpio-max77620.c                  |   2 +
 drivers/gpio/gpio-mlxbf2.c                    |   6 +-
 drivers/gpio/gpio-pca953x.c                   |   2 +
 drivers/gpio/gpio-pcf857x.c                   |   2 +
 drivers/gpio/gpio-pmic-eic-sprd.c             |   2 +
 drivers/gpio/gpio-stmpe.c                     |   2 +
 drivers/gpio/gpio-tc3589x.c                   |   2 +
 drivers/gpio/gpio-virtio.c                    |   2 +
 drivers/gpio/gpio-wcove.c                     |   2 +
 drivers/gpu/drm/amd/amdgpu/aldebaran.c        |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c       |   1 +
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c    |   4 +
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c  |   4 +
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c    |   4 +
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c    |   4 +
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c |   4 +
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c |   4 +
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c |   8 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c        |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c       |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c       |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c       |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h       |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c       |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c    |  14 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       |   5 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c     |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h  |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c        |   1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h        |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c     |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c       |   1 +
 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c        |   3 +-
 drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c    |   2 +
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c         |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c      |   4 +
 .../drm/amd/amdkfd/kfd_device_queue_manager.c |   5 +
 .../drm/amd/amdkfd/kfd_device_queue_manager.h |   2 +
 drivers/gpu/drm/amd/amdkfd/kfd_svm.h          |   2 +
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   2 +
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |   1 +
 drivers/gpu/drm/ast/ast_ddc.c                 |   2 +
 .../drm/bridge/cadence/cdns-mhdp8546-core.c   |   9 +-
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c    |   2 +
 drivers/gpu/drm/clients/drm_log.c             |   2 +
 drivers/gpu/drm/display/drm_dp_helper.c       |   3 +
 drivers/gpu/drm/display/drm_dp_mst_topology.c |   2 +
 drivers/gpu/drm/drm_atomic_helper.c           |   3 +
 drivers/gpu/drm/drm_auth.c                    |   2 +
 drivers/gpu/drm/drm_client_modeset.c          |   1 +
 drivers/gpu/drm/drm_color_mgmt.c              |   1 +
 drivers/gpu/drm/drm_crtc.c                    |   1 +
 drivers/gpu/drm/drm_drv.c                     |   1 +
 drivers/gpu/drm/drm_fb_helper.c               |   1 +
 drivers/gpu/drm/drm_file.c                    |   4 +
 drivers/gpu/drm/drm_gem.c                     |   4 +-
 drivers/gpu/drm/drm_mode_object.c             |   2 +
 drivers/gpu/drm/drm_modeset_lock.c            |   2 +
 drivers/gpu/drm/drm_plane.c                   |   1 +
 drivers/gpu/drm/drm_prime.c                   |   1 +
 drivers/gpu/drm/i915/display/intel_cdclk.c    |   1 +
 .../drm/i915/display/intel_display_reset.c    |   2 +
 drivers/gpu/drm/i915/display/intel_gmbus.c    |   3 +
 drivers/gpu/drm/i915/display/intel_pps.c      |   2 +
 drivers/gpu/drm/i915/display/intel_psr.c      |   3 +
 drivers/gpu/drm/i915/display/intel_tc.c       |   4 +
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |   2 +
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |   1 +
 drivers/gpu/drm/i915/gt/intel_context.h       |   4 +
 drivers/gpu/drm/i915/gt/selftest_context.c    |   1 +
 drivers/gpu/drm/i915/gt/selftest_timeline.c   |   1 +
 drivers/gpu/drm/i915/gvt/vgpu.c               |   1 +
 drivers/gpu/drm/i915/i915_request.c           |   1 +
 drivers/gpu/drm/i915/i915_vma.c               |   3 +-
 drivers/gpu/drm/i915/intel_sbi.c              |   2 +
 drivers/gpu/drm/i915/intel_wakeref.c          |   2 +
 drivers/gpu/drm/i915/intel_wakeref.h          |   2 +
 drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c      |   1 +
 drivers/gpu/drm/i915/vlv_sideband.c           |   2 +
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c     |   1 +
 drivers/gpu/drm/mgag200/mgag200_ddc.c         |   2 +
 drivers/gpu/drm/msm/msm_atomic.c              |   2 +
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |   2 +
 drivers/gpu/drm/nouveau/nouveau_abi16.c       |   2 +
 drivers/gpu/drm/nouveau/nouveau_uvmm.h        |   2 +
 drivers/gpu/drm/nouveau/nvkm/core/subdev.c    |   1 +
 .../gpu/drm/nouveau/nvkm/engine/fifo/chan.c   |   3 +-
 .../gpu/drm/nouveau/nvkm/engine/fifo/uchan.c  |   1 +
 drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c    |   3 +
 .../gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c   |   2 +
 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c |   2 +
 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c |   2 +
 .../drm/nouveau/nvkm/subdev/instmem/nv50.c    |  24 +--
 drivers/gpu/drm/panthor/panthor_mmu.c         |   1 +
 drivers/gpu/drm/qxl/qxl_cmd.c                 |   1 +
 drivers/gpu/drm/qxl/qxl_display.c             |   2 +
 drivers/gpu/drm/radeon/radeon_i2c.c           |   2 +
 drivers/gpu/drm/radeon/radeon_ring.c          |   3 +
 drivers/gpu/drm/rockchip/cdn-dp-core.c        |   1 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c  |   2 +
 drivers/gpu/drm/tegra/hdmi.c                  |   2 +
 drivers/gpu/drm/ttm/tests/ttm_bo_test.c       |   1 +
 drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c           |   7 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c        |   5 +
 drivers/gpu/drm/vmwgfx/vmwgfx_validation.c    |   3 +
 drivers/gpu/drm/xe/xe_migrate.c               |   1 +
 drivers/gpu/drm/xe/xe_pcode.c                 |   1 +
 drivers/gpu/drm/xlnx/zynqmp_dp.c              |   2 +-
 drivers/gpu/host1x/bus.c                      |   2 +
 drivers/gpu/host1x/cdma.c                     |   6 +
 drivers/gpu/host1x/context.c                  |   1 +
 drivers/gpu/host1x/mipi.c                     |   2 +
 drivers/hid/hid-wiimote.h                     |   3 +
 drivers/hv/channel.c                          |   2 +
 drivers/hwmon/abituguru.c                     |   2 +
 drivers/hwmon/abituguru3.c                    |   2 +
 drivers/hwmon/asus_rog_ryujin.c               |   4 +-
 drivers/hwmon/gigabyte_waterforce.c           |   2 +-
 drivers/hwmon/it87.c                          |   6 +-
 drivers/hwmon/lm78.c                          |   1 +
 drivers/hwmon/nct7904.c                       |   2 +
 drivers/hwmon/nzxt-kraken3.c                  |   2 +-
 drivers/hwmon/pmbus/pmbus_core.c              |   1 +
 drivers/hwmon/w83781d.c                       |   1 +
 drivers/hwtracing/intel_th/msu.c              |   1 +
 drivers/hwtracing/stm/policy.c                |   2 +
 drivers/i2c/busses/i2c-amd-mp2-pci.c          |   2 +
 drivers/i2c/busses/i2c-xiic.c                 |   1 +
 drivers/i2c/i2c-atr.c                         |   3 +
 drivers/iio/accel/kionix-kx022a.c             |   3 +
 drivers/iio/adc/meson_saradc.c                |   2 +
 drivers/iio/buffer/industrialio-buffer-dma.c  |   2 +
 drivers/iio/industrialio-core.c               |   4 +
 drivers/iio/light/opt3001.c                   |   1 +
 drivers/infiniband/core/cma.c                 |   5 +
 drivers/infiniband/core/security.c            |   1 +
 drivers/infiniband/core/umem_odp.c            |   1 +
 drivers/infiniband/hw/hns/hns_roce_hem.c      |   2 +
 drivers/infiniband/hw/mlx4/main.c             |   2 +
 drivers/infiniband/hw/mlx5/mr.c               |   1 +
 drivers/infiniband/hw/mlx5/odp.c              |   1 +
 drivers/infiniband/hw/mlx5/umr.c              |   2 +
 drivers/infiniband/ulp/srp/ib_srp.c           |   2 +-
 drivers/infiniband/ulp/srpt/ib_srpt.c         |   4 +-
 drivers/input/input.c                         |   3 +
 drivers/input/joystick/pxrc.c                 |   2 +
 drivers/input/keyboard/adp5588-keys.c         |   2 +
 drivers/input/misc/ati_remote2.c              |   2 +
 drivers/input/misc/cm109.c                    |   2 +
 drivers/input/mouse/psmouse-base.c            |   1 +
 drivers/input/mouse/synaptics_usb.c           |   2 +
 drivers/input/rmi4/rmi_f54.c                  |   5 +-
 drivers/input/serio/i8042.c                   |   2 +
 drivers/input/serio/libps2.c                  |   2 +
 drivers/iommu/iommufd/device.c                |   2 +
 drivers/iommu/iommufd/hw_pagetable.c          |   1 +
 drivers/leds/leds-blinkm.c                    |   2 +-
 drivers/md/bcache/alloc.c                     |   2 +
 drivers/md/bcache/btree.c                     |   1 +
 drivers/md/bcache/super.c                     |   2 +
 drivers/md/dm-bufio.c                         |   2 +
 drivers/md/dm-crypt.c                         |   1 +
 drivers/md/dm-vdo/indexer/index-session.c     |   1 +
 drivers/md/dm-vdo/indexer/volume-index.c      |   3 +
 drivers/md/dm-vdo/indexer/volume.c            |   1 +
 drivers/md/dm-writecache.c                    |   6 +
 drivers/md/dm-zoned-metadata.c                |   6 +
 drivers/md/dm.c                               |   5 +
 drivers/md/md-cluster.c                       |  12 +-
 drivers/md/md.c                               |   8 +
 drivers/md/md.h                               |   9 +-
 drivers/md/raid0.c                            |   4 +-
 drivers/md/raid1.c                            |   4 +-
 drivers/md/raid10.c                           |   4 +-
 drivers/media/cec/core/cec-adap.c             |   5 +
 .../media/common/videobuf2/videobuf2-core.c   |   2 +
 .../media/common/videobuf2/videobuf2-v4l2.c   |   7 +
 drivers/media/dvb-core/dvb_frontend.c         |   1 +
 drivers/media/dvb-core/dvb_vb2.c              |   2 +
 drivers/media/dvb-frontends/bcm3510.c         |   2 +-
 drivers/media/dvb-frontends/dib0070.c         |   4 +-
 drivers/media/dvb-frontends/dib0090.c         |   8 +-
 drivers/media/dvb-frontends/dib7000m.c        |   4 +-
 drivers/media/dvb-frontends/dib7000p.c        |   4 +-
 drivers/media/dvb-frontends/dib8000.c         |  10 +-
 drivers/media/dvb-frontends/dib9000.c         |  43 +++---
 drivers/media/dvb-frontends/dibx000_common.c  |  10 +-
 drivers/media/dvb-frontends/stv090x.c         |   2 +
 drivers/media/dvb-frontends/stv0910.c         |   1 +
 drivers/media/dvb-frontends/ts2020.c          |   2 +
 drivers/media/mc/mc-device.c                  |   1 +
 drivers/media/mc/mc-entity.c                  |   1 +
 drivers/media/pci/cx18/cx18-alsa.h            |   2 +
 drivers/media/pci/ddbridge/ddbridge-core.c    |   1 +
 drivers/media/pci/ivtv/ivtv-alsa.h            |   2 +
 drivers/media/pci/ivtv/ivtv-fileops.c         |   2 +
 drivers/media/pci/ivtv/ivtv-ioctl.c           |   3 +
 drivers/media/pci/ivtv/ivtv-yuv.c             |   3 +
 drivers/media/platform/amphion/vpu_v4l2.c     |   3 +
 .../platform/chips-media/coda/coda-jpeg.c     |   1 +
 .../mediatek/vcodec/decoder/mtk_vcodec_dec.c  |   2 +
 .../vcodec/decoder/mtk_vcodec_dec_pm.c        |   2 +
 .../mediatek/vcodec/encoder/mtk_vcodec_enc.c  |   2 +
 .../media/platform/nvidia/tegra-vde/h264.c    |   5 +
 drivers/media/platform/nvidia/tegra-vde/vde.c |   2 +
 .../platform/samsung/exynos4-is/media-dev.h   |   2 +
 .../media/platform/samsung/s5p-mfc/s5p_mfc.c  |   2 +
 drivers/media/platform/st/sti/hva/hva-hw.c    |   1 +
 drivers/media/platform/ti/omap3isp/ispvideo.c |   2 +
 .../test-drivers/vivid/vivid-kthread-cap.c    |   1 +
 drivers/media/usb/dvb-usb-v2/af9035.c         |   2 +-
 drivers/media/usb/dvb-usb-v2/anysee.c         |   2 +-
 drivers/media/usb/dvb-usb-v2/au6610.c         |   2 +-
 drivers/media/usb/dvb-usb-v2/az6007.c         |   6 +-
 drivers/media/usb/dvb-usb-v2/ce6230.c         |   2 +-
 drivers/media/usb/dvb-usb-v2/dvbsky.c         |   2 +-
 drivers/media/usb/dvb-usb-v2/ec168.c          |   2 +-
 drivers/media/usb/dvb-usb-v2/lmedm04.c        |   2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c   |   2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf.c       |   2 +
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c       |   2 +-
 drivers/media/usb/dvb-usb/af9005.c            |   2 +-
 drivers/media/usb/dvb-usb/az6027.c            |   2 +-
 drivers/media/usb/dvb-usb/cxusb-analog.c      |   1 +
 drivers/media/usb/dvb-usb/cxusb.c             |   3 +-
 drivers/media/usb/dvb-usb/dib0700_core.c      |  20 +--
 drivers/media/usb/dvb-usb/dibusb-common.c     |   2 +-
 drivers/media/usb/dvb-usb/digitv.c            |   2 +-
 drivers/media/usb/dvb-usb/dtv5100.c           |   2 +-
 drivers/media/usb/dvb-usb/dvb-usb-urb.c       |   3 +-
 drivers/media/usb/dvb-usb/dw2102.c            |  16 +-
 drivers/media/usb/dvb-usb/gp8psk.c            |   6 +-
 drivers/media/usb/dvb-usb/m920x.c             |   2 +-
 drivers/media/usb/dvb-usb/opera1.c            |   4 +-
 drivers/media/usb/dvb-usb/pctv452e.c          |   4 +-
 drivers/media/usb/dvb-usb/technisat-usb2.c    |  10 +-
 drivers/media/usb/dvb-usb/ttusb2.c            |   2 +-
 drivers/media/usb/dvb-usb/vp702x.c            |   5 +-
 drivers/media/usb/go7007/go7007-i2c.c         |   3 +
 drivers/media/usb/gspca/finepix.c             |   1 +
 drivers/media/usb/gspca/jl2005bcd.c           |   1 +
 drivers/media/usb/gspca/sn9c20x.c             |   1 +
 drivers/media/usb/gspca/sonixj.c              |   1 +
 drivers/media/usb/gspca/sq905.c               |   2 +
 drivers/media/usb/gspca/sq905c.c              |   1 +
 drivers/media/usb/gspca/vicam.c               |   1 +
 drivers/media/usb/gspca/zc3xx.c               |   1 +
 drivers/media/usb/hdpvr/hdpvr-video.c         |   1 +
 drivers/media/usb/pvrusb2/pvrusb2-context.c   |   2 +
 .../media/usb/ttusb-budget/dvb-ttusb-budget.c |   4 +-
 drivers/media/usb/uvc/uvc_ctrl.c              |   7 +-
 drivers/media/v4l2-core/v4l2-event.c          |   1 +
 drivers/media/v4l2-core/v4l2-ioctl.c          |   1 +
 drivers/media/v4l2-core/v4l2-mem2mem.c        |   1 +
 drivers/media/v4l2-core/v4l2-subdev.c         |   1 +
 drivers/message/fusion/mptctl.c               |  11 +-
 drivers/message/fusion/mptscsih.c             |   4 +-
 drivers/mfd/88pm860x-core.c                   |   2 +
 drivers/mfd/atc260x-core.c                    |   2 +
 drivers/mfd/kempld-core.c                     |   2 +
 drivers/mfd/lp8788-irq.c                      |   2 +
 drivers/mfd/max8925-core.c                    |   2 +
 drivers/mfd/max8997-irq.c                     |   2 +
 drivers/mfd/max8998-irq.c                     |   2 +
 drivers/mfd/mc13xxx-core.c                    |   2 +
 drivers/mfd/mt6358-irq.c                      |   2 +
 drivers/mfd/mt6397-irq.c                      |   2 +
 drivers/mfd/rc5t583-irq.c                     |   2 +
 drivers/mfd/stmfx.c                           |   2 +
 drivers/mfd/stmpe.c                           |   2 +
 drivers/mfd/tps65217.c                        |   2 +
 drivers/mfd/tps6586x.c                        |   2 +
 drivers/mfd/twl4030-irq.c                     |   2 +
 drivers/mfd/wm831x-irq.c                      |   2 +
 drivers/mfd/wm8350-irq.c                      |   2 +
 drivers/misc/cardreader/rtsx_usb.c            |   2 +
 drivers/misc/mei/client.c                     |   7 +
 drivers/misc/mei/hbm.c                        |   1 +
 drivers/misc/mei/hw-me.c                      |   9 ++
 drivers/misc/mei/hw-txe.c                     |   4 +
 drivers/misc/mei/main.c                       |   1 +
 drivers/misc/nsm.c                            |   2 +-
 drivers/misc/ntsync.c                         |   2 +
 drivers/misc/sgi-gru/grufault.c               |   3 +
 drivers/misc/sgi-gru/grumain.c                |   1 +
 drivers/misc/vmw_vmci/vmci_queue_pair.c       |   2 +
 drivers/mmc/host/vub300.c                     |   2 +
 drivers/mtd/chips/cfi_cmdset_0001.c           |   4 +
 drivers/mtd/chips/cfi_cmdset_0002.c           |   6 +
 drivers/mtd/lpddr/lpddr_cmds.c                |   4 +
 drivers/mtd/nand/ecc-mtk.c                    |   2 +
 drivers/mtd/nand/ecc-mxic.c                   |   2 +
 drivers/mtd/nand/raw/atmel/pmecc.c            |   2 +
 drivers/mtd/nand/raw/nand_base.c              |   4 +
 drivers/mtd/spi-nor/controllers/hisi-sfc.c    |   2 +
 drivers/mtd/spi-nor/core.c                    |   6 +
 drivers/net/can/softing/softing_main.c        |   1 +
 drivers/net/dsa/microchip/ksz_common.c        |   2 +
 drivers/net/dsa/microchip/ksz_common.h        |   2 +
 drivers/net/dsa/microchip/ksz_ptp.c           |   2 +
 drivers/net/dsa/mt7530-mdio.c                 |   2 +
 drivers/net/dsa/mt7530.c                      |   2 +
 drivers/net/dsa/mv88e6xxx/chip.c              |   3 +
 drivers/net/dsa/mv88e6xxx/chip.h              |   2 +
 drivers/net/dsa/mv88e6xxx/global2.c           |   2 +
 drivers/net/dsa/mv88e6xxx/pcs-6352.c          |   2 +
 drivers/net/dsa/mv88e6xxx/phy.c               |   2 +
 drivers/net/dsa/qca/ar9331.c                  |   2 +
 drivers/net/dsa/realtek/rtl83xx.c             |   2 +
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c   |   2 +
 .../net/ethernet/broadcom/bnx2x/bnx2x_cmn.c   |   2 +
 .../net/ethernet/broadcom/bnx2x/bnx2x_sriov.c |   2 +
 .../net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c  |   2 +
 .../net/ethernet/broadcom/bnxt/bnxt_hwrm.c    |   2 +
 drivers/net/ethernet/broadcom/tg3.c           |   1 +
 drivers/net/ethernet/davicom/dm9000.c         |   1 +
 drivers/net/ethernet/davicom/dm9051.c         |   2 +
 drivers/net/ethernet/emulex/benet/be_cmds.c   |   2 +
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  |   2 +
 drivers/net/ethernet/hisilicon/hns3/hnae3.c   |   2 +
 .../hisilicon/hns3/hns3pf/hclge_main.c        |   1 +
 drivers/net/ethernet/intel/e1000e/82571.c     |   3 +
 drivers/net/ethernet/intel/e1000e/ich8lan.c   |   2 +
 drivers/net/ethernet/intel/iavf/iavf_main.c   |   3 +-
 drivers/net/ethernet/intel/ice/ice_common.c   |   1 +
 drivers/net/ethernet/intel/ice/ice_dcb_lib.c  |  49 +++---
 drivers/net/ethernet/intel/ice/ice_ddp.c      |   2 +
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |   1 +
 drivers/net/ethernet/intel/ice/ice_main.c     |   1 +
 drivers/net/ethernet/intel/ice/ice_vf_lib.c   |   1 +
 drivers/net/ethernet/intel/idpf/idpf.h        |   2 +
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |   3 +
 .../marvell/octeontx2/af/rvu_npc_fs.c         |   1 +
 .../ethernet/marvell/octeontx2/nic/otx2_pf.c  |   2 +-
 .../net/ethernet/marvell/octeontx2/nic/rep.c  |   1 +
 .../marvell/prestera/prestera_counter.c       |   4 +
 .../ethernet/marvell/prestera/prestera_pci.c  |   2 +
 drivers/net/ethernet/mellanox/mlx4/cmd.c      |   2 +
 drivers/net/ethernet/mellanox/mlx4/port.c     |   5 +
 .../ethernet/mellanox/mlx5/core/en/mod_hdr.c  |   1 +
 .../mellanox/mlx5/core/en/reporter_rx.c       |   2 +
 .../mellanox/mlx5/core/en/tc/ct_fs_hmfs.c     |   1 +
 .../mellanox/mlx5/core/en/tc/ct_fs_smfs.c     |   1 +
 .../mellanox/mlx5/core/en/tc/int_port.c       |   1 +
 .../mellanox/mlx5/core/en/tc_tun_encap.c      |   3 +
 .../mellanox/mlx5/core/en_accel/macsec.c      |  62 +++-----
 .../net/ethernet/mellanox/mlx5/core/en_tc.c   |   1 +
 .../net/ethernet/mellanox/mlx5/core/esw/qos.c |   2 +
 .../net/ethernet/mellanox/mlx5/core/main.c    |   2 +
 .../mellanox/mlx5/core/steering/hws/bwc.c     |   2 +
 .../mlx5/core/steering/sws/dr_types.h         |   6 +
 drivers/net/ethernet/mellanox/mlxsw/i2c.c     |   4 +-
 drivers/net/ethernet/micrel/ks8851_spi.c      |   2 +
 .../ethernet/microchip/encx24j600-regmap.c    |   2 +
 .../net/ethernet/microchip/vcap/vcap_api.c    |   4 +
 .../netronome/nfp/nfpcore/nfp_cppcore.c       |   2 +
 drivers/net/ethernet/qlogic/qed/qed_ll2.c     |   1 +
 drivers/net/ethernet/qlogic/qed/qed_vf.c      |   4 +-
 drivers/net/ethernet/qlogic/qede/qede_main.c  |   7 +
 drivers/net/ethernet/sfc/ef10_sriov.c         |   1 +
 drivers/net/ethernet/sfc/efx_common.c         |   5 +
 drivers/net/ethernet/sfc/falcon/efx.c         |   2 +
 drivers/net/ethernet/sfc/mcdi_filters.c       |   1 +
 drivers/net/ethernet/sfc/siena/efx_common.c   |   3 +
 drivers/net/ethernet/xilinx/xilinx_axienet.h  |   2 +
 drivers/net/macsec.c                          |   1 +
 drivers/net/mctp/mctp-i3c.c                   |   7 +-
 drivers/net/phy/dp83640.c                     |   2 +
 drivers/net/phy/phy-core.c                    |   3 +
 drivers/net/phy/phy_device.c                  |   1 +
 drivers/net/phy/sfp-bus.c                     |   1 +
 drivers/net/pse-pd/pse_core.c                 |   2 +-
 drivers/net/team/team_core.c                  |   2 +
 drivers/net/tun.c                             |   1 +
 drivers/net/usb/cdc_subset.c                  |   2 +-
 drivers/net/usb/hso.c                         |   2 +
 drivers/net/usb/lan78xx.c                     |   2 +
 drivers/net/wireless/ath/ath12k/core.c        |   4 +-
 drivers/net/wireless/ath/ath6kl/sdio.c        |   1 +
 drivers/net/wireless/ath/ath9k/hif_usb.c      |   1 +
 drivers/net/wireless/ath/wil6210/main.c       |   1 +
 drivers/net/wireless/ath/wil6210/p2p.c        |   2 +
 drivers/net/wireless/broadcom/b43/main.c      |   1 +
 .../net/wireless/broadcom/b43legacy/main.c    |   1 +
 .../broadcom/brcm80211/brcmfmac/fwvid.c       |   2 +
 drivers/net/wireless/intel/iwlwifi/dvm/lib.c  |   1 +
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c   |   3 +
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c  |   3 +
 .../wireless/intel/iwlwifi/mvm/time-event.c   |   2 +
 drivers/net/wireless/intersil/p54/p54pci.c    |   1 +
 drivers/net/wireless/intersil/p54/p54usb.c    |   3 +-
 drivers/net/wireless/marvell/mwl8k.c          |   2 +
 .../wireless/mediatek/mt76/mt7615/testmode.c  |   1 +
 .../net/wireless/mediatek/mt76/mt76_connac.h  |   2 +
 .../net/wireless/mediatek/mt76/mt7915/main.c  |   1 +
 .../wireless/mediatek/mt76/mt7915/testmode.c  |   5 +
 .../net/wireless/mediatek/mt76/mt7925/main.c  |   6 +-
 .../net/wireless/microchip/wilc1000/wlan.c    |   2 +
 drivers/net/wireless/quantenna/qtnfmac/bus.h  |   2 +
 drivers/net/wireless/realtek/rtw88/main.c     |   1 +
 drivers/net/wireless/realtek/rtw89/core.c     |   1 +
 drivers/net/wireless/realtek/rtw89/mac80211.c |   2 +
 drivers/net/wireless/realtek/rtw89/wow.c      |   4 +
 drivers/net/wireless/realtek/rtw89/wow.h      |   2 +-
 drivers/net/wireless/rsi/rsi_91x_hal.c        |   1 +
 drivers/net/wireless/st/cw1200/pm.c           |   2 +
 drivers/net/wireless/ti/wl12xx/main.c         |   1 +
 drivers/net/wireless/ti/wlcore/main.c         |   4 +
 drivers/net/wireless/ti/wlcore/sysfs.c        |   2 +-
 drivers/net/wireless/zydas/zd1211rw/zd_usb.c  |   2 +
 drivers/nvdimm/bus.c                          |   1 +
 drivers/nvdimm/core.c                         |   2 +
 drivers/nvdimm/namespace_devs.c               |   1 +
 drivers/nvme/host/core.c                      |   2 +
 drivers/nvme/host/pci.c                       |   1 +
 drivers/nvmem/sc27xx-efuse.c                  |   2 +
 drivers/nvmem/sprd-efuse.c                    |   2 +
 drivers/of/dynamic.c                          |   4 +
 drivers/of/overlay.c                          |   2 +
 drivers/opp/core.c                            |   2 +
 drivers/pci/pci.c                             |  10 ++
 drivers/pci/pcie/bwctrl.c                     |   1 +
 drivers/pci/probe.c                           |   2 +
 drivers/pci/switch/switchtec.c                |   1 +
 drivers/pcmcia/rsrc_nonstatic.c               |   1 +
 drivers/perf/arm-cci.c                        |   1 +
 drivers/pinctrl/pinctrl-aw9523.c              |   2 +
 drivers/pinctrl/pinctrl-cy8c95x0.c            |   2 +
 drivers/pinctrl/pinctrl-mcp23s08.c            |   2 +
 drivers/pinctrl/pinctrl-stmfx.c               |   2 +
 drivers/pinctrl/pinctrl-sx150x.c              |   2 +
 drivers/platform/chrome/cros_ec_lpc_mec.c     |   2 +
 .../platform/cznic/turris-omnia-mcu-gpio.c    |   2 +
 .../platform/x86/intel/crystal_cove_charger.c |   2 +
 drivers/platform/x86/thinkpad_acpi.c          |  12 +-
 drivers/pmdomain/core.c                       |   4 +
 drivers/pmdomain/rockchip/pm-domains.c        |   2 +
 drivers/pnp/isapnp/core.c                     |  18 ++-
 drivers/power/supply/da9150-fg.c              |   2 +
 drivers/power/supply/power_supply_core.c      |   1 +
 drivers/pwm/core.c                            |   8 +
 drivers/regulator/core.c                      |   2 +
 drivers/remoteproc/mtk_scp_ipi.c              |   2 +
 drivers/s390/char/tape_std.h                  |   2 +
 drivers/scsi/aacraid/aachba.c                 |   4 +-
 drivers/scsi/aacraid/commctrl.c               |   1 +
 drivers/scsi/arm/acornscsi.c                  |   2 +-
 drivers/scsi/fnic/fnic_scsi.c                 |   1 +
 drivers/scsi/hpsa.c                           |   2 +-
 drivers/scsi/ips.c                            |   8 +-
 drivers/scsi/libfc/fc_disc.c                  |   6 +-
 drivers/scsi/libiscsi.c                       |   1 +
 drivers/scsi/megaraid.c                       |  10 +-
 drivers/scsi/megaraid/megaraid_mbox.c         |  10 +-
 drivers/scsi/megaraid/megaraid_sas.h          |   3 +-
 drivers/scsi/megaraid/megaraid_sas_base.c     |  20 ++-
 drivers/scsi/megaraid/megaraid_sas_fusion.c   |   2 +
 drivers/scsi/mpi3mr/mpi3mr_app.c              |   1 +
 drivers/scsi/mpt3sas/mpt3sas_base.c           |  12 +-
 drivers/scsi/scsi_transport_iscsi.c           |   1 +
 drivers/scsi/sg.c                             |   1 +
 drivers/scsi/smartpqi/smartpqi_init.c         |  18 +++
 drivers/siox/siox-core.c                      |   2 +
 drivers/soc/qcom/qcom_pd_mapper.c             |   1 +
 drivers/soc/tegra/pmc.c                       |   1 +
 drivers/soundwire/stream.c                    |   3 +
 drivers/spi/spi-mem.c                         |   2 +
 drivers/spi/spi.c                             |   3 +
 drivers/ssb/main.c                            |   2 +
 drivers/staging/Makefile                      |   2 +
 .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c        |   4 +-
 drivers/staging/greybus/light.c               |   2 +
 .../interface/vchiq_arm/vchiq_core.c          |   1 +
 drivers/target/iscsi/iscsi_target_tpg.c       |   1 +
 drivers/target/target_core_device.c           |   9 +-
 drivers/target/target_core_pr.c               |   6 +-
 drivers/target/target_core_spc.c              |  20 +--
 drivers/tee/amdtee/core.c                     |   1 +
 drivers/thermal/mediatek/auxadc_thermal.c     |   2 +
 drivers/thermal/tegra/soctherm.c              |   2 +
 drivers/thermal/thermal_debugfs.c             |   4 +
 drivers/tty/n_tty.c                           |   1 +
 drivers/tty/serial/sc16is7xx.c                |   2 +
 drivers/tty/tty_buffer.c                      |   2 +
 drivers/tty/tty_io.c                          |   8 +-
 drivers/tty/tty_mutex.c                       |   5 +
 drivers/ufs/core/ufshcd.c                     |   4 +
 drivers/usb/class/cdc-wdm.c                   |   6 +-
 drivers/usb/class/usblp.c                     |   5 +-
 drivers/usb/class/usbtmc.c                    |   3 +
 drivers/usb/core/devio.c                      |   7 +
 drivers/usb/core/hcd-pci.c                    |   2 +
 drivers/usb/core/hub.c                        |   7 +
 drivers/usb/core/message.c                    |   2 +-
 drivers/usb/core/sysfs.c                      |  24 +--
 drivers/usb/gadget/configfs.c                 |   6 +
 drivers/usb/gadget/function/f_fs.c            |  14 +-
 drivers/usb/gadget/function/f_mass_storage.c  |   4 +-
 drivers/usb/gadget/function/u_fs.h            |   2 +
 drivers/usb/gadget/legacy/inode.c             |  14 +-
 drivers/usb/misc/yurex.c                      |   2 +-
 drivers/usb/serial/mos7720.c                  |   2 +
 drivers/usb/serial/usb-serial.c               |   3 +
 drivers/usb/storage/debug.c                   |   4 +-
 drivers/usb/storage/transport.c               |   3 +-
 drivers/usb/storage/usb.c                     |   2 +
 drivers/usb/typec/tcpm/tcpm.c                 |  16 ++
 drivers/usb/usb-skeleton.c                    |   2 +-
 drivers/usb/usbip/stub_dev.c                  |   2 +-
 drivers/usb/usbip/stub_main.c                 |   1 +
 drivers/usb/usbip/stub_rx.c                   |   2 +-
 drivers/vdpa/vdpa_sim/vdpa_sim_blk.c          |   2 +
 drivers/vfio/group.c                          |   1 +
 drivers/vfio/pci/mlx5/cmd.h                   |   3 +-
 drivers/vfio/pci/virtio/migrate.c             |   1 +
 drivers/vfio/vfio_iommu_type1.c               |   1 +
 drivers/vhost/vhost.c                         |   3 +
 drivers/video/fbdev/core/fb_procfs.c          |   2 +
 drivers/video/fbdev/smscufx.c                 |   1 +
 drivers/video/fbdev/udlfb.c                   |   1 +
 drivers/virt/vboxguest/vboxguest_linux.c      |   2 +
 drivers/virtio/virtio_mem.c                   |   5 +
 drivers/w1/masters/omap_hdq.c                 |   8 +-
 drivers/w1/slaves/w1_therm.c                  |   9 ++
 drivers/w1/w1.c                               |   3 +
 drivers/w1/w1_netlink.c                       |   1 +
 drivers/xen/balloon.c                         |   2 +
 drivers/xen/xen-pciback/passthrough.c         |   1 +
 drivers/xen/xen-pciback/vpci.c                |   1 +
 drivers/xen/xenbus/xenbus_comms.c             |   1 +
 drivers/xen/xenbus/xenbus_xs.c                |   4 +
 fs/affs/affs.h                                |   6 +
 fs/afs/validation.c                           |   3 +-
 fs/afs/vl_alias.c                             |   6 +-
 fs/autofs/waitq.c                             |   3 +
 fs/bcachefs/alloc_foreground.c                |   4 +
 fs/bcachefs/alloc_foreground.h                |   1 +
 fs/bcachefs/btree_locking.c                   |   1 +
 fs/bcachefs/btree_write_buffer.c              |   4 +
 fs/bcachefs/debug.c                           |   2 +
 fs/bcachefs/ec.c                              |   3 +
 fs/bcachefs/fs-ioctl.c                        |   1 +
 fs/bcachefs/fs.c                              |   4 +
 fs/bcachefs/io_write.c                        |   3 +
 fs/bcachefs/journal.c                         |   2 +
 fs/bcachefs/quota.c                           |   2 +
 fs/bcachefs/seqmutex.h                        |   4 +
 fs/btrfs/block-group.c                        |   2 +
 fs/btrfs/delayed-ref.c                        |   4 +
 fs/btrfs/delayed-ref.h                        |   1 +
 fs/btrfs/extent-tree.c                        |   1 +
 fs/btrfs/free-space-cache.c                   |   1 +
 fs/btrfs/ioctl.c                              |   2 +
 fs/btrfs/qgroup.c                             |   1 +
 fs/btrfs/scrub.c                              |   2 +
 fs/btrfs/tests/delayed-refs-tests.c           |   1 +
 fs/btrfs/tree-log.c                           |   2 +
 fs/btrfs/volumes.c                            |   4 +
 fs/btrfs/zoned.h                              |   4 +
 fs/ceph/caps.c                                |   4 +
 fs/ceph/mds_client.c                          |   1 +
 fs/coda/upcall.c                              |   1 +
 fs/dcache.c                                   |   1 +
 fs/dlm/recoverd.c                             |   2 +
 fs/ecryptfs/main.c                            |   1 +
 fs/ecryptfs/messaging.c                       |   1 +
 fs/erofs/zdata.c                              |   3 +
 fs/eventpoll.c                                |   3 +
 fs/exec.c                                     |   4 +
 fs/ext4/fast_commit.c                         |   1 +
 fs/ext4/mballoc.c                             |   2 +
 fs/f2fs/data.c                                |   1 +
 fs/fat/fatent.c                               |   2 +
 fs/fat/inode.c                                |   2 +
 fs/file.c                                     |   2 +
 fs/fsopen.c                                   |   2 +-
 fs/fuse/inode.c                               |   2 +
 fs/gfs2/rgrp.c                                |   2 +
 fs/gfs2/util.c                                |   1 +
 fs/hfs/bfind.c                                |   2 +
 fs/hfsplus/bfind.c                            |   2 +
 fs/hfsplus/extents.c                          |   2 +
 fs/hpfs/hpfs_fn.h                             |   2 +
 fs/jbd2/checkpoint.c                          |   2 +
 fs/jbd2/commit.c                              |   1 +
 fs/jbd2/journal.c                             |   5 +
 fs/jbd2/transaction.c                         |   2 +
 fs/jffs2/dir.c                                |   4 +
 fs/jffs2/fs.c                                 |   1 +
 fs/jffs2/gc.c                                 |   1 +
 fs/jffs2/nodemgmt.c                           |   2 +
 fs/jffs2/write.c                              |   2 +
 fs/jfs/namei.c                                |   1 +
 fs/kernfs/file.c                              |   9 ++
 fs/lockd/host.c                               |   1 +
 fs/lockd/svclock.c                            |   1 +
 fs/namei.c                                    |   4 +
 fs/namespace.c                                |   2 +-
 fs/netfs/write_issue.c                        |   2 +
 fs/nfsd/nfs4layouts.c                         |   2 +
 fs/nfsd/nfs4proc.c                            |   2 +
 fs/nfsd/nfs4state.c                           |  11 ++
 fs/ntfs3/frecord.c                            |   4 +-
 fs/ntfs3/inode.c                              |   1 +
 fs/ntfs3/namei.c                              |   2 +
 fs/ntfs3/ntfs_fs.h                            |   4 +
 fs/ntfs3/record.c                             |   1 +
 fs/ntfs3/xattr.c                              |   2 +
 fs/ocfs2/cluster/nodemanager.c                |   2 +
 fs/ocfs2/dlmglue.c                            |   2 +
 fs/ocfs2/inode.c                              |   2 +
 fs/ocfs2/refcounttree.c                       |   2 +
 fs/orangefs/devorangefs-req.c                 |   2 +-
 fs/orangefs/orangefs-debugfs.c                |   2 +
 fs/orangefs/waitqueue.c                       |   1 +
 fs/overlayfs/overlayfs.h                      |   3 +
 fs/pipe.c                                     |   2 +
 fs/proc/base.c                                |   2 +-
 fs/proc/proc_tty.c                            |   2 +
 fs/pstore/zone.c                              |   1 +
 fs/smb/client/cifsglob.h                      |   2 +
 fs/smb/client/connect.c                       |   3 +-
 fs/smb/client/fs_context.h                    |   2 +
 fs/smb/client/smbdirect.c                     |   2 +
 fs/smb/client/smbdirect.h                     |   2 +-
 fs/smb/server/connection.h                    |   6 +-
 fs/super.c                                    |   6 +
 fs/ubifs/compress.c                           |   2 +
 fs/ubifs/dir.c                                |   4 +
 fs/ubifs/file.c                               |   6 +
 fs/ubifs/journal.c                            |   3 +
 fs/ubifs/misc.h                               |   2 +
 fs/xfs/scrub/dirtree.c                        |   2 +
 fs/xfs/scrub/dirtree_repair.c                 |   3 +
 fs/xfs/scrub/quota.c                          |   1 +
 fs/xfs/scrub/quota_repair.c                   |   3 +
 fs/xfs/scrub/quotacheck_repair.c              |   3 +
 fs/xfs/scrub/rmap_repair.c                    |   1 +
 fs/xfs/scrub/rtrmap_repair.c                  |   1 +
 fs/xfs/xfs_dquot.c                            |   7 +
 fs/xfs/xfs_dquot.h                            |  10 +-
 fs/xfs/xfs_dquot_item.c                       |   2 +
 fs/xfs/xfs_qm.c                               |   3 +
 fs/xfs/xfs_qm_syscalls.c                      |   1 +
 fs/xfs/xfs_trans_dquot.c                      |   3 +
 include/linux/blkdev.h                        |  11 +-
 include/linux/cgroup.h                        |   2 +
 include/linux/cleanup.h                       |  34 ++++-
 include/linux/device.h                        |  13 +-
 include/linux/fb.h                            |   2 +
 include/linux/fpga/fpga-bridge.h              |   2 +-
 include/linux/fpga/fpga-mgr.h                 |   4 +-
 include/linux/fsnotify_backend.h              |   2 +
 include/linux/gameport.h                      |   1 +
 include/linux/kref.h                          |   3 +
 include/linux/memory_hotplug.h                |   2 +
 include/linux/mfd/si476x-core.h               |   2 +
 include/linux/mutex.h                         |  46 +++---
 include/linux/mutex_types.h                   |   5 +-
 include/linux/netdevice.h                     |   2 +
 include/linux/phy.h                           |   2 +
 include/linux/refcount.h                      |   5 +-
 include/linux/thread_safety.h                 | 141 ++++++++++++++++++
 include/linux/usb.h                           |   3 +-
 include/media/v4l2-ctrls.h                    |   2 +
 include/media/v4l2-subdev.h                   |   5 +
 include/net/bluetooth/l2cap.h                 |   2 +
 include/net/cfg80211.h                        |   2 +
 include/scsi/scsi_proto.h                     |   4 +-
 include/sound/emu10k1.h                       |  12 +-
 include/sound/i2c.h                           |   2 +
 include/sound/soc-card.h                      |   3 +
 include/sound/soc.h                           |  14 ++
 include/trace/events/scsi.h                   |   4 +-
 include/trace/events/target.h                 |   4 +-
 io_uring/cancel.c                             |   1 +
 io_uring/fdinfo.c                             |   1 +
 io_uring/io_uring.c                           |   5 +
 io_uring/io_uring.h                           |   2 +
 io_uring/msg_ring.c                           |   3 +
 io_uring/register.c                           |   6 +
 io_uring/rsrc.c                               |   3 +
 io_uring/sqpoll.c                             |   3 +
 io_uring/tctx.c                               |   1 +
 kernel/acct.c                                 |   3 +
 kernel/audit.c                                |   2 +
 kernel/audit_tree.c                           |   2 +
 kernel/audit_watch.c                          |   1 +
 kernel/bpf/btf.c                              |   1 +
 kernel/bpf/cgroup_iter.c                      |   2 +
 kernel/bpf/verifier.c                         |   1 +
 kernel/cgroup/cgroup-v1.c                     |   4 +
 kernel/cgroup/cgroup.c                        |  18 +++
 kernel/cgroup/cpuset.c                        |   2 +
 kernel/cpu.c                                  |   2 +
 kernel/events/callchain.c                     |   1 +
 kernel/events/core.c                          |   9 ++
 kernel/events/hw_breakpoint.c                 |   2 +
 kernel/fail_function.c                        |   2 +
 kernel/futex/core.c                           |   3 +
 kernel/irq/autoprobe.c                        |   3 +
 kernel/irq/irqdesc.c                          |   2 +
 kernel/irq/msi.c                              |   2 +
 kernel/jump_label.c                           |   2 +
 kernel/kprobes.c                              |   3 +
 kernel/locking/locktorture.c                  |   4 +
 kernel/locking/mutex.c                        |  20 ++-
 kernel/module/main.c                          |   1 +
 kernel/module/procfs.c                        |   2 +
 kernel/params.c                               |   2 +
 kernel/power/autosleep.c                      |   2 +
 kernel/power/main.c                           |   2 +
 kernel/printk/printk.c                        |   2 +
 kernel/rcu/srcutree.c                         |   4 +-
 kernel/rcu/tree_exp.h                         |   1 +
 kernel/sched/core.c                           |   1 +
 kernel/seccomp.c                              |  11 +-
 kernel/static_call_inline.c                   |   2 +
 kernel/torture.c                              |   2 +
 kernel/trace/ftrace.c                         |   7 +
 kernel/trace/ring_buffer.c                    |   2 +
 kernel/trace/rv/rv.c                          |   3 +
 kernel/trace/rv/rv_reactors.c                 |   2 +
 kernel/trace/trace.c                          |  12 ++
 kernel/trace/trace_dynevent.c                 |   2 +
 kernel/trace/trace_events.c                   |  10 ++
 kernel/trace/trace_events_trigger.c           |   2 +
 kernel/trace/trace_events_user.c              |   1 +
 kernel/trace/trace_hwlat.c                    |   2 +
 kernel/trace/trace_osnoise.c                  |   2 +
 kernel/trace/trace_printk.c                   |   8 +
 kernel/trace/trace_recursion_record.c         |   2 +
 kernel/trace/trace_stat.c                     |   2 +
 kernel/trace/trace_uprobe.c                   |   2 +
 kernel/workqueue.c                            |   2 +
 lib/Makefile                                  |   2 +
 lib/dynamic_debug.c                           |   2 +
 lib/error-inject.c                            |   2 +
 lib/kunit/platform.c                          |   1 +
 lib/once.c                                    |   2 +
 mm/damon/sysfs.c                              |   3 +
 mm/hugetlb.c                                  |   4 +
 mm/kmemleak.c                                 |   6 +-
 mm/ksm.c                                      |   1 +
 mm/oom_kill.c                                 |   1 +
 mm/page_alloc.c                               |   4 +
 mm/percpu.c                                   |   1 +
 mm/slab_common.c                              |   2 +
 mm/swap_slots.c                               |   2 +
 mm/swapfile.c                                 |   2 +
 mm/vma.c                                      |   2 +
 mm/zswap.c                                    |   2 +
 net/atm/resources.c                           |   2 +
 net/bluetooth/l2cap_core.c                    |   9 ++
 net/bluetooth/l2cap_sock.c                    |   2 +
 net/bluetooth/rfcomm/sock.c                   |   1 +
 net/bridge/netfilter/ebtables.c               |   5 +
 net/caif/caif_socket.c                        |   2 +
 net/can/j1939/main.c                          |   2 +
 net/ceph/messenger.c                          |   3 +
 net/ceph/messenger_v1.c                       |   2 +
 net/ceph/messenger_v2.c                       |  14 ++
 net/core/dev.c                                |   4 +
 net/core/drop_monitor.c                       |   2 +
 net/core/netdev-genl.c                        |   5 +
 net/core/pktgen.c                             |   1 +
 net/core/rtnetlink.c                          |  12 ++
 net/core/sock.c                               |   2 +
 net/devlink/core.c                            |   3 +
 net/devlink/devl_internal.h                   |   2 +
 net/ethtool/ioctl.c                           |   1 +
 net/ipv6/mcast.c                              |   1 +
 net/mac802154/cfg.c                           |   2 +
 net/mac802154/mib.c                           |   2 +
 net/netfilter/ipset/ip_set_core.c             |   2 +
 net/netfilter/ipvs/ip_vs_app.c                |   2 +
 net/netfilter/nf_log.c                        |   2 +
 net/netfilter/nf_tables_api.c                 |   5 +
 net/netfilter/nfnetlink.c                     |   2 +
 net/netfilter/x_tables.c                      |   8 +
 net/netfilter/xt_hashlimit.c                  |   1 +
 net/netlink/af_netlink.c                      |   2 +
 net/netlink/genetlink.c                       |   7 +
 net/openvswitch/datapath.c                    |   2 +
 net/phonet/socket.c                           |   2 +
 net/qrtr/af_qrtr.c                            |   1 +
 net/rds/ib_cm.c                               |   1 +
 net/rds/rdma_transport.c                      |   1 +
 net/rds/tcp_listen.c                          |   1 +
 net/rxrpc/af_rxrpc.c                          |   1 +
 net/rxrpc/call_object.c                       |   1 +
 net/rxrpc/recvmsg.c                           |   2 +-
 net/rxrpc/sendmsg.c                           |   5 +-
 net/sched/act_api.c                           |   1 +
 net/sched/cls_api.c                           |   1 +
 net/shaper/shaper.c                           |   2 +
 net/smc/af_smc.c                              |   1 +
 net/sunrpc/rpc_pipe.c                         |   2 +
 net/sunrpc/svc_xprt.c                         |   2 +
 net/unix/af_unix.c                            |   1 +
 net/unix/unix_bpf.c                           |   1 +
 net/wireless/nl80211.c                        |   9 ++
 samples/vfio-mdev/mtty.c                      |   1 +
 scripts/Makefile.clang                        |   3 +
 security/apparmor/apparmorfs.c                |   3 +
 security/integrity/ima/ima_fs.c               |   2 +-
 security/integrity/ima/ima_main.c             |   1 +
 security/keys/keyring.c                       |   3 +
 security/tomoyo/gc.c                          |   3 +
 sound/core/compress_offload.c                 |   3 +
 sound/core/oss/pcm_oss.c                      |   9 ++
 sound/core/pcm_native.c                       |   8 +
 sound/core/seq/oss/seq_oss.c                  |   1 +
 sound/core/seq/seq_clientmgr.c                |   2 +
 sound/core/seq/seq_memory.c                   |   1 +
 sound/core/sound.c                            |   1 +
 sound/isa/gus/gus_mem.c                       |   3 +
 sound/pci/ac97/ac97_codec.c                   |   2 +
 sound/pci/hda/hda_intel.c                     |   1 +
 sound/pci/hda/patch_realtek.c                 |   2 +
 sound/pci/hda/tas2781_hda_i2c.c               |   1 +
 sound/pci/ice1712/ak4xxx.c                    |   2 +
 sound/pci/ice1712/delta.c                     |   4 +
 sound/pci/ice1712/ews.c                       |   6 +
 sound/pci/ice1712/hoontech.c                  |   1 +
 sound/pci/ice1712/ice1712.h                   |   2 +
 sound/pci/ice1712/prodigy192.c                |   2 +
 sound/pci/ice1712/revo.c                      |   4 +
 sound/pci/oxygen/oxygen_lib.c                 |   2 +-
 sound/pci/pcxhr/pcxhr_core.c                  |   1 +
 sound/soc/codecs/rt5677.c                     |   2 +
 sound/soc/codecs/wcd-mbhc-v2.c                |   7 +-
 sound/soc/soc-dapm.c                          |   9 ++
 sound/soc/soc-pcm.c                           |  25 ++++
 sound/soc/sof/intel/hda-mlink.c               |   2 +
 sound/soc/sof/ipc3-control.c                  |   1 +
 sound/soc/sof/ipc4-control.c                  |   1 +
 sound/synth/emux/soundfont.c                  |   2 +
 virt/kvm/kvm_main.c                           |   3 +
 910 files changed, 2635 insertions(+), 422 deletions(-)
 create mode 100644 include/linux/thread_safety.h
author maintainer
#1 lore raw

RFC PATCH 1/33 scsi, usb: Rename the RESERVE and RELEASE constants

The RESERVE(6) and RELEASE(6) commands are obsolete SCSI commands defined in the SCSI-2 standard. These commands have been replaced by PERSISTENT RESERVE IN and PERSISTENT RESERVE OUT. Rename RESERVE into RESERVE_6 and RELEASE into RELEASE_6 in preparation of introducing a new RELEASE macro in the new header file include/linux/thread_safety.h.

Cc Martin K. Petersen <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/message/fusion/mptscsih.c            |  4 ++--
 drivers/scsi/aacraid/aachba.c                |  4 ++--
 drivers/scsi/arm/acornscsi.c                 |  2 +-
 drivers/scsi/ips.c                           |  8 ++++----
 drivers/scsi/megaraid.c                      | 10 +++++-----
 drivers/scsi/megaraid/megaraid_mbox.c        | 10 +++++-----
 drivers/target/target_core_device.c          |  8 ++++----
 drivers/target/target_core_pr.c              |  6 +++---
 drivers/target/target_core_spc.c             | 20 ++++++++++----------
 drivers/usb/gadget/function/f_mass_storage.c |  4 ++--
 drivers/usb/storage/debug.c                  |  4 ++--
 include/scsi/scsi_proto.h                    |  4 ++--
 include/trace/events/scsi.h                  |  4 ++--
 include/trace/events/target.h                |  4 ++--
 14 files changed, 46 insertions(+), 46 deletions(-)
drivers/message/fusion/mptscsih.c +2 -2
index a9604ba3c805..f0746db92ca6 100644
@@ -2915,14 +2915,14 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
 		timeout = 10;
 		break;
 
-	case RESERVE:
+	case RESERVE_6:
 		cmdLen = 6;
 		dir = MPI_SCSIIO_CONTROL_READ;
 		CDB[0] = cmd;
 		timeout = 10;
 		break;
 
-	case RELEASE:
+	case RELEASE_6:
 		cmdLen = 6;
 		dir = MPI_SCSIIO_CONTROL_READ;
 		CDB[0] = cmd;
drivers/scsi/aacraid/aachba.c +2 -2
index abf6a82b74af..0be719f38377 100644
@@ -3221,8 +3221,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
 			break;
 		}
 		fallthrough;
-	case RESERVE:
-	case RELEASE:
+	case RESERVE_6:
+	case RELEASE_6:
 	case REZERO_UNIT:
 	case REASSIGN_BLOCKS:
 	case SEEK_10:
drivers/scsi/arm/acornscsi.c +1 -1
index e50a3dbf9de3..ef21b85cf014 100644
@@ -591,7 +591,7 @@ datadir_t acornscsi_datadirection(int command)
     case CHANGE_DEFINITION:	case COMPARE:		case COPY:
     case COPY_VERIFY:		case LOG_SELECT:	case MODE_SELECT:
     case MODE_SELECT_10:	case SEND_DIAGNOSTIC:	case WRITE_BUFFER:
-    case FORMAT_UNIT:		case REASSIGN_BLOCKS:	case RESERVE:
+    case FORMAT_UNIT:		case REASSIGN_BLOCKS:	case RESERVE_6:
     case SEARCH_EQUAL:		case SEARCH_HIGH:	case SEARCH_LOW:
     case WRITE_6:		case WRITE_10:		case WRITE_VERIFY:
     case UPDATE_BLOCK:		case WRITE_LONG:	case WRITE_SAME:
drivers/scsi/ips.c +4 -4
index cce6c6b409ad..94adb6ac02a4 100644
@@ -3631,8 +3631,8 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb)
 
 			break;
 
-		case RESERVE:
-		case RELEASE:
+		case RESERVE_6:
+		case RELEASE_6:
 			scb->scsi_cmd->result = DID_OK << 16;
 			break;
 
@@ -3899,8 +3899,8 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus)
 			case WRITE_6:
 			case READ_10:
 			case WRITE_10:
-			case RESERVE:
-			case RELEASE:
+			case RESERVE_6:
+			case RELEASE_6:
 				break;
 
 			case MODE_SENSE:
drivers/scsi/megaraid.c +5 -5
index adab151663dd..2006094af418 100644
@@ -855,8 +855,8 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 			return scb;
 
 #if MEGA_HAVE_CLUSTERING
-		case RESERVE:
-		case RELEASE:
+		case RESERVE_6:
+		case RELEASE_6:
 
 			/*
 			 * Do we support clustering and is the support enabled
@@ -875,7 +875,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 			}
 
 			scb->raw_mbox[0] = MEGA_CLUSTER_CMD;
-			scb->raw_mbox[2] = ( *cmd->cmnd == RESERVE ) ?
+			scb->raw_mbox[2] = *cmd->cmnd == RESERVE_6 ?
 				MEGA_RESERVE_LD : MEGA_RELEASE_LD;
 
 			scb->raw_mbox[3] = ldrv_num;
@@ -1618,8 +1618,8 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status)
 			 * failed or the input parameter is invalid
 			 */
 			if( status == 1 &&
-				(cmd->cmnd[0] == RESERVE ||
-					 cmd->cmnd[0] == RELEASE) ) {
+			    (cmd->cmnd[0] == RESERVE_6 ||
+			     cmd->cmnd[0] == RELEASE_6) ) {
 
 				cmd->result |= (DID_ERROR << 16) |
 					SAM_STAT_RESERVATION_CONFLICT;
drivers/scsi/megaraid/megaraid_mbox.c +5 -5
index 60cc3372991f..3ba837b3093f 100644
@@ -1725,8 +1725,8 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy)
 
 			return scb;
 
-		case RESERVE:
-		case RELEASE:
+		case RESERVE_6:
+		case RELEASE_6:
 			/*
 			 * Do we support clustering and is the support enabled
 			 */
@@ -1748,7 +1748,7 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy)
 			scb->dev_channel	= 0xFF;
 			scb->dev_target		= target;
 			ccb->raw_mbox[0]	= CLUSTER_CMD;
-			ccb->raw_mbox[2]	=  (scp->cmnd[0] == RESERVE) ?
+			ccb->raw_mbox[2]	= scp->cmnd[0] == RESERVE_6 ?
 						RESERVE_LD : RELEASE_LD;
 
 			ccb->raw_mbox[3]	= target;
@@ -2334,8 +2334,8 @@ megaraid_mbox_dpc(unsigned long devp)
 			 * Error code returned is 1 if Reserve or Release
 			 * failed or the input parameter is invalid
 			 */
-			if (status == 1 && (scp->cmnd[0] == RESERVE ||
-					 scp->cmnd[0] == RELEASE)) {
+			if (status == 1 && (scp->cmnd[0] == RESERVE_6 ||
+					    scp->cmnd[0] == RELEASE_6)) {
 
 				scp->result = DID_ERROR << 16 |
 					SAM_STAT_RESERVATION_CONFLICT;
drivers/target/target_core_device.c +4 -4
index d1ae3df069a4..cc2da086f96e 100644
@@ -1078,8 +1078,8 @@ passthrough_parse_cdb(struct se_cmd *cmd,
 	if (!dev->dev_attrib.emulate_pr &&
 	    ((cdb[0] == PERSISTENT_RESERVE_IN) ||
 	     (cdb[0] == PERSISTENT_RESERVE_OUT) ||
-	     (cdb[0] == RELEASE || cdb[0] == RELEASE_10) ||
-	     (cdb[0] == RESERVE || cdb[0] == RESERVE_10))) {
+	     (cdb[0] == RELEASE_6 || cdb[0] == RELEASE_10) ||
+	     (cdb[0] == RESERVE_6 || cdb[0] == RESERVE_10))) {
 		return TCM_UNSUPPORTED_SCSI_OPCODE;
 	}
 
@@ -1101,7 +1101,7 @@ passthrough_parse_cdb(struct se_cmd *cmd,
 			return target_cmd_size_check(cmd, size);
 		}
 
-		if (cdb[0] == RELEASE || cdb[0] == RELEASE_10) {
+		if (cdb[0] == RELEASE_6 || cdb[0] == RELEASE_10) {
 			cmd->execute_cmd = target_scsi2_reservation_release;
 			if (cdb[0] == RELEASE_10)
 				size = get_unaligned_be16(&cdb[7]);
@@ -1109,7 +1109,7 @@ passthrough_parse_cdb(struct se_cmd *cmd,
 				size = cmd->data_length;
 			return target_cmd_size_check(cmd, size);
 		}
-		if (cdb[0] == RESERVE || cdb[0] == RESERVE_10) {
+		if (cdb[0] == RESERVE_6 || cdb[0] == RESERVE_10) {
 			cmd->execute_cmd = target_scsi2_reservation_reserve;
 			if (cdb[0] == RESERVE_10)
 				size = get_unaligned_be16(&cdb[7]);
drivers/target/target_core_pr.c +3 -3
index 4f4ad6af416c..34cf2c399b39 100644
@@ -91,7 +91,7 @@ target_scsi2_reservation_check(struct se_cmd *cmd)
 
 	switch (cmd->t_task_cdb[0]) {
 	case INQUIRY:
-	case RELEASE:
+	case RELEASE_6:
 	case RELEASE_10:
 		return 0;
 	default:
@@ -418,12 +418,12 @@ static int core_scsi3_pr_seq_non_holder(struct se_cmd *cmd, u32 pr_reg_type,
 			return -EINVAL;
 		}
 		break;
-	case RELEASE:
+	case RELEASE_6:
 	case RELEASE_10:
 		/* Handled by CRH=1 in target_scsi2_reservation_release() */
 		ret = 0;
 		break;
-	case RESERVE:
+	case RESERVE_6:
 	case RESERVE_10:
 		/* Handled by CRH=1 in target_scsi2_reservation_reserve() */
 		ret = 0;
drivers/target/target_core_spc.c +10 -10
index ea14a3835681..278ff93eff24 100644
@@ -1674,9 +1674,9 @@ static bool tcm_is_pr_enabled(struct target_opcode_descriptor *descr,
 		return true;
 
 	switch (descr->opcode) {
-	case RESERVE:
+	case RESERVE_6:
 	case RESERVE_10:
-	case RELEASE:
+	case RELEASE_6:
 	case RELEASE_10:
 		/*
 		 * The pr_ops which are used by the backend modules don't
@@ -1828,9 +1828,9 @@ static struct target_opcode_descriptor tcm_opcode_pro_register_move = {
 
 static struct target_opcode_descriptor tcm_opcode_release = {
 	.support = SCSI_SUPPORT_FULL,
-	.opcode = RELEASE,
+	.opcode = RELEASE_6,
 	.cdb_size = 6,
-	.usage_bits = {RELEASE, 0x00, 0x00, 0x00,
+	.usage_bits = {RELEASE_6, 0x00, 0x00, 0x00,
 		       0x00, SCSI_CONTROL_MASK},
 	.enabled = tcm_is_pr_enabled,
 };
@@ -1847,9 +1847,9 @@ static struct target_opcode_descriptor tcm_opcode_release10 = {
 
 static struct target_opcode_descriptor tcm_opcode_reserve = {
 	.support = SCSI_SUPPORT_FULL,
-	.opcode = RESERVE,
+	.opcode = RESERVE_6,
 	.cdb_size = 6,
-	.usage_bits = {RESERVE, 0x00, 0x00, 0x00,
+	.usage_bits = {RESERVE_6, 0x00, 0x00, 0x00,
 		       0x00, SCSI_CONTROL_MASK},
 	.enabled = tcm_is_pr_enabled,
 };
@@ -2267,9 +2267,9 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)
 	unsigned char *cdb = cmd->t_task_cdb;
 
 	switch (cdb[0]) {
-	case RESERVE:
+	case RESERVE_6:
 	case RESERVE_10:
-	case RELEASE:
+	case RELEASE_6:
 	case RELEASE_10:
 		if (!dev->dev_attrib.emulate_pr)
 			return TCM_UNSUPPORTED_SCSI_OPCODE;
@@ -2313,7 +2313,7 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)
 		*size = get_unaligned_be32(&cdb[5]);
 		cmd->execute_cmd = target_scsi3_emulate_pr_out;
 		break;
-	case RELEASE:
+	case RELEASE_6:
 	case RELEASE_10:
 		if (cdb[0] == RELEASE_10)
 			*size = get_unaligned_be16(&cdb[7]);
@@ -2322,7 +2322,7 @@ spc_parse_cdb(struct se_cmd *cmd, unsigned int *size)
 
 		cmd->execute_cmd = target_scsi2_reservation_release;
 		break;
-	case RESERVE:
+	case RESERVE_6:
 	case RESERVE_10:
 		/*
 		 * The SPC-2 RESERVE does not contain a size in the SCSI CDB.
drivers/usb/gadget/function/f_mass_storage.c +2 -2
index 2eae8fc2e0db..94d478b6bcd3 100644
@@ -2142,8 +2142,8 @@ static int do_scsi_command(struct fsg_common *common)
 	 * of Posix locks.
 	 */
 	case FORMAT_UNIT:
-	case RELEASE:
-	case RESERVE:
+	case RELEASE_6:
+	case RESERVE_6:
 	case SEND_DIAGNOSTIC:
 
 	default:
drivers/usb/storage/debug.c +2 -2
index 576be66ad962..dda610f689b7 100644
@@ -58,8 +58,8 @@ void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb)
 	case INQUIRY: what = "INQUIRY"; break;
 	case RECOVER_BUFFERED_DATA: what = "RECOVER_BUFFERED_DATA"; break;
 	case MODE_SELECT: what = "MODE_SELECT"; break;
-	case RESERVE: what = "RESERVE"; break;
-	case RELEASE: what = "RELEASE"; break;
+	case RESERVE_6: what = "RESERVE"; break;
+	case RELEASE_6: what = "RELEASE"; break;
 	case COPY: what = "COPY"; break;
 	case ERASE: what = "ERASE"; break;
 	case MODE_SENSE: what = "MODE_SENSE"; break;
include/scsi/scsi_proto.h +2 -2
index 70e1262b2e20..aeca37816506 100644
@@ -33,8 +33,8 @@
 #define INQUIRY               0x12
 #define RECOVER_BUFFERED_DATA 0x14
 #define MODE_SELECT           0x15
-#define RESERVE               0x16
-#define RELEASE               0x17
+#define RESERVE_6             0x16
+#define RELEASE_6             0x17
 #define COPY                  0x18
 #define ERASE                 0x19
 #define MODE_SENSE            0x1a
include/trace/events/scsi.h +2 -2
index 05f1945ed204..bf6cc98d9122 100644
@@ -29,8 +29,8 @@
 		scsi_opcode_name(INQUIRY),			\
 		scsi_opcode_name(RECOVER_BUFFERED_DATA),	\
 		scsi_opcode_name(MODE_SELECT),			\
-		scsi_opcode_name(RESERVE),			\
-		scsi_opcode_name(RELEASE),			\
+		scsi_opcode_name(RESERVE_6),			\
+		scsi_opcode_name(RELEASE_6),			\
 		scsi_opcode_name(COPY),				\
 		scsi_opcode_name(ERASE),			\
 		scsi_opcode_name(MODE_SENSE),			\
include/trace/events/target.h +2 -2
index a13cbf2b3405..7e2e20ba26f1 100644
@@ -31,8 +31,8 @@
 		scsi_opcode_name(INQUIRY),			\
 		scsi_opcode_name(RECOVER_BUFFERED_DATA),	\
 		scsi_opcode_name(MODE_SELECT),			\
-		scsi_opcode_name(RESERVE),			\
-		scsi_opcode_name(RELEASE),			\
+		scsi_opcode_name(RESERVE_6),			\
+		scsi_opcode_name(RELEASE_6),			\
 		scsi_opcode_name(COPY),				\
 		scsi_opcode_name(ERASE),			\
 		scsi_opcode_name(MODE_SENSE),			\
maintainer Reviewed-by on v1 1/33
#2 lore raw

Re: [PATCH RFC 01/33] scsi, usb: Rename the RESERVE and RELEASE constants

Quoted 5 lines · Bart Van Assche

The RESERVE(6) and RELEASE(6) commands are obsolete SCSI commands defined in the SCSI-2 standard. These commands have been replaced by PERSISTENT RESERVE IN and PERSISTENT RESERVE OUT. Rename RESERVE into RESERVE_6 and RELEASE into RELEASE_6 in preparation of introducing a new RELEASE macro in the new header file include/linux/thread_safety.h.

The rename itself looks good:

But RELEASE is not a good name for a global macro, I'll return to that argument later.

author maintainer
#3 lore raw

RFC PATCH 2/33 s390: Comment out the RELEASE constant

In reply to Bart Van Assche

Before introducing a new macro with the name RELEASE in include/linux/ thread_safety.h, comment out the unused RELEASE constant in tape_std.h.

Cc Heiko Carstens <[email protected]>
Cc Martin Schwidefsky <[email protected]>
---
 drivers/s390/char/tape_std.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/s390/char/tape_std.h +2 -0
index dcc63ff587f9..0e3e7afc200c 100644
@@ -53,7 +53,9 @@
 #define READ_BLOCK_ID		0x22	/* 3420 REJECT,3480 OK */
 #define READ_BUFFER		0x12	/* 3420 REJECT,3480 OK */
 #define READ_BUFF_LOG		0x24	/* 3420 REJECT,3480 OK */
+#if 0
 #define RELEASE			0xD4	/* 3420 NOP, 3480 REJECT */
+#endif
 #define REQ_TRK_IN_ERROR	0x1B	/* 3420 NOP, 3480 REJECT */
 #define RESERVE			0xF4	/* 3420 NOP, 3480 REJECT */
 #define SENSE_GROUP_ID		0x34	/* 3420 REJECT,3480 OK */
author maintainer
#4 lore raw

RFC PATCH 3/33 locking: Introduce <linux/thread_safety.h>

In reply to Bart Van Assche

Introduce a new kernel header with the Clang thread-safety attributes. If:
- a struct that represents a synchronization object is annotated with the CAPABILITY() attribute,
- the operations on that synchronization object are annotated with the ACQUIRE() and RELEASE() attributes,
- if variables or members that should be guarded by a synchronization object are annotated with GUARDED_BY(),

then the Clang compiler verifies the following if -Wthread-safety is enabled:
- Whether or not locking in a function implementation matches the thread-safety attributes in the function declaration. No annotation is necessary if a lock call is followed by an unlock call. For other patterns, annotation is required.
- Whether or not the requirements of the GUARDED_BY() annotations are met.

Some highlights from the Clang thread-safety attribute documentation:
- Alias analysis is not performed on thread-safety attribute arguments. Hence the expansion of some local variables in subsequent patches.
- Most thread-safety attributes affect the function interface. NO_THREAD_SAFETY_ANALYSIS only affects the function definition.
- If a private struct definition (in a .c file) includes a synchronization object, annotations of functions in .h files must not refer to the name of the private struct. A possible solution is to define a capability with DEFINE_CAPABILITY and to use the name of that capability in the thread-safety annotations.

A few notes from me:
- Thread-safety attributes are not included in function pointer types. In other words, when passing an annotated function as an argument to another function, the thread-safety attributes are discarded.
- Annotating conditional locking functions that return a pointer is not yet supported by Clang.

More information is available here:
https://clang.llvm.org/docs/ThreadSafetyAnalysis.html

In case anyone would be interested, the equivalent Qemu header file is available here:
https://github.com/qemu/qemu/blob/master/include/qemu/clang-tsa.h

Cc Ingo Molnar <[email protected]>
Cc Will Deacon <[email protected]>
Cc Boqun Feng <[email protected]> (LOCKDEP & RUST)
Cc Waiman Long <[email protected]>
---
 include/linux/thread_safety.h | 141 ++++++++++++++++++++++++++++++++++
 1 file changed, 141 insertions(+)
 create mode 100644 include/linux/thread_safety.h
include/linux/thread_safety.h new file +141 -0
new file mode 100644
index 000000000000..e23175223a18
@@ -0,0 +1,141 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _THREAD_SAFETY_H_
+#define _THREAD_SAFETY_H_
+
+/* See also https://clang.llvm.org/docs/ThreadSafetyAnalysis.html */
+
+/*
+ * Enable thread safety attributes only for clang. The attributes can be safely
+ * ignored when compiling with other compilers.
+ */
+#if defined(__clang__)
+#define THREAD_ANNOTATION_ATTRIBUTE_(...) __attribute__((__VA_ARGS__))
+#else
+#define THREAD_ANNOTATION_ATTRIBUTE_(...)
+#endif
+
+/*
+ * Macro for applying a capability as an attribute to a type definition.
+ * This macro can be used in struct definitions and also in typedefs.
+ * @x must be a string.
+ */
+#define CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(capability(x))
+
+/*
+ * Macro for defining a capability name that is not tied to an existing type.
+ * @capability_name is declared as an external variable. Any attempt to
+ * read or modify that external variable will result in a linker error.
+ */
+#define DEFINE_CAPABILITY(capability_name)	      \
+	extern const struct {} CAPABILITY(#capability_name) capability_name
+
+/*
+ * Attribute for structure members that declares that the structure members are
+ * protected by the given capability.
+ */
+#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE_(guarded_by(x))
+
+/*
+ * Attribute for pointer structure members that declares that the contents
+ * of these pointers are protected by the given capability.
+ */
+#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE_(pt_guarded_by(x))
+
+/*
+ * Attribute for instances of data structures that declares that the given
+ * capabilities must be acquired before the annotated data structure.
+ */
+#define ACQUIRED_BEFORE(...)					\
+	THREAD_ANNOTATION_ATTRIBUTE_(acquired_before(__VA_ARGS__))
+
+/*
+ * Attribute for instances of data structures that declares that the given
+ * capabilities must be acquired after the annotated data structure.
+ */
+#define ACQUIRED_AFTER(...)					\
+	THREAD_ANNOTATION_ATTRIBUTE_(acquired_after(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that the caller must have exclusive access
+ * to the given capabilities.
+ */
+#define REQUIRES(...)							\
+	THREAD_ANNOTATION_ATTRIBUTE_(requires_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that the caller must have shared access
+ * to the given capabilities.
+ */
+#define REQUIRES_SHARED(...)						\
+	THREAD_ANNOTATION_ATTRIBUTE_(requires_shared_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that the function acquires the given
+ * capability.
+ */
+#define ACQUIRE(...)						\
+	THREAD_ANNOTATION_ATTRIBUTE_(acquire_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that the function acquires the given
+ * shared capability.
+ */
+#define ACQUIRE_SHARED(...)						\
+	THREAD_ANNOTATION_ATTRIBUTE_(acquire_shared_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that the function releases the given
+ * capability.
+ */
+#define RELEASE(...)						\
+	THREAD_ANNOTATION_ATTRIBUTE_(release_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that the function releases the given
+ * shared capability.
+ */
+#define RELEASE_SHARED(...)						\
+	THREAD_ANNOTATION_ATTRIBUTE_(release_shared_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that a function only acquires the given
+ * capability (2nd argument) for a given return value (first argument).
+ */
+#define TRY_ACQUIRE(...)						\
+	THREAD_ANNOTATION_ATTRIBUTE_(try_acquire_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that a function only acquires the given
+ * shared capability (2nd argument) for a given return value (first argument).
+ */
+#define TRY_ACQUIRE_SHARED(...)						\
+	THREAD_ANNOTATION_ATTRIBUTE_(try_acquire_shared_capability(__VA_ARGS__))
+
+/*
+ * Function attribute that declares that the caller must not hold the given
+ * capabilities.
+ */
+#define EXCLUDES(...) THREAD_ANNOTATION_ATTRIBUTE_(locks_excluded(__VA_ARGS__))
+
+/*
+ * Tell the compiler that the given capability is held.
+ */
+#define ASSERT_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(assert_capability(x))
+
+/*
+ * Tell the compiler that the given shared capability is held.
+ */
+#define ASSERT_SHARED_CAPABILITY(x)				\
+	THREAD_ANNOTATION_ATTRIBUTE_(assert_shared_capability(x))
+
+/*
+ * Function attribute that declares that a function returns a pointer to a
+ * capability.
+ */
+#define RETURN_CAPABILITY(x) THREAD_ANNOTATION_ATTRIBUTE_(lock_returned(x))
+
+/* Function attribute that disables thread-safety analysis. */
+#define NO_THREAD_SAFETY_ANALYSIS				\
+	THREAD_ANNOTATION_ATTRIBUTE_(no_thread_safety_analysis)
+
+#endif /* _THREAD_SAFETY_H_ */
#5 lore raw

Re: [PATCH RFC 03/33] locking: Introduce <linux/thread_safety.h>

Quoted 6 lines

- a struct that represents a synchronization object is annotated with the CAPABILITY() attribute,
- the operations on that synchronization object are annotated with the ACQUIRE() and RELEASE() attributes,
- if variables or members that should be guarded by a synchronization object are annotated with GUARDED_BY(),

Those are all nasty shouting names, without and good prefixing.

But more importantly ACQUIRE() and RELEASE() seems to duplicate the existing __acquires/__releases annotations from sparse. We really need to find away to unify them instead of duplicating the annotations.

#6 lore raw

Re: [PATCH RFC 03/33] locking: Introduce <linux/thread_safety.h>

Quoted 8 lines · Christoph Hellwig
Quoted 7 lines

- a struct that represents a synchronization object is annotated with the CAPABILITY() attribute,
- the operations on that synchronization object are annotated with the ACQUIRE() and RELEASE() attributes,
- if variables or members that should be guarded by a synchronization object are annotated with GUARDED_BY(),

Quoted 5 lines

Those are all nasty shouting names, without and good prefixing.

But more importantly ACQUIRE() and RELEASE() seems to duplicate the existing __acquires/__releases annotations from sparse. We really need to find away to unify them instead of duplicating the annotations.

This is exactly what my approach tries to do:
https://lore.kernel.org/all/[email protected]/T/#u
(Make it work with the existing keywords and extend them.)

author maintainer
#7 lore raw

Re: [PATCH RFC 03/33] locking: Introduce <linux/thread_safety.h>

In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 6 lines

- a struct that represents a synchronization object is annotated with the CAPABILITY() attribute,
- the operations on that synchronization object are annotated with the ACQUIRE() and RELEASE() attributes,
- if variables or members that should be guarded by a synchronization object are annotated with GUARDED_BY(),

Quoted 5 lines

Those are all nasty shouting names, without and good prefixing.

But more importantly ACQUIRE() and RELEASE() seems to duplicate the existing __acquires/__releases annotations from sparse. We really need to find away to unify them instead of duplicating the annotations.

I think that we are better off to drop support for the sparse locking annotations. Linus added the macro __cond_acquires() two years ago in the Linux kernel but support for that macro has never been implemented in sparse. In the description of commit 4a557a5d1a61 ("sparse: introduce conditional lock acquire function attribute") I found the following URL:
https://lore.kernel.org/all/CAHk-=wjZfO9hGqJ2_hGQG3U_XzSh9_XaXze=HgPdvJbgrvASfA@mail.gmail.com/

That URL points to an e-mail from Linus Torvalds with a patch for sparse that implements support for __cond_acquires(). It seems to me that the sparse patch has never been applied to the sparse code base (the git URL for sparse is available at https://sparse.docs.kernel.org/en/latest/).

So while __cond_acquires() can be translated into a Clang annotation, __cond_acquires() is not supported by sparse. There are other challenges:
* The argument of __acquire() and __release() can be a "capability" or the address of a synchronization object. A few examples where the argument represents a capability:

  __acquire(RCU);
  __acquire(RCU_BH);
  __acquire(RCU_SCHED);
  __acquire(bitlock);

An example where the argument represents the address of a synchronization object:

static inline void do_raw_spin_lock(raw_spinlock_t *lock)
__acquires(lock)

  {
	__acquire(lock);
	arch_spin_lock(&lock->raw_lock);
	mmiowb_spin_lock();

}

If __acquire() and __release() would have to be supported for both sparse and Clang, that would probably involve modifying all instances of these two macros across the entire kernel tree and making it explicit whether the argument is a capability or the address of a synchronization object.

* Clang verifies the thread-safety attribute arguments at compile time while sparse does not. An example from the scheduler:

extern
struct rq *__task_rq_lock(struct task_struct *p, struct rq_flags *rf)

	__acquires(rq->lock);

An example from the workqueue implementation:

static void maybe_create_worker(struct worker_pool *pool) __releases(&pool->lock)
__acquires(&pool->lock)
{
[ ... ]
}

If __acquires() and __releases() are converted into Clang function attributes then compilation fails because Clang verifies the expressions passed to function attributes before the function body is compiled.

The team that is maintaining sparse is small (a single person?) and the rate of change of sparse is low (the latest commit was published more than a year ago). If we support both sparse locking annotations and the Clang thread-safety annotations then we will end up fixing bugs in both compilers. I propose to focus the maintenance effort on the project with the highest velocity (Clang) and to drop support for the sparse locking annotations.

Thanks,

Bart.

#8 lore raw

Re: [PATCH RFC 03/33] locking: Introduce <linux/thread_safety.h>

On Fri, 7 Feb 2025 at 23:34, Bart Van Assche <[email protected]> wrote:
[...]

Quoted 8 lines
Quoted 5 lines

Those are all nasty shouting names, without and good prefixing.

But more importantly ACQUIRE() and RELEASE() seems to duplicate the existing __acquires/__releases annotations from sparse. We really need to find away to unify them instead of duplicating the annotations.

I think that we are better off to drop support for the sparse locking annotations. Linus added the macro __cond_acquires() two years ago in

+1 to dropping Sparse support -- although we can retain the same keywords.

[...]

Quoted 3 lines

* The argument of __acquire() and __release() can be a "capability" or the address of a synchronization object. A few examples where the argument represents a capability:

Not a problem, and can be solved by introducing "token" instances...

Quoted 3 lines
   __acquire(RCU);
   __acquire(RCU_BH);
   __acquire(RCU_SCHED);

For RCU: https://lore.kernel.org/lkml/[email protected]/

Quoted 1 line
   __acquire(bitlock);

For bitlock: https://lore.kernel.org/lkml/[email protected]/

Quoted 11 lines

An example where the argument represents the address of a synchronization object:

   static inline void do_raw_spin_lock(raw_spinlock_t *lock)
         __acquires(lock)
   {
        __acquire(lock);
        arch_spin_lock(&lock->raw_lock);
        mmiowb_spin_lock();
   }
Quoted 5 lines

If __acquire() and __release() would have to be supported for both sparse and Clang, that would probably involve modifying all instances of these two macros across the entire kernel tree and making it explicit whether the argument is a capability or the address of a synchronization object.

This is not a problem as I have demonstrated with my approach. Using token instances is also the way we'd be able to support things like preempt-disable-enable, irq-disable-enable, etc.

In general I'm in favor of dropping Sparse support, but the majority of existing annotations can be reused, simplifying our work.

author maintainer
#9 lore raw

Re: [PATCH RFC 03/33] locking: Introduce <linux/thread_safety.h>

Quoted 1 line · Marco Elver

This is not a problem as I have demonstrated with my approach.

That's not what my email is about. My email is about whether or not to continue supporting the sparse locking context annotations.

Bart.

author maintainer
#10 lore raw

RFC PATCH 4/33 include/linux/cleanup.h: Support thread-safety analysis

In reply to Bart Van Assche

Introduce variants of the DEFINE_CLASS(), DEFINE_GUARD() and DEFINE_GUARD_COND() macros that support passing function attributes for the constructor functions.

Suppress thread-safety analysis for free functions because some free functions change the state of synchronization objects. An example from net/core/dev.h:

DEFINE_FREE(netdev_unlock, struct net_device *, if (_T) netdev_unlock(_T));

---
 include/linux/cleanup.h | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
include/linux/cleanup.h +26 -8
index ec00e3f7af2b..f6a42cac81c6 100644
@@ -3,6 +3,7 @@
 #define _LINUX_CLEANUP_H
 
 #include <linux/compiler.h>
+#include <linux/thread_safety.h>
 
 /**
  * DOC: scope-based cleanup helpers
@@ -195,7 +196,8 @@
  */
 
 #define DEFINE_FREE(_name, _type, _free) \
-	static inline void __free_##_name(void *p) { _type _T = *(_type *)p; _free; }
+	static inline void __free_##_name(void *p) NO_THREAD_SAFETY_ANALYSIS \
+	{ _type _T = *(_type *)p; _free; }
 
 #define __free(_name)	__cleanup(__free_##_name)
 
@@ -241,17 +243,25 @@ const volatile void * __must_check_fn(const volatile void *val)
  */
 
 #define DEFINE_CLASS(_name, _type, _exit, _init, _init_args...)		\
+	DEFINE_CLASS_ATTR(_name, _type, _exit,				\
+			  _init, NO_THREAD_SAFETY_ANALYSIS, _init_args)
+
+#define DEFINE_CLASS_ATTR(_name, _type, _exit, _init, _init_attr,	\
+			  _init_args...)				\
 typedef _type class_##_name##_t;					\
 static inline void class_##_name##_destructor(_type *p)			\
+	NO_THREAD_SAFETY_ANALYSIS					\
 { _type _T = *p; _exit; }						\
-static inline _type class_##_name##_constructor(_init_args)		\
+static inline _type class_##_name##_constructor(_init_args) _init_attr	\
 { _type t = _init; return t; }
 
-#define EXTEND_CLASS(_name, ext, _init, _init_args...)			\
+#define EXTEND_CLASS(_name, ext, _init, _init_attr, _init_args...)	\
 typedef class_##_name##_t class_##_name##ext##_t;			\
 static inline void class_##_name##ext##_destructor(class_##_name##_t *p)\
+	NO_THREAD_SAFETY_ANALYSIS					\
 { class_##_name##_destructor(p); }					\
 static inline class_##_name##_t class_##_name##ext##_constructor(_init_args) \
+	_init_attr							\
 { class_##_name##_t t = _init; return t; }
 
 #define CLASS(_name, var)						\
@@ -291,17 +301,25 @@ static inline class_##_name##_t class_##_name##ext##_constructor(_init_args) \
 #define __DEFINE_CLASS_IS_CONDITIONAL(_name, _is_cond)	\
 static __maybe_unused const bool class_##_name##_is_conditional = _is_cond
 
-#define DEFINE_GUARD(_name, _type, _lock, _unlock) \
-	__DEFINE_CLASS_IS_CONDITIONAL(_name, false); \
-	DEFINE_CLASS(_name, _type, if (_T) { _unlock; }, ({ _lock; _T; }), _type _T); \
+#define DEFINE_GUARD(_name, _type, _lock, _unlock)			\
+	DEFINE_GUARD_ATTR(_name, _type, _lock, NO_THREAD_SAFETY_ANALYSIS,\
+			  _unlock)
+
+#define DEFINE_GUARD_ATTR(_name, _type, _lock, _lock_attr, _unlock)	\
+	__DEFINE_CLASS_IS_CONDITIONAL(_name, false);			\
+	DEFINE_CLASS_ATTR(_name, _type, if (_T) { _unlock; },		\
+		     ({ _lock; _T; }), _lock_attr, _type _T);		\
 	static inline void * class_##_name##_lock_ptr(class_##_name##_t *_T) \
 	{ return (void *)(__force unsigned long)*_T; }
 
 #define DEFINE_GUARD_COND(_name, _ext, _condlock) \
+	DEFINE_GUARD_COND_ATTR(_name, _ext, _condlock, )
+
+#define DEFINE_GUARD_COND_ATTR(_name, _ext, _condlock, _condlock_attr)	  \
 	__DEFINE_CLASS_IS_CONDITIONAL(_name##_ext, true); \
 	EXTEND_CLASS(_name, _ext, \
 		     ({ void *_t = _T; if (_T && !(_condlock)) _t = NULL; _t; }), \
-		     class_##_name##_t _T) \
+		     _condlock_attr, class_##_name##_t _T)		\
 	static inline void * class_##_name##_ext##_lock_ptr(class_##_name##_t *_T) \
 	{ return class_##_name##_lock_ptr(_T); }
 
@@ -413,7 +431,7 @@ __DEFINE_LOCK_GUARD_0(_name, _lock)
 	EXTEND_CLASS(_name, _ext,					\
 		     ({ class_##_name##_t _t = { .lock = l }, *_T = &_t;\
 		        if (_T->lock && !(_condlock)) _T->lock = NULL;	\
-			_t; }),						\
+			_t; }),	,					\
 		     typeof_member(class_##_name##_t, lock) l)		\
 	static inline void * class_##_name##_ext##_lock_ptr(class_##_name##_t *_T) \
 	{ return class_##_name##_lock_ptr(_T); }
author maintainer
#11 lore raw

RFC PATCH 5/33 locking/mutex: Change the atomic_dec_and_mutex_lock() return type

In reply to Bart Van Assche

Change the return type of atomic_dec_and_mutex_lock() from int into bool. This will make it easier to add a thread-safety annotation to this function. This patch does not change the behavior of any kernel code because all atomic_dec_and_mutex_lock() callers either check whether the return value of this function is zero or that it differs from zero.

This patch makes the atomic_dec_and_mutex_lock() signature consistent with that of refcount_dec_and_mutex_lock().

---
 Documentation/locking/mutex-design.rst | 2 +-
 include/linux/mutex.h                  | 2 +-
 kernel/locking/mutex.c                 | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)
Documentation/locking/mutex-design.rst +1 -1
index 7c30b4aa5e28..ec02e47b6e9e 100644
@@ -144,7 +144,7 @@ Acquire the mutex, interruptible::
 
 Acquire the mutex, interruptible, if dec to 0::
 
-   int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
+   bool atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
 
 Unlock the mutex::
 
include/linux/mutex.h +1 -1
index 2bf91b57591b..6c0a8a843a29 100644
@@ -196,7 +196,7 @@ extern void mutex_lock_io(struct mutex *lock);
 extern int mutex_trylock(struct mutex *lock);
 extern void mutex_unlock(struct mutex *lock);
 
-extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
+bool atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
 
 DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T))
 DEFINE_GUARD_COND(mutex, _try, mutex_trylock(_T))
kernel/locking/mutex.c +4 -4
index b36f23de48f1..0af175f5f031 100644
@@ -1118,19 +1118,19 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(contention_end);
  *
  * return true and hold lock if we dec to 0, return false otherwise
  */
-int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock)
+bool atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock)
 {
 	/* dec if we can't possibly hit 0 */
 	if (atomic_add_unless(cnt, -1, 1))
-		return 0;
+		return false;
 	/* we might hit 0, so take the lock */
 	mutex_lock(lock);
 	if (!atomic_dec_and_test(cnt)) {
 		/* when we actually did the dec, we didn't hit 0 */
 		mutex_unlock(lock);
-		return 0;
+		return false;
 	}
 	/* we hit 0, and we hold the lock */
-	return 1;
+	return true;
 }
 EXPORT_SYMBOL(atomic_dec_and_mutex_lock);
author maintainer
#13 lore raw

RFC PATCH 6/33 locking/mutex: Annotate struct mutex and mutex functions

In reply to Bart Van Assche

Inform the Clang thread-safety analyzer about mutex operations and also about the meaning of the return value of the functions that operate on mutexes.

---
 include/linux/mutex.h       | 46 +++++++++++++++++++++++--------------
 include/linux/mutex_types.h |  5 ++--
 kernel/locking/mutex.c      | 12 ++++++++++
 3 files changed, 44 insertions(+), 19 deletions(-)
include/linux/mutex.h +29 -17
index 6c0a8a843a29..b7669baeffe9 100644
@@ -21,6 +21,7 @@
 #include <linux/debug_locks.h>
 #include <linux/cleanup.h>
 #include <linux/mutex_types.h>
+#include <linux/thread_safety.h>
 
 struct device;
 
@@ -154,14 +155,18 @@ static inline int __devm_mutex_init(struct device *dev, struct mutex *lock)
  * Also see Documentation/locking/mutex-design.rst.
  */
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
-extern void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
-extern void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock);
+void mutex_lock_nested(struct mutex *lock, unsigned int subclass) ACQUIRE(*lock);
+void _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest_lock)
+	ACQUIRE(*lock);
 
 extern int __must_check mutex_lock_interruptible_nested(struct mutex *lock,
-					unsigned int subclass);
+					unsigned int subclass)
+	TRY_ACQUIRE(0, *lock);
 extern int __must_check mutex_lock_killable_nested(struct mutex *lock,
-					unsigned int subclass);
-extern void mutex_lock_io_nested(struct mutex *lock, unsigned int subclass);
+					unsigned int subclass)
+	TRY_ACQUIRE(0, *lock);
+extern void mutex_lock_io_nested(struct mutex *lock, unsigned int subclass)
+	ACQUIRE(*lock);
 
 #define mutex_lock(lock) mutex_lock_nested(lock, 0)
 #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0)
@@ -175,10 +180,11 @@ do {									\
 } while (0)
 
 #else
-extern void mutex_lock(struct mutex *lock);
-extern int __must_check mutex_lock_interruptible(struct mutex *lock);
-extern int __must_check mutex_lock_killable(struct mutex *lock);
-extern void mutex_lock_io(struct mutex *lock);
+void mutex_lock(struct mutex *lock) ACQUIRE(*lock);
+int __must_check mutex_lock_interruptible(struct mutex *lock)
+	TRY_ACQUIRE(0, *lock);
+int __must_check mutex_lock_killable(struct mutex *lock) TRY_ACQUIRE(0, *lock);
+void mutex_lock_io(struct mutex *lock) ACQUIRE(*lock);
 
 # define mutex_lock_nested(lock, subclass) mutex_lock(lock)
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
@@ -193,13 +199,19 @@ extern void mutex_lock_io(struct mutex *lock);
  *
  * Returns 1 if the mutex has been acquired successfully, and 0 on contention.
  */
-extern int mutex_trylock(struct mutex *lock);
-extern void mutex_unlock(struct mutex *lock);
-
-bool atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
-
-DEFINE_GUARD(mutex, struct mutex *, mutex_lock(_T), mutex_unlock(_T))
-DEFINE_GUARD_COND(mutex, _try, mutex_trylock(_T))
-DEFINE_GUARD_COND(mutex, _intr, mutex_lock_interruptible(_T) == 0)
+int mutex_trylock(struct mutex *lock) TRY_ACQUIRE(1, *lock);
+void mutex_unlock(struct mutex *lock) RELEASE(*lock);
+
+bool atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock)
+	TRY_ACQUIRE(true, *lock);
+
+DEFINE_GUARD_ATTR(mutex, struct mutex *,
+		  mutex_lock(_T),
+		  ASSERT_CAPABILITY(*_T) NO_THREAD_SAFETY_ANALYSIS,
+		  mutex_unlock(_T))
+DEFINE_GUARD_COND_ATTR(mutex, _try, mutex_trylock(_T),
+		       ASSERT_CAPABILITY(*_T) NO_THREAD_SAFETY_ANALYSIS)
+DEFINE_GUARD_COND_ATTR(mutex, _intr, mutex_lock_interruptible(_T) == 0,
+		       ASSERT_CAPABILITY(*_T) NO_THREAD_SAFETY_ANALYSIS)
 
 #endif /* __LINUX_MUTEX_H */
include/linux/mutex_types.h +3 -2
index fdf7f515fde8..59469956426a 100644
@@ -6,6 +6,7 @@
 #include <linux/lockdep_types.h>
 #include <linux/osq_lock.h>
 #include <linux/spinlock_types.h>
+#include <linux/thread_safety.h>
 #include <linux/types.h>
 
 #ifndef CONFIG_PREEMPT_RT
@@ -38,7 +39,7 @@
  * - detects multi-task circular deadlocks and prints out all affected
  *   locks and tasks (and only those tasks)
  */
-struct mutex {
+struct CAPABILITY("mutex") mutex {
 	atomic_long_t		owner;
 	raw_spinlock_t		wait_lock;
 #ifdef CONFIG_MUTEX_SPIN_ON_OWNER
@@ -59,7 +60,7 @@ struct mutex {
  */
 #include <linux/rtmutex.h>
 
-struct mutex {
+struct CAPABILITY("mutex") mutex {
 	struct rt_mutex_base	rtmutex;
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 	struct lockdep_map	dep_map;
kernel/locking/mutex.c +12 -0
index 0af175f5f031..e44becde2610 100644
@@ -254,6 +254,7 @@ static void __sched __mutex_lock_slowpath(struct mutex *lock);
  * This function is similar to (but not equivalent to) down().
  */
 void __sched mutex_lock(struct mutex *lock)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	might_sleep();
 
@@ -515,6 +516,7 @@ static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigne
  * This function is similar to (but not equivalent to) up().
  */
 void __sched mutex_unlock(struct mutex *lock)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 #ifndef CONFIG_DEBUG_LOCK_ALLOC
 	if (__mutex_unlock_fast(lock))
@@ -536,6 +538,7 @@ EXPORT_SYMBOL(mutex_unlock);
  * of a unlocked mutex is not allowed.
  */
 void __sched ww_mutex_unlock(struct ww_mutex *lock)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	__ww_mutex_unlock(lock);
 	mutex_unlock(&lock->base);
@@ -751,6 +754,7 @@ __ww_mutex_lock(struct mutex *lock, unsigned int state, unsigned int subclass,
  * A mutex acquired with this function must be released with ww_mutex_unlock.
  */
 int ww_mutex_trylock(struct ww_mutex *ww, struct ww_acquire_ctx *ww_ctx)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	if (!ww_ctx)
 		return mutex_trylock(&ww->base);
@@ -778,6 +782,7 @@ EXPORT_SYMBOL(ww_mutex_trylock);
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 void __sched
 mutex_lock_nested(struct mutex *lock, unsigned int subclass)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	__mutex_lock(lock, TASK_UNINTERRUPTIBLE, subclass, NULL, _RET_IP_);
 }
@@ -786,6 +791,7 @@ EXPORT_SYMBOL_GPL(mutex_lock_nested);
 
 void __sched
 _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	__mutex_lock(lock, TASK_UNINTERRUPTIBLE, 0, nest, _RET_IP_);
 }
@@ -807,6 +813,7 @@ EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested);
 
 void __sched
 mutex_lock_io_nested(struct mutex *lock, unsigned int subclass)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	int token;
 
@@ -957,6 +964,7 @@ __mutex_lock_interruptible_slowpath(struct mutex *lock);
  * signal arrived.
  */
 int __sched mutex_lock_interruptible(struct mutex *lock)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	might_sleep();
 
@@ -981,6 +989,7 @@ EXPORT_SYMBOL(mutex_lock_interruptible);
  * fatal signal arrived.
  */
 int __sched mutex_lock_killable(struct mutex *lock)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	might_sleep();
 
@@ -1061,6 +1070,7 @@ __ww_mutex_lock_interruptible_slowpath(struct ww_mutex *lock,
  * mutex must be released by the same task that acquired it.
  */
 int __sched mutex_trylock(struct mutex *lock)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	bool locked;
 
@@ -1077,6 +1087,7 @@ EXPORT_SYMBOL(mutex_trylock);
 #ifndef CONFIG_DEBUG_LOCK_ALLOC
 int __sched
 ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	might_sleep();
 
@@ -1092,6 +1103,7 @@ EXPORT_SYMBOL(ww_mutex_lock);
 
 int __sched
 ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	might_sleep();
 
author maintainer
#14 lore raw

RFC PATCH 7/33 driver core: Annotate locking functions in <linux/device.h>

In reply to Bart Van Assche

Annotate the locking functions in <linux/device.h> with thread-safety attributes.

Cc Greg Kroah-Hartman <[email protected]>
---
 include/linux/device.h | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
include/linux/device.h +10 -3
index 80a5b3268986..125b89fda3af 100644
@@ -31,6 +31,7 @@
 #include <linux/device/class.h>
 #include <linux/device/driver.h>
 #include <linux/cleanup.h>
+#include <linux/thread_safety.h>
 #include <asm/device.h>
 
 struct device;
@@ -1026,21 +1027,25 @@ static inline bool dev_pm_test_driver_flags(struct device *dev, u32 flags)
 }
 
 static inline void device_lock(struct device *dev)
+	ACQUIRE(dev->mutex)
 {
 	mutex_lock(&dev->mutex);
 }
 
 static inline int device_lock_interruptible(struct device *dev)
+	TRY_ACQUIRE(0, dev->mutex)
 {
 	return mutex_lock_interruptible(&dev->mutex);
 }
 
 static inline int device_trylock(struct device *dev)
+	TRY_ACQUIRE(1, dev->mutex)
 {
 	return mutex_trylock(&dev->mutex);
 }
 
 static inline void device_unlock(struct device *dev)
+	RELEASE(dev->mutex)
 {
 	mutex_unlock(&dev->mutex);
 }
@@ -1182,9 +1187,11 @@ do { \
 				  _THIS_IP_);                          \
 } while (0)
 
-void lock_device_hotplug(void);
-void unlock_device_hotplug(void);
-int lock_device_hotplug_sysfs(void);
+DEFINE_CAPABILITY(device_hotplug_capability);
+
+void lock_device_hotplug(void) ACQUIRE(device_hotplug_capability);
+void unlock_device_hotplug(void) RELEASE(device_hotplug_capability);
+int lock_device_hotplug_sysfs(void) TRY_ACQUIRE(0, device_hotplug_capability);
 int device_offline(struct device *dev);
 int device_online(struct device *dev);
 
author maintainer
#15 lore raw

RFC PATCH 8/33 kref: Add thread-safety annotations in <linux/kref.h>

In reply to Bart Van Assche

Inform the Clang thread-safety analyzer that kref_put_mutex() callers must not hold *mutex.

Note: annotating that the 'release' function pointer releases 'mutex' is not possible because the mutex pointer is not an argument of the 'release' function.

Cc Greg Kroah-Hartman <[email protected]>
---
 include/linux/kref.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/kref.h +3 -0
index 88e82ab1367c..29c31b103557 100644
@@ -15,6 +15,7 @@
 
 #include <linux/spinlock.h>
 #include <linux/refcount.h>
+#include <linux/thread_safety.h>
 
 struct kref {
 	refcount_t refcount;
@@ -81,6 +82,8 @@ static inline int kref_put(struct kref *kref, void (*release)(struct kref *kref)
 static inline int kref_put_mutex(struct kref *kref,
 				 void (*release)(struct kref *kref),
 				 struct mutex *mutex)
+	EXCLUDES(*mutex)
+	NO_THREAD_SAFETY_ANALYSIS
 {
 	if (refcount_dec_and_mutex_lock(&kref->refcount, mutex)) {
 		release(kref);
author maintainer
#16 lore raw

RFC PATCH 9/33 refcount: Add thread-safety annotations in <linux/refcount.h>

In reply to Bart Van Assche

Inform the Clang thread-safety analyzer that refcount_dec_and_mutex_lock() may lock a mutex.

---
 include/linux/refcount.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/refcount.h +4 -1
index 35f039ecb272..dd854ad27df8 100644
@@ -98,6 +98,7 @@
 #include <linux/limits.h>
 #include <linux/refcount_types.h>
 #include <linux/spinlock_types.h>
+#include <linux/thread_safety.h>
 
 struct mutex;
 
@@ -353,7 +354,9 @@ static inline void refcount_dec(refcount_t *r)
 
 extern __must_check bool refcount_dec_if_one(refcount_t *r);
 extern __must_check bool refcount_dec_not_one(refcount_t *r);
-extern __must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock) __cond_acquires(lock);
+__must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock)
+	__cond_acquires(lock)
+	TRY_ACQUIRE(true, *lock);
 extern __must_check bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock) __cond_acquires(lock);
 extern __must_check bool refcount_dec_and_lock_irqsave(refcount_t *r,
 						       spinlock_t *lock,
author maintainer
#17 lore raw

RFC PATCH 10/33 treewide: Modify mutex_lock_interruptible() return value checks

In reply to Bart Van Assche

Change all checks of the mutex_lock_interruptible() return value and also all the checks of callers of this function into != 0 or == 0.

This patch prepares for annotating mutex_lock_interruptible() and its callers with the thread-safety attribute TRY_ACQUIRE(0, mutex_ptr). This tells Clang that the return value 0 and only this return value indicates that the mutex has been locked. This change is necessary because checks like < 0 on the mutex_lock_interruptible() return value confuse the Clang thread-safety checker.

This patch has been generated by applying the following Coccinelle semantic patch on the kernel tree:

@@
expression mutex, expr;
statement stmnt;
@@
(
-if (device_lock_interruptible(mutex) < 0) stmnt +if (device_lock_interruptible(mutex)) stmnt |
-if (mutex_lock_interruptible(mutex) < 0) stmnt +if (mutex_lock_interruptible(mutex)) stmnt
|
-if (mutex_lock_killable(mutex) < 0) stmnt +if (mutex_lock_killable(mutex)) stmnt
|
-if (mutex_lock_killable_nested(mutex) < 0) stmnt +if (mutex_lock_killable_nested(mutex)) stmnt |
-if (usb_lock_device_for_reset(mutex, expr) < 0) stmnt +if (usb_lock_device_for_reset(mutex, expr)) stmnt )

@@
expression mutex, expr, expr1, expr2, expr3, tty; statement stmnt, stmnt1, stmnt2;
identifier ret;
@@
(
-ret = device_lock_interruptible(mutex);
-if (ret < 0) stmnt
+ret = device_lock_interruptible(mutex);
+if (ret) stmnt
|
-if ((ret = get_ready_ep(expr1, expr2, expr3)) < 0) stmnt +ret = get_ready_ep(expr1, expr2, expr3);
+if (ret) stmnt
|
-ret = mlxbf2_gpio_lock_acquire(mutex);
-if (ret < 0) stmnt
+ret = mlxbf2_gpio_lock_acquire(mutex);
+if (ret) stmnt
|
-int ret = mutex_lock_interruptible(mutex);
-if (ret < 0) stmnt
+int ret = mutex_lock_interruptible(mutex);
+if (ret) stmnt
|
-ret = mutex_lock_interruptible(mutex);
-if (ret < 0) stmnt
+ret = mutex_lock_interruptible(mutex);
+if (ret) stmnt
|
-if ((ret = mutex_lock_interruptible(mutex))) -return ret;
+ret = mutex_lock_interruptible(&d->usb_mutex); +if (ret) return ret;
|
-if (mutex_lock_interruptible(mutex) == -EINTR) stmnt +if (mutex_lock_interruptible(mutex)) stmnt
|
-ret = mutex_lock_killable(mutex);
-if (ret < 0) stmnt
+ret = mutex_lock_killable(mutex);
+if (ret) stmnt
|
-ret = mutex_lock_killable_nested(mutex);
-if (ret < 0) stmnt
+ret = mutex_lock_killable_nested(mutex);
+if (ret) stmnt
|
-ret = tty_write_lock(tty, expr);
-if (ret < 0) stmnt
+ret = tty_write_lock(tty, expr);
+if (ret) stmnt
|
-if (tty_write_lock(tty, expr) < 0) stmnt
+if (tty_write_lock(tty, expr)) stmnt
|
-if (tty_write_lock(tty, expr) < 0) stmnt;
-if (ret < 0) stmnt
+ret = tty_write_lock(tty, expr);
+if (ret) stmnt
|
-ret = usb_lock_device_for_reset(expr1, expr2); -if (ret < 0) stmnt
+ret = usb_lock_device_for_reset(expr1, expr2); +if (ret) stmnt
|
-ret = usb_lock_device_for_reset(expr1, expr2); -if (ret < 0) stmnt1 else stmnt2
+ret = usb_lock_device_for_reset(expr1, expr2); +if (ret) stmnt1 else stmnt2
|
-ret = usb_lock_device_for_reset(expr1, expr2); -if (ret >= 0) stmnt
+ret = usb_lock_device_for_reset(expr1, expr2); +if (ret == 0) stmnt
|
-ret = usb_lock_device_interruptible(expr);
-if (ret < 0) stmnt
+ret = usb_lock_device_interruptible(expr);
+if (ret) stmnt
|
-ret = usblp_rwait_and_lock(mutex, expr);
-if (ret < 0) stmnt
+ret = usblp_rwait_and_lock(mutex, expr);
+if (ret) stmnt
)

---
 drivers/gpio/gpio-mlxbf2.c                    |  4 +-
 drivers/hwmon/asus_rog_ryujin.c               |  4 +-
 drivers/hwmon/gigabyte_waterforce.c           |  2 +-
 drivers/hwmon/nzxt-kraken3.c                  |  2 +-
 drivers/infiniband/ulp/srp/ib_srp.c           |  2 +-
 drivers/infiniband/ulp/srpt/ib_srpt.c         |  4 +-
 drivers/leds/leds-blinkm.c                    |  2 +-
 drivers/media/dvb-frontends/bcm3510.c         |  2 +-
 drivers/media/dvb-frontends/dib0070.c         |  4 +-
 drivers/media/dvb-frontends/dib0090.c         |  8 ++--
 drivers/media/dvb-frontends/dib7000m.c        |  4 +-
 drivers/media/dvb-frontends/dib7000p.c        |  4 +-
 drivers/media/dvb-frontends/dib8000.c         | 10 ++---
 drivers/media/dvb-frontends/dib9000.c         | 42 +++++++++----------
 drivers/media/dvb-frontends/dibx000_common.c  | 10 ++---
 drivers/media/usb/dvb-usb-v2/af9035.c         |  2 +-
 drivers/media/usb/dvb-usb-v2/anysee.c         |  2 +-
 drivers/media/usb/dvb-usb-v2/au6610.c         |  2 +-
 drivers/media/usb/dvb-usb-v2/az6007.c         |  6 +--
 drivers/media/usb/dvb-usb-v2/ce6230.c         |  2 +-
 drivers/media/usb/dvb-usb-v2/dvbsky.c         |  2 +-
 drivers/media/usb/dvb-usb-v2/ec168.c          |  2 +-
 drivers/media/usb/dvb-usb-v2/lmedm04.c        |  2 +-
 drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c   |  2 +-
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c       |  2 +-
 drivers/media/usb/dvb-usb/af9005.c            |  2 +-
 drivers/media/usb/dvb-usb/az6027.c            |  2 +-
 drivers/media/usb/dvb-usb/cxusb.c             |  2 +-
 drivers/media/usb/dvb-usb/dib0700_core.c      | 20 ++++-----
 drivers/media/usb/dvb-usb/dibusb-common.c     |  2 +-
 drivers/media/usb/dvb-usb/digitv.c            |  2 +-
 drivers/media/usb/dvb-usb/dtv5100.c           |  2 +-
 drivers/media/usb/dvb-usb/dvb-usb-urb.c       |  3 +-
 drivers/media/usb/dvb-usb/dw2102.c            | 16 +++----
 drivers/media/usb/dvb-usb/gp8psk.c            |  6 ++-
 drivers/media/usb/dvb-usb/m920x.c             |  2 +-
 drivers/media/usb/dvb-usb/opera1.c            |  4 +-
 drivers/media/usb/dvb-usb/pctv452e.c          |  4 +-
 drivers/media/usb/dvb-usb/technisat-usb2.c    | 10 ++---
 drivers/media/usb/dvb-usb/ttusb2.c            |  2 +-
 drivers/media/usb/dvb-usb/vp702x.c            |  5 ++-
 .../media/usb/ttusb-budget/dvb-ttusb-budget.c |  4 +-
 drivers/media/usb/uvc/uvc_ctrl.c              |  6 +--
 drivers/net/ethernet/mellanox/mlxsw/i2c.c     |  4 +-
 drivers/net/usb/cdc_subset.c                  |  2 +-
 drivers/net/wireless/intersil/p54/p54usb.c    |  2 +-
 drivers/net/wireless/ti/wlcore/sysfs.c        |  2 +-
 drivers/platform/x86/thinkpad_acpi.c          | 12 +++---
 drivers/scsi/hpsa.c                           |  2 +-
 .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c        |  4 +-
 drivers/tty/tty_io.c                          |  6 +--
 drivers/usb/class/cdc-wdm.c                   |  3 +-
 drivers/usb/class/usblp.c                     |  2 +-
 drivers/usb/core/message.c                    |  2 +-
 drivers/usb/core/sysfs.c                      | 24 +++++------
 drivers/usb/gadget/legacy/inode.c             | 13 +++---
 drivers/usb/misc/yurex.c                      |  2 +-
 drivers/usb/storage/transport.c               |  2 +-
 drivers/usb/usb-skeleton.c                    |  2 +-
 drivers/usb/usbip/stub_dev.c                  |  2 +-
 drivers/usb/usbip/stub_rx.c                   |  2 +-
 drivers/w1/masters/omap_hdq.c                 |  8 ++--
 fs/afs/validation.c                           |  2 +-
 fs/afs/vl_alias.c                             |  6 +--
 fs/fsopen.c                                   |  2 +-
 fs/namespace.c                                |  2 +-
 fs/orangefs/devorangefs-req.c                 |  2 +-
 fs/proc/base.c                                |  2 +-
 kernel/seccomp.c                              | 10 ++---
 mm/kmemleak.c                                 |  4 +-
 net/rxrpc/recvmsg.c                           |  2 +-
 net/rxrpc/sendmsg.c                           |  2 +-
 security/integrity/ima/ima_fs.c               |  2 +-
 sound/pci/oxygen/oxygen_lib.c                 |  2 +-
 74 files changed, 181 insertions(+), 175 deletions(-)
drivers/gpio/gpio-mlxbf2.c +2 -2
index 6f3dda6b635f..5ae07367955f 100644
@@ -191,7 +191,7 @@ static int mlxbf2_gpio_direction_input(struct gpio_chip *chip,
 	 * if it is still enabled to be able to write to the ModeX registers.
 	 */
 	ret = mlxbf2_gpio_lock_acquire(gs);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	writel(BIT(offset), gs->gpio_io + YU_GPIO_MODE0_CLEAR);
@@ -219,7 +219,7 @@ static int mlxbf2_gpio_direction_output(struct gpio_chip *chip,
 	 * ModeX registers.
 	 */
 	ret = mlxbf2_gpio_lock_acquire(gs);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	writel(BIT(offset), gs->gpio_io + YU_GPIO_MODE1_CLEAR);
drivers/hwmon/asus_rog_ryujin.c +2 -2
index e5e93a20723c..26387286a5c6 100644
@@ -198,7 +198,7 @@ static int rog_ryujin_get_status(struct rog_ryujin_data *priv)
 {
 	int ret = mutex_lock_interruptible(&priv->status_report_request_mutex);
 
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (!time_after(jiffies, priv->updated + msecs_to_jiffies(STATUS_VALIDITY))) {
@@ -304,7 +304,7 @@ static int rog_ryujin_write_fixed_duty(struct rog_ryujin_data *priv, int channel
 		 * together, then write back with one of them modified.
 		 */
 		ret = mutex_lock_interruptible(&priv->status_report_request_mutex);
-		if (ret < 0)
+		if (ret)
 			return ret;
 		ret =
 		    rog_ryujin_execute_cmd(priv, get_cooler_duty_cmd, GET_CMD_LENGTH,
drivers/hwmon/gigabyte_waterforce.c +1 -1
index 27487e215bdd..43c3b300e11f 100644
@@ -125,7 +125,7 @@ static int waterforce_get_status(struct waterforce_data *priv)
 {
 	int ret = mutex_lock_interruptible(&priv->status_report_request_mutex);
 
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (!time_after(jiffies, priv->updated + msecs_to_jiffies(STATUS_VALIDITY))) {
drivers/hwmon/nzxt-kraken3.c +1 -1
index d00409bcab93..9a3be62fef62 100644
@@ -251,7 +251,7 @@ static int kraken3_read_z53(struct kraken3_data *priv)
 {
 	int ret = mutex_lock_interruptible(&priv->z53_status_request_lock);
 
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (!time_after(jiffies, priv->updated + msecs_to_jiffies(STATUS_VALIDITY))) {
drivers/infiniband/ulp/srp/ib_srp.c +1 -1
index 1378651735f6..cf84e7423bb6 100644
@@ -3731,7 +3731,7 @@ static ssize_t add_target_store(struct device *dev,
 	scsi_host_get(target->scsi_host);
 
 	ret = mutex_lock_interruptible(&host->add_target_mutex);
-	if (ret < 0)
+	if (ret)
 		goto put;
 
 	ret = srp_parse_options(target->net, buf, target);
drivers/infiniband/ulp/srpt/ib_srpt.c +2 -2
index 5dfb4644446b..0557617daa75 100644
@@ -3647,10 +3647,10 @@ static ssize_t srpt_tpg_attrib_use_srq_store(struct config_item *item,
 		return -EINVAL;
 
 	ret = mutex_lock_interruptible(&sdev->sdev_mutex);
-	if (ret < 0)
+	if (ret)
 		return ret;
 	ret = mutex_lock_interruptible(&sport->mutex);
-	if (ret < 0)
+	if (ret)
 		goto unlock_sdev;
 	enabled = sport->enabled;
 	/* Log out all initiator systems before changing 'use_srq'. */
drivers/leds/leds-blinkm.c +1 -1
index 577497b9d426..79552b41f2c1 100644
@@ -357,7 +357,7 @@ static int blinkm_transfer_hw(struct i2c_client *client, int cmd)
 
 	/* We start hardware transfers which are not to be
 	 * mixed with other commands. Aquire a lock now. */
-	if (mutex_lock_interruptible(&data->update_lock) < 0)
+	if (mutex_lock_interruptible(&data->update_lock))
 		return -EAGAIN;
 
 	/* switch cmd - usually write before reads */
drivers/media/dvb-frontends/bcm3510.c +1 -1
index d935fb10e620..f9f853e2ef80 100644
@@ -225,7 +225,7 @@ static int bcm3510_do_hab_cmd(struct bcm3510_state *st, u8 cmd, u8 msgid, u8 *ob
 	dbufout(ob,olen+2,deb_hab);
 	deb_hab("\n");
 
-	if (mutex_lock_interruptible(&st->hab_mutex) < 0)
+	if (mutex_lock_interruptible(&st->hab_mutex))
 		return -EAGAIN;
 
 	if ((ret = bcm3510_hab_send_request(st, ob, olen+2)) < 0 ||
drivers/media/dvb-frontends/dib0070.c +2 -2
index 9a8e7cdd2a24..ddbea15d69bb 100644
@@ -70,7 +70,7 @@ static u16 dib0070_read_reg(struct dib0070_state *state, u8 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -102,7 +102,7 @@ static int dib0070_write_reg(struct dib0070_state *state, u8 reg, u16 val)
 {
 	int ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
drivers/media/dvb-frontends/dib0090.c +4 -4
index 6cbbb351d545..de9bbdec07ab 100644
@@ -201,7 +201,7 @@ static u16 dib0090_read_reg(struct dib0090_state *state, u8 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -233,7 +233,7 @@ static int dib0090_write_reg(struct dib0090_state *state, u32 reg, u16 val)
 {
 	int ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
@@ -262,7 +262,7 @@ static u16 dib0090_fw_read_reg(struct dib0090_fw_state *state, u8 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -289,7 +289,7 @@ static int dib0090_fw_write_reg(struct dib0090_fw_state *state, u8 reg, u16 val)
 {
 	int ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
drivers/media/dvb-frontends/dib7000m.c +2 -2
index fdb22f32e3a1..b5cab2df9478 100644
@@ -77,7 +77,7 @@ static u16 dib7000m_read_word(struct dib7000m_state *state, u16 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -108,7 +108,7 @@ static int dib7000m_write_word(struct dib7000m_state *state, u16 reg, u16 val)
 {
 	int ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
drivers/media/dvb-frontends/dib7000p.c +2 -2
index c5582d4fa5be..28c224a450cb 100644
@@ -96,7 +96,7 @@ static u16 dib7000p_read_word(struct dib7000p_state *state, u16 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -126,7 +126,7 @@ static int dib7000p_write_word(struct dib7000p_state *state, u16 reg, u16 val)
 {
 	int ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
drivers/media/dvb-frontends/dib8000.c +5 -5
index 2f5165918163..cae8686042a8 100644
@@ -150,7 +150,7 @@ static u16 dib8000_i2c_read16(struct i2c_device *i2c, u16 reg)
 		{.addr = i2c->addr >> 1, .flags = I2C_M_RD, .len = 2},
 	};
 
-	if (mutex_lock_interruptible(i2c->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(i2c->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -197,7 +197,7 @@ static u16 dib8000_read_word(struct dib8000_state *state, u16 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -213,7 +213,7 @@ static u32 dib8000_read32(struct dib8000_state *state, u16 reg)
 {
 	u16 rw[2];
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -231,7 +231,7 @@ static int dib8000_i2c_write16(struct i2c_device *i2c, u16 reg, u16 val)
 	struct i2c_msg msg = {.addr = i2c->addr >> 1, .flags = 0, .len = 4};
 	int ret = 0;
 
-	if (mutex_lock_interruptible(i2c->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(i2c->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
@@ -252,7 +252,7 @@ static int dib8000_write_word(struct dib8000_state *state, u16 reg, u16 val)
 {
 	int ret;
 
-	if (mutex_lock_interruptible(&state->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&state->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
drivers/media/dvb-frontends/dib9000.c +21 -21

162 lines not on this page · raw message

drivers/media/dvb-frontends/dibx000_common.c +5 -5
index 63a4c6a4afb5..1db6a1dbeb01 100644
@@ -21,7 +21,7 @@ static int dibx000_write_word(struct dibx000_i2c_master *mst, u16 reg, u16 val)
 {
 	int ret;
 
-	if (mutex_lock_interruptible(&mst->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&mst->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
@@ -47,7 +47,7 @@ static u16 dibx000_read_word(struct dibx000_i2c_master *mst, u16 reg)
 {
 	u16 ret;
 
-	if (mutex_lock_interruptible(&mst->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&mst->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return 0;
 	}
@@ -296,7 +296,7 @@ static int dibx000_i2c_gated_gpio67_xfer(struct i2c_adapter *i2c_adap,
 
 	dibx000_i2c_select_interface(mst, DIBX000_I2C_INTERFACE_GPIO_6_7);
 
-	if (mutex_lock_interruptible(&mst->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&mst->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
@@ -343,7 +343,7 @@ static int dibx000_i2c_gated_tuner_xfer(struct i2c_adapter *i2c_adap,
 
 	dibx000_i2c_select_interface(mst, DIBX000_I2C_INTERFACE_TUNER);
 
-	if (mutex_lock_interruptible(&mst->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&mst->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
@@ -440,7 +440,7 @@ int dibx000_init_i2c_master(struct dibx000_i2c_master *mst, u16 device_rev,
 	int ret;
 
 	mutex_init(&mst->i2c_buffer_lock);
-	if (mutex_lock_interruptible(&mst->i2c_buffer_lock) < 0) {
+	if (mutex_lock_interruptible(&mst->i2c_buffer_lock)) {
 		dprintk("could not acquire lock\n");
 		return -EINVAL;
 	}
drivers/media/usb/dvb-usb-v2/af9035.c +1 -1
index 218f712f56b1..b873e39dbbbe 100644
@@ -271,7 +271,7 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
 	struct state *state = d_to_priv(d);
 	int ret;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	/*
drivers/media/usb/dvb-usb-v2/anysee.c +1 -1
index bea12cdc85e8..a5b2832f0a24 100644
@@ -188,7 +188,7 @@ static int anysee_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msg,
 	int ret = 0, inc, i = 0;
 	u8 buf[52]; /* 4 + 48 (I2C WR USB command header + I2C WR max) */
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	while (i < num) {
drivers/media/usb/dvb-usb-v2/au6610.c +1 -1
index be223fc8aa14..016f37c0bb70 100644
@@ -89,7 +89,7 @@ static int au6610_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	if (num > 2)
 		return -EINVAL;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb-v2/az6007.c +3 -3
index 2410054ddb2c..24eb74f521e5 100644
@@ -128,7 +128,7 @@ static int az6007_read(struct dvb_usb_device *d, u8 req, u16 value,
 	struct az6007_device_state *st = d->priv;
 	int ret;
 
-	if (mutex_lock_interruptible(&st->mutex) < 0)
+	if (mutex_lock_interruptible(&st->mutex))
 		return -EAGAIN;
 
 	ret = __az6007_read(d->udev, req, value, index, b, blen);
@@ -175,7 +175,7 @@ static int az6007_write(struct dvb_usb_device *d, u8 req, u16 value,
 	struct az6007_device_state *st = d->priv;
 	int ret;
 
-	if (mutex_lock_interruptible(&st->mutex) < 0)
+	if (mutex_lock_interruptible(&st->mutex))
 		return -EAGAIN;
 
 	ret = __az6007_write(d->udev, req, value, index, b, blen);
@@ -752,7 +752,7 @@ static int az6007_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
 	int length;
 	u8 req, addr;
 
-	if (mutex_lock_interruptible(&st->mutex) < 0)
+	if (mutex_lock_interruptible(&st->mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb-v2/ce6230.c +1 -1
index d3b5cb4a24da..615c6b9f4b75 100644
@@ -94,7 +94,7 @@ static int ce6230_i2c_master_xfer(struct i2c_adapter *adap,
 
 	memset(&req, 0, sizeof(req));
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	while (i < num) {
drivers/media/usb/dvb-usb-v2/dvbsky.c +1 -1
index 1221c924312a..bfe05efdd1e8 100644
@@ -103,7 +103,7 @@ static int dvbsky_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	int ret = 0;
 	u8 ibuf[64], obuf[64];
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	if (num > 2) {
drivers/media/usb/dvb-usb-v2/ec168.c +1 -1
index 0e4773fc025c..5cbafdc8e0aa 100644
@@ -109,7 +109,7 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	if (num > 2)
 		return -EINVAL;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	while (i < num) {
drivers/media/usb/dvb-usb-v2/lmedm04.c +1 -1
index f0537b741d13..2a7db30a50c6 100644
@@ -147,7 +147,7 @@ static int lme2510_usb_talk(struct dvb_usb_device *d,
 		return -EINVAL;
 
 	ret = mutex_lock_interruptible(&d->usb_mutex);
-	if (ret < 0)
+	if (ret)
 		return -EAGAIN;
 
 	memcpy(st->usb_buffer, wbuf, wlen);
drivers/media/usb/dvb-usb-v2/mxl111sf-i2c.c +1 -1
index 100a1052dcbc..2804c6dc27c1 100644
@@ -804,7 +804,7 @@ int mxl111sf_i2c_xfer(struct i2c_adapter *adap,
 	int hwi2c = (state->chip_rev > MXL111SF_V6);
 	int i, ret;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb-v2/rtl28xxu.c +1 -1
index f7884bb56fcc..1bb5453bcbd7 100644
@@ -166,7 +166,7 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	 * where write is more than one byte.
 	 */
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	if (num == 2 && !(msg[0].flags & I2C_M_RD) &&
drivers/media/usb/dvb-usb/af9005.c +1 -1
index 13604e6acdb8..69fd71e0f7bd 100644
@@ -407,7 +407,7 @@ static int af9005_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	u8 reg, addr;
 	u8 *value;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	if (num > 2)
drivers/media/usb/dvb-usb/az6027.c +1 -1
index 2bc27710427d..4bef1850b598 100644
@@ -962,7 +962,7 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int n
 	if (!data)
 		return -ENOMEM;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->i2c_mutex)) {
 		kfree(data);
 		return -EAGAIN;
 	}
drivers/media/usb/dvb-usb/cxusb.c +1 -1
index 1d98d3465e28..23f7931ccd95 100644
@@ -183,7 +183,7 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	int ret;
 	int i;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb/dib0700_core.c +10 -10
index 1caabb51ea47..38fae706a7ff 100644
@@ -24,7 +24,7 @@ int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion,
 	struct dib0700_state *st = d->priv;
 	int ret;
 
-	if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->usb_mutex)) {
 		err("could not acquire lock");
 		return -EINTR;
 	}
@@ -110,7 +110,7 @@ int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio, u8 gpio_
 	struct dib0700_state *st = d->priv;
 	int ret;
 
-	if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->usb_mutex)) {
 		err("could not acquire lock");
 		return -EINTR;
 	}
@@ -131,7 +131,7 @@ static int dib0700_set_usb_xfer_len(struct dvb_usb_device *d, u16 nb_ts_packets)
 	int ret;
 
 	if (st->fw_version >= 0x10201) {
-		if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+		if (mutex_lock_interruptible(&d->usb_mutex)) {
 			err("could not acquire lock");
 			return -EINTR;
 		}
@@ -171,7 +171,7 @@ static int dib0700_i2c_xfer_new(struct i2c_adapter *adap, struct i2c_msg *msg,
 
 	/* Ensure nobody else hits the i2c bus while we're sending our
 	   sequence of messages, (such as the remote control thread) */
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EINTR;
 
 	for (i = 0; i < num; i++) {
@@ -229,7 +229,7 @@ static int dib0700_i2c_xfer_new(struct i2c_adapter *adap, struct i2c_msg *msg,
 
 		} else {
 			/* Write request */
-			if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+			if (mutex_lock_interruptible(&d->usb_mutex)) {
 				err("could not acquire lock");
 				result = -EINTR;
 				goto unlock;
@@ -286,9 +286,9 @@ static int dib0700_i2c_xfer_legacy(struct i2c_adapter *adap,
 	struct dib0700_state *st = d->priv;
 	int i, len, result;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EINTR;
-	if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->usb_mutex)) {
 		err("could not acquire lock");
 		mutex_unlock(&d->i2c_mutex);
 		return -EINTR;
@@ -404,7 +404,7 @@ static int dib0700_set_clock(struct dvb_usb_device *d, u8 en_pll,
 	struct dib0700_state *st = d->priv;
 	int ret;
 
-	if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->usb_mutex)) {
 		err("could not acquire lock");
 		return -EINTR;
 	}
@@ -436,7 +436,7 @@ int dib0700_set_i2c_speed(struct dvb_usb_device *d, u16 scl_kHz)
 	if (scl_kHz == 0)
 		return -EINVAL;
 
-	if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->usb_mutex)) {
 		err("could not acquire lock");
 		return -EINTR;
 	}
@@ -641,7 +641,7 @@ int dib0700_change_protocol(struct rc_dev *rc, u64 *rc_proto)
 	struct dib0700_state *st = d->priv;
 	int new_proto, ret;
 
-	if (mutex_lock_interruptible(&d->usb_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->usb_mutex)) {
 		err("could not acquire lock");
 		return -EINTR;
 	}
drivers/media/usb/dvb-usb/dibusb-common.c +1 -1
index 20f1ef3393a5..6b7de78d0d71 100644
@@ -181,7 +181,7 @@ static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
 	struct dvb_usb_device *d = i2c_get_adapdata(adap);
 	int i;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb/digitv.c +1 -1
index 32134be16914..8ea758176fda 100644
@@ -56,7 +56,7 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
 	struct dvb_usb_device *d = i2c_get_adapdata(adap);
 	int i;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	if (num > 2)
drivers/media/usb/dvb-usb/dtv5100.c +1 -1
index 56c9d521a34a..dace8196fb61 100644
@@ -72,7 +72,7 @@ static int dtv5100_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	if (num > 2)
 		return -EINVAL;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb/dvb-usb-urb.c +2 -1
index 2aabf90d8697..6a35a218d4de 100644
@@ -22,7 +22,8 @@ int dvb_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
 		return -EINVAL;
 	}
 
-	if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
+	ret = mutex_lock_interruptible(&d->usb_mutex);
+	if (ret)
 		return ret;
 
 	deb_xfer(">>> ");
drivers/media/usb/dvb-usb/dw2102.c +8 -8
index 79e2ccf974c9..fea99192c627 100644
@@ -121,7 +121,7 @@ static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 
 	if (!d)
 		return -ENODEV;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	switch (num) {
@@ -216,7 +216,7 @@ static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap,
 
 	if (!d)
 		return -ENODEV;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	switch (num) {
@@ -291,7 +291,7 @@ static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg ms
 
 	if (!d)
 		return -ENODEV;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	switch (num) {
@@ -399,7 +399,7 @@ static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], i
 
 	if (!d)
 		return -ENODEV;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (j = 0; j < num; j++) {
@@ -501,7 +501,7 @@ static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 
 	if (!d)
 		return -ENODEV;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	switch (num) {
@@ -589,7 +589,7 @@ static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 	if (!d)
 		return -ENODEV;
 	udev = d->udev;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (j = 0; j < num; j++) {
@@ -726,9 +726,9 @@ static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 
 	state = d->priv;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
-	if (mutex_lock_interruptible(&d->data_mutex) < 0) {
+	if (mutex_lock_interruptible(&d->data_mutex)) {
 		mutex_unlock(&d->i2c_mutex);
 		return -EAGAIN;
 	}
drivers/media/usb/dvb-usb/gp8psk.c +4 -2
index 4cd21bb8805e..c0d617536127 100644
@@ -35,7 +35,8 @@ static int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value,
 	if (blen > sizeof(st->data))
 		return -EIO;
 
-	if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
+	ret = mutex_lock_interruptible(&d->usb_mutex);
+	if (ret)
 		return ret;
 
 	while (ret >= 0 && ret != blen && try < 3) {
@@ -77,7 +78,8 @@ static int gp8psk_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
 	if (blen > sizeof(st->data))
 		return -EIO;
 
-	if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
+	ret = mutex_lock_interruptible(&d->usb_mutex);
+	if (ret)
 		return ret;
 
 	memcpy(st->data, b, blen);
drivers/media/usb/dvb-usb/m920x.c +1 -1
index a2054b1b100f..0536d3d7152a 100644
@@ -252,7 +252,7 @@ static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int nu
 	int i, j;
 	int ret = 0;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb/opera1.c +2 -2
index 268f05fc8691..075c1153e2ab 100644
@@ -92,7 +92,7 @@ static int opera1_usb_i2c_msgxfer(struct dvb_usb_device *dev, u16 addr,
 		info("no usb_device");
 		return -EINVAL;
 	}
-	if (mutex_lock_interruptible(&dev->usb_mutex) < 0)
+	if (mutex_lock_interruptible(&dev->usb_mutex))
 		return -EAGAIN;
 
 	switch (addr>>1){
@@ -132,7 +132,7 @@ static int opera1_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
 
 	if (!d)
 		return -ENODEV;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
drivers/media/usb/dvb-usb/pctv452e.c +2 -2
index 2aab49003493..71e4503968a8 100644
@@ -478,7 +478,7 @@ static int pctv452e_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msg,
 	struct dvb_usb_device *d = i2c_get_adapdata(adapter);
 	int i;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
@@ -623,7 +623,7 @@ static int pctv452e_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
 	int ret;
 
 	ret = -EAGAIN;
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		goto failed;
 
 	ret = pctv452e_i2c_msg(d, I2C_ADDR_24C16,
drivers/media/usb/dvb-usb/technisat-usb2.c +5 -5
index df90c6c5f3b9..265059be66e1 100644
@@ -166,7 +166,7 @@ static int technisat_usb2_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msg
 
 	/* Ensure nobody else hits the i2c bus while we're sending our
 	   sequence of messages, (such as the remote control thread) */
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	for (i = 0; i < num; i++) {
@@ -259,7 +259,7 @@ static int technisat_usb2_set_led(struct dvb_usb_device *d, int red,
 		break;
 	}
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	ret = usb_control_msg(d->udev, usb_sndctrlpipe(d->udev, 0),
@@ -280,7 +280,7 @@ static int technisat_usb2_set_led_timer(struct dvb_usb_device *d, u8 red, u8 gre
 
 	b[0] = 0;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	ret = usb_control_msg(d->udev, usb_sndctrlpipe(d->udev, 0),
@@ -550,7 +550,7 @@ static int technisat_usb2_frontend_attach(struct dvb_usb_adapter *a)
 			if (a->fe_adap[0].fe->ops.init)
 				a->fe_adap[0].fe->ops.init(a->fe_adap[0].fe);
 
-			if (mutex_lock_interruptible(&a->dev->i2c_mutex) < 0)
+			if (mutex_lock_interruptible(&a->dev->i2c_mutex))
 				return -EAGAIN;
 
 			ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
@@ -618,7 +618,7 @@ static int technisat_usb2_get_ir(struct dvb_usb_device *d)
 	buf[3] = MINIMUM_IR_BIT_TRANSITION_TICK_COUNT;
 	buf[4] = MAXIMUM_IR_BIT_TIME_TICK_COUNT;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 	ret = usb_control_msg(d->udev, usb_sndctrlpipe(d->udev, 0),
 			GET_IR_DATA_VENDOR_REQUEST,
drivers/media/usb/dvb-usb/ttusb2.c +1 -1
index 373ffa7f641e..3e0e4917f6a3 100644
@@ -371,7 +371,7 @@ static int ttusb2_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
 	static u8 obuf[60], ibuf[60];
 	int i, write_read, read;
 
-	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
+	if (mutex_lock_interruptible(&d->i2c_mutex))
 		return -EAGAIN;
 
 	if (num > 2)
drivers/media/usb/dvb-usb/vp702x.c +3 -2
index 5b6740cbd1d1..3c513c3ac578 100644
@@ -99,7 +99,8 @@ int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int il
 {
 	int ret;
 
-	if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
+	ret = mutex_lock_interruptible(&d->usb_mutex);
+	if (ret)
 		return ret;
 
 	ret = vp702x_usb_out_op_unlocked(d, REQUEST_OUT, 0, 0, o, olen);
@@ -119,7 +120,7 @@ static int vp702x_usb_inout_cmd(struct dvb_usb_device *d, u8 cmd, u8 *o,
 	int buflen = max(olen + 2, ilen + 1);
 
 	ret = mutex_lock_interruptible(&st->buf_mutex);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (buflen > st->buf_len) {
drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c +2 -2
index 9e016b71aa91..7a25e823f1f5 100644
@@ -143,7 +143,7 @@ static int ttusb_cmd(struct ttusb *ttusb, u8 *data, int len, int len_result)
 	int actual_len;
 	int err;
 
-	if (mutex_lock_interruptible(&ttusb->semusb) < 0)
+	if (mutex_lock_interruptible(&ttusb->semusb))
 		return -EAGAIN;
 
 	if (debug >= 3)
@@ -236,7 +236,7 @@ static int master_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num
 	int i = 0;
 	int inc;
 
-	if (mutex_lock_interruptible(&ttusb->semi2c) < 0)
+	if (mutex_lock_interruptible(&ttusb->semi2c))
 		return -EAGAIN;
 
 	while (i < num) {
drivers/media/usb/uvc/uvc_ctrl.c +3 -3
index 4e58476d305e..043dceb77754 100644
@@ -1392,7 +1392,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
 	int ret;
 
 	ret = mutex_lock_interruptible(&chain->ctrl_mutex);
-	if (ret < 0)
+	if (ret)
 		return -ERESTARTSYS;
 
 	/* Check if the ctrl is a know class */
@@ -1453,7 +1453,7 @@ int uvc_query_v4l2_menu(struct uvc_video_chain *chain,
 		return -EINVAL;
 
 	ret = mutex_lock_interruptible(&chain->ctrl_mutex);
-	if (ret < 0)
+	if (ret)
 		return -ERESTARTSYS;
 
 	ctrl = uvc_find_control(chain, query_menu->id, &mapping);
@@ -1760,7 +1760,7 @@ static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
 	int ret;
 
 	ret = mutex_lock_interruptible(&handle->chain->ctrl_mutex);
-	if (ret < 0)
+	if (ret)
 		return -ERESTARTSYS;
 
 	if (__uvc_query_v4l2_class(handle->chain, sev->id, 0) >= 0) {
drivers/net/ethernet/mellanox/mlxsw/i2c.c +2 -2
index f9f565c1036d..f1675908253c 100644
@@ -426,7 +426,7 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size,
 		reg_size = mlxsw_i2c_get_reg_size(in_mbox);
 		num = DIV_ROUND_UP(reg_size, mlxsw_i2c->block_size);
 
-		if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) {
+		if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock)) {
 			dev_err(&client->dev, "Could not acquire lock");
 			return -EINVAL;
 		}
@@ -445,7 +445,7 @@ mlxsw_i2c_cmd(struct device *dev, u16 opcode, u32 in_mod, size_t in_mbox_size,
 		reg_size = MLXSW_I2C_MAX_DATA_SIZE;
 		num = DIV_ROUND_UP(reg_size, mlxsw_i2c->block_size);
 
-		if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock) < 0) {
+		if (mutex_lock_interruptible(&mlxsw_i2c->cmd.lock)) {
 			dev_err(&client->dev, "Could not acquire lock");
 			return -EINVAL;
 		}
drivers/net/usb/cdc_subset.c +1 -1
index f4a44f05c6ab..09e2c3bc1315 100644
@@ -80,7 +80,7 @@ static void m5632_recover(struct usbnet *dev)
 	int r;
 
 	r = usb_lock_device_for_reset(udev, intf);
-	if (r < 0)
+	if (r)
 		return;
 
 	usb_reset_device(udev);
drivers/net/wireless/intersil/p54/p54usb.c +1 -1
index cae47663b17b..a1c056612a83 100644
@@ -455,7 +455,7 @@ static int p54u_device_reset(struct ieee80211_hw *dev)
 
 	if (lock) {
 		ret = usb_lock_device_for_reset(priv->udev, priv->intf);
-		if (ret < 0) {
+		if (ret) {
 			dev_err(&priv->udev->dev, "(p54usb) unable to lock "
 				"device for reset (%d)!\n", ret);
 			return ret;
drivers/net/wireless/ti/wlcore/sysfs.c +1 -1
index 7c57d4c8744a..037d7dba9800 100644
@@ -97,7 +97,7 @@ static ssize_t wl1271_sysfs_read_fwlog(struct file *filp, struct kobject *kobj,
 	int ret;
 
 	ret = mutex_lock_interruptible(&wl->mutex);
-	if (ret < 0)
+	if (ret)
 		return -ERESTARTSYS;
 
 	/* Check if the fwlog is still valid */
drivers/platform/x86/thinkpad_acpi.c +6 -6
index 1fcb0f99695a..e4b823dbc996 100644
@@ -6462,7 +6462,7 @@ static void tpacpi_brightness_checkpoint_nvram(void)
 	vdbg_printk(TPACPI_DBG_BRGHT,
 		"trying to checkpoint backlight level to NVRAM...\n");
 
-	if (mutex_lock_killable(&brightness_mutex) < 0)
+	if (mutex_lock_killable(&brightness_mutex))
 		return;
 
 	if (unlikely(!acpi_ec_read(TP_EC_BACKLIGHT, &lec)))
@@ -6565,7 +6565,7 @@ static int brightness_set(unsigned int value)
 			"set backlight level to %d\n", value);
 
 	res = mutex_lock_killable(&brightness_mutex);
-	if (res < 0)
+	if (res)
 		return res;
 
 	switch (brightness_mode) {
@@ -6604,7 +6604,7 @@ static int brightness_get(struct backlight_device *bd)
 	int status, res;
 
 	res = mutex_lock_killable(&brightness_mutex);
-	if (res < 0)
+	if (res)
 		return 0;
 
 	res = tpacpi_brightness_get_raw(&status);
@@ -7075,7 +7075,7 @@ static void tpacpi_volume_checkpoint_nvram(void)
 	else
 		ec_mask = TP_EC_AUDIO_MUTESW_MSK | TP_EC_AUDIO_LVL_MSK;
 
-	if (mutex_lock_killable(&volume_mutex) < 0)
+	if (mutex_lock_killable(&volume_mutex))
 		return;
 
 	if (unlikely(!acpi_ec_read(TP_EC_AUDIO, &lec)))
@@ -7147,7 +7147,7 @@ static int __volume_set_mute_ec(const bool mute)
 	int rc;
 	u8 s, n;
 
-	if (mutex_lock_killable(&volume_mutex) < 0)
+	if (mutex_lock_killable(&volume_mutex))
 		return -EINTR;
 
 	rc = volume_get_status_ec(&s);
@@ -7195,7 +7195,7 @@ static int __volume_set_volume_ec(const u8 vol)
 	if (vol > TP_EC_VOLUME_MAX)
 		return -EINVAL;
 
-	if (mutex_lock_killable(&volume_mutex) < 0)
+	if (mutex_lock_killable(&volume_mutex))
 		return -EINTR;
 
 	rc = volume_get_status_ec(&s);
drivers/scsi/hpsa.c +1 -1
index 84d8de07b7ae..aff155682242 100644
@@ -3176,7 +3176,7 @@ static int hpsa_do_reset(struct ctlr_info *h, struct hpsa_scsi_dev_t *dev,
 	int rc = 0;
 
 	/* We can really only handle one reset at a time */
-	if (mutex_lock_interruptible(&h->reset_mutex) == -EINTR) {
+	if (mutex_lock_interruptible(&h->reset_mutex)) {
 		dev_warn(&h->pdev->dev, "concurrent reset wait interrupted.\n");
 		return -EINTR;
 	}
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +2 -2
index 85322af62c23..2939b9666729 100644
@@ -1175,7 +1175,7 @@ static int usb_gpib_init_module(struct usb_interface *interface)
 	int j, mask, rv;
 
 	rv = mutex_lock_interruptible(&minors_lock);
-	if (rv < 0)
+	if (rv)
 		return rv;
 
 	if (!assigned_usb_minors) {
@@ -1513,7 +1513,7 @@ static ssize_t skel_do_read(struct usb_skel *dev, char *buffer, size_t count)
 	DIA_LOG(2, "restart with %zd %zd.\n", dev->bulk_in_filled, dev->bulk_in_copied);
 
 	rv = mutex_lock_interruptible(&dev->io_mutex);
-	if (rv < 0)
+	if (rv)
 		return rv;
 
 	if (!dev->interface) {		      /* disconnect() was called */
drivers/tty/tty_io.c +3 -3
index 449dbd216460..6f152d483123 100644
@@ -965,7 +965,7 @@ static ssize_t iterate_tty_write(struct tty_ldisc *ld, struct tty_struct *tty,
 	ssize_t ret, written = 0;
 
 	ret = tty_write_lock(tty, file->f_flags & O_NDELAY);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	/*
@@ -1154,7 +1154,7 @@ int tty_send_xchar(struct tty_struct *tty, u8 ch)
 		return 0;
 	}
 
-	if (tty_write_lock(tty, false) < 0)
+	if (tty_write_lock(tty, false))
 		return -ERESTARTSYS;
 
 	down_read(&tty->termios_rwsem);
@@ -2486,7 +2486,7 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
 		return tty->ops->break_ctl(tty, duration);
 
 	/* Do the work ourselves */
-	if (tty_write_lock(tty, false) < 0)
+	if (tty_write_lock(tty, false))
 		return -EINTR;
 
 	retval = tty->ops->break_ctl(tty, -1);
drivers/usb/class/cdc-wdm.c +1 -2
index 86ee39db013f..0f77547438d3 100644
@@ -523,9 +523,8 @@ static ssize_t wdm_read
 	int i = 0;
 	struct wdm_device *desc = file->private_data;
 
-
 	rv = mutex_lock_interruptible(&desc->rlock); /*concurrent reads */
-	if (rv < 0)
+	if (rv)
 		return -ERESTARTSYS;
 
 	cntr = READ_ONCE(desc->length);
drivers/usb/class/usblp.c +1 -1
index e2527faa6592..c197e81e0307 100644
@@ -849,7 +849,7 @@ static ssize_t usblp_read(struct file *file, char __user *buffer, size_t len, lo
 		return -EINVAL;
 
 	rv = usblp_rwait_and_lock(usblp, !!(file->f_flags & O_NONBLOCK));
-	if (rv < 0)
+	if (rv)
 		return rv;
 
 	if (!usblp->present) {
drivers/usb/core/message.c +1 -1
index d2b2787be409..137e1dd964d0 100644
@@ -1900,7 +1900,7 @@ static void __usb_queue_reset_device(struct work_struct *ws)
 	struct usb_device *udev = interface_to_usbdev(iface);
 
 	rc = usb_lock_device_for_reset(udev, iface);
-	if (rc >= 0) {
+	if (rc == 0) {
 		usb_reset_device(udev);
 		usb_unlock_device(udev);
 	}
drivers/usb/core/sysfs.c +12 -12
index 23f3cb1989f4..0cff7f540c3a 100644
@@ -32,7 +32,7 @@ static ssize_t field##_show(struct device *dev,				\
 									\
 	udev = to_usb_device(dev);					\
 	rc = usb_lock_device_interruptible(udev);			\
-	if (rc < 0)							\
+	if (rc)								\
 		return -EINTR;						\
 	actconfig = udev->actconfig;					\
 	if (actconfig)							\
@@ -58,7 +58,7 @@ static ssize_t bMaxPower_show(struct device *dev,
 
 	udev = to_usb_device(dev);
 	rc = usb_lock_device_interruptible(udev);
-	if (rc < 0)
+	if (rc)
 		return -EINTR;
 	actconfig = udev->actconfig;
 	if (actconfig)
@@ -77,7 +77,7 @@ static ssize_t configuration_show(struct device *dev,
 
 	udev = to_usb_device(dev);
 	rc = usb_lock_device_interruptible(udev);
-	if (rc < 0)
+	if (rc)
 		return -EINTR;
 	actconfig = udev->actconfig;
 	if (actconfig && actconfig->string)
@@ -100,7 +100,7 @@ static ssize_t bConfigurationValue_store(struct device *dev,
 	if (sscanf(buf, "%d", &config) != 1 || config < -1 || config > 255)
 		return -EINVAL;
 	rc = usb_lock_device_interruptible(udev);
-	if (rc < 0)
+	if (rc)
 		return -EINTR;
 	value = usb_set_configuration(udev, config);
 	usb_unlock_device(udev);
@@ -130,7 +130,7 @@ static ssize_t  name##_show(struct device *dev,				\
 									\
 	udev = to_usb_device(dev);					\
 	retval = usb_lock_device_interruptible(udev);			\
-	if (retval < 0)							\
+	if (retval)							\
 		return -EINTR;						\
 	retval = sysfs_emit(buf, "%s\n", udev->name);			\
 	usb_unlock_device(udev);					\
@@ -279,7 +279,7 @@ static ssize_t avoid_reset_quirk_store(struct device *dev,
 	if (kstrtobool(buf, &val) != 0)
 		return -EINVAL;
 	rc = usb_lock_device_interruptible(udev);
-	if (rc < 0)
+	if (rc)
 		return -EINTR;
 	if (val)
 		udev->quirks |= USB_QUIRK_RESET;
@@ -334,7 +334,7 @@ static ssize_t persist_store(struct device *dev, struct device_attribute *attr,
 		return -EINVAL;
 
 	rc = usb_lock_device_interruptible(udev);
-	if (rc < 0)
+	if (rc)
 		return -EINTR;
 	udev->persist_enabled = !!value;
 	usb_unlock_device(udev);
@@ -460,7 +460,7 @@ static ssize_t level_store(struct device *dev, struct device_attribute *attr,
 		len = cp - buf;
 
 	rv = usb_lock_device_interruptible(udev);
-	if (rv < 0)
+	if (rv)
 		return -EINTR;
 
 	if (len == sizeof on_string - 1 &&
@@ -502,7 +502,7 @@ static ssize_t usb2_hardware_lpm_store(struct device *dev,
 	int ret;
 
 	ret = usb_lock_device_interruptible(udev);
-	if (ret < 0)
+	if (ret)
 		return -EINTR;
 
 	ret = kstrtobool(buf, &value);
@@ -579,7 +579,7 @@ static ssize_t usb3_hardware_lpm_u1_show(struct device *dev,
 	int rc;
 
 	rc = usb_lock_device_interruptible(udev);
-	if (rc < 0)
+	if (rc)
 		return -EINTR;
 
 	if (udev->usb3_lpm_u1_enabled)
@@ -601,7 +601,7 @@ static ssize_t usb3_hardware_lpm_u2_show(struct device *dev,
 	int rc;
 
 	rc = usb_lock_device_interruptible(udev);
-	if (rc < 0)
+	if (rc)
 		return -EINTR;
 
 	if (udev->usb3_lpm_u2_enabled)
@@ -1188,7 +1188,7 @@ static ssize_t supports_autosuspend_show(struct device *dev,
 	int s;
 
 	s = device_lock_interruptible(dev);
-	if (s < 0)
+	if (s)
 		return -EINTR;
 	/* Devices will be autosuspended even when an interface isn't claimed */
 	s = (!dev->driver || to_usb_driver(dev->driver)->supports_autosuspend);
drivers/usb/gadget/legacy/inode.c +8 -5
index b6a30d88a800..c4c9ad6d8596 100644
@@ -313,7 +313,7 @@ get_ready_ep (unsigned f_flags, struct ep_data *epdata, bool is_write)
 	}
 
 	val = mutex_lock_interruptible(&epdata->lock);
-	if (val < 0)
+	if (val)
 		return val;
 
 	switch (epdata->state) {
@@ -386,7 +386,7 @@ ep_release (struct inode *inode, struct file *fd)
 	int value;
 
 	value = mutex_lock_interruptible(&data->lock);
-	if (value < 0)
+	if (value)
 		return value;
 
 	/* clean up if this can be reopened */
@@ -406,7 +406,8 @@ static long ep_ioctl(struct file *fd, unsigned code, unsigned long value)
 	struct ep_data		*data = fd->private_data;
 	int			status;
 
-	if ((status = get_ready_ep (fd->f_flags, data, false)) < 0)
+	status = get_ready_ep(fd->f_flags, data, false);
+	if (status)
 		return status;
 
 	spin_lock_irq (&data->dev->lock);
@@ -587,7 +588,8 @@ ep_read_iter(struct kiocb *iocb, struct iov_iter *to)
 	ssize_t value;
 	char *buf;
 
-	if ((value = get_ready_ep(file->f_flags, epdata, false)) < 0)
+	value = get_ready_ep(file->f_flags, epdata, false);
+	if (value)
 		return value;
 
 	/* halt any endpoint by doing a "wrong direction" i/o call */
@@ -647,7 +649,8 @@ ep_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	ssize_t value;
 	char *buf;
 
-	if ((value = get_ready_ep(file->f_flags, epdata, true)) < 0)
+	value = get_ready_ep(file->f_flags, epdata, true);
+	if (value)
 		return value;
 
 	configured = epdata->state == STATE_EP_ENABLED;
drivers/usb/misc/yurex.c +1 -1
index 70dff0db5354..b0a1357c7941 100644
@@ -442,7 +442,7 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer,
 		goto error;
 
 	retval = mutex_lock_interruptible(&dev->io_mutex);
-	if (retval < 0)
+	if (retval)
 		return -EINTR;
 
 	if (dev->disconnected) {		/* already disconnected */
drivers/usb/storage/transport.c +1 -1
index e6bc8ecaecbb..52b85acaf756 100644
@@ -1427,7 +1427,7 @@ int usb_stor_port_reset(struct us_data *us)
 		return -EPERM;
 
 	result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
-	if (result < 0)
+	if (result)
 		usb_stor_dbg(us, "unable to lock device for reset: %d\n",
 			     result);
 	else {
drivers/usb/usb-skeleton.c +1 -1
index 900a64ad25e4..dba27776a037 100644
@@ -235,7 +235,7 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count,
 
 	/* no concurrent readers */
 	rv = mutex_lock_interruptible(&dev->io_mutex);
-	if (rv < 0)
+	if (rv)
 		return rv;
 
 	if (dev->disconnected) {		/* disconnect() was called */
drivers/usb/usbip/stub_dev.c +1 -1
index ce625b1ce9a5..2139930f25cb 100644
@@ -218,7 +218,7 @@ static void stub_device_reset(struct usbip_device *ud)
 	dev_dbg(&udev->dev, "device reset");
 
 	ret = usb_lock_device_for_reset(udev, NULL);
-	if (ret < 0) {
+	if (ret) {
 		dev_err(&udev->dev, "lock for reset\n");
 		spin_lock_irq(&ud->lock);
 		ud->status = SDEV_ST_ERROR;
drivers/usb/usbip/stub_rx.c +1 -1
index 9aa30ef76f3b..cecc3972c64a 100644
@@ -156,7 +156,7 @@ static int tweak_reset_device_cmd(struct urb *urb)
 	dev_info(&urb->dev->dev, "usb_queue_reset_device\n");
 
 	err = usb_lock_device_for_reset(sdev->udev, NULL);
-	if (err < 0) {
+	if (err) {
 		dev_err(&urb->dev->dev, "could not obtain lock to reset device\n");
 		return err;
 	}
drivers/w1/masters/omap_hdq.c +4 -4
index 69b1d145657a..f285368d3961 100644
@@ -135,7 +135,7 @@ static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
 	u8 tmp_status;
 
 	ret = mutex_lock_interruptible(&hdq_data->hdq_mutex);
-	if (ret < 0) {
+	if (ret) {
 		ret = -EINTR;
 		goto rtn;
 	}
@@ -235,7 +235,7 @@ static int omap_hdq_break(struct hdq_data *hdq_data)
 	u8 tmp_status;
 
 	ret = mutex_lock_interruptible(&hdq_data->hdq_mutex);
-	if (ret < 0) {
+	if (ret) {
 		dev_dbg(hdq_data->dev, "Could not acquire mutex\n");
 		ret = -EINTR;
 		goto rtn;
@@ -305,7 +305,7 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
 	u8 status;
 
 	ret = mutex_lock_interruptible(&hdq_data->hdq_mutex);
-	if (ret < 0) {
+	if (ret) {
 		ret = -EINTR;
 		goto rtn;
 	}
@@ -374,7 +374,7 @@ static u8 omap_w1_triplet(void *_hdq, u8 bdir)
 	}
 
 	err = mutex_lock_interruptible(&hdq_data->hdq_mutex);
-	if (err < 0) {
+	if (err) {
 		dev_dbg(hdq_data->dev, "Could not acquire mutex\n");
 		goto rtn;
 	}
fs/afs/validation.c +1 -1
index 0ba8336c9025..f7ff7a5b1b99 100644
@@ -420,7 +420,7 @@ int afs_validate(struct afs_vnode *vnode, struct key *key)
 	if (volume->cb_expires_at <= deadline ||
 	    atomic_read(&volume->cb_v_check) != atomic_read(&volume->cb_v_break)) {
 		ret = mutex_lock_interruptible(&volume->cb_check_lock);
-		if (ret < 0)
+		if (ret)
 			goto error_unlock;
 		locked_vol = true;
 	}
fs/afs/vl_alias.c +3 -3
index f9e76b604f31..e1c6a1df2745 100644
@@ -188,7 +188,7 @@ static int afs_query_for_alias(struct afs_cell *cell, struct key *key)
 
 	_enter("%s", cell->name);
 
-	if (mutex_lock_interruptible(&cell->net->proc_cells_lock) < 0)
+	if (mutex_lock_interruptible(&cell->net->proc_cells_lock))
 		return -ERESTARTSYS;
 
 	hlist_for_each_entry(p, &cell->net->proc_cells, proc_link) {
@@ -204,7 +204,7 @@ static int afs_query_for_alias(struct afs_cell *cell, struct key *key)
 		if (afs_query_for_alias_one(cell, key, p) != 0)
 			goto is_alias;
 
-		if (mutex_lock_interruptible(&cell->net->proc_cells_lock) < 0) {
+		if (mutex_lock_interruptible(&cell->net->proc_cells_lock)) {
 			afs_unuse_cell(cell->net, p, afs_cell_trace_unuse_check_alias);
 			return -ERESTARTSYS;
 		}
@@ -318,7 +318,7 @@ int afs_cell_detect_alias(struct afs_cell *cell, struct key *key)
 	struct afs_net *net = cell->net;
 	int ret;
 
-	if (mutex_lock_interruptible(&net->cells_alias_lock) < 0)
+	if (mutex_lock_interruptible(&net->cells_alias_lock))
 		return -ERESTARTSYS;
 
 	if (test_bit(AFS_CELL_FL_CHECK_ALIAS, &cell->flags)) {
fs/fsopen.c +1 -1
index 094a7f510edf..ec97bc018090 100644
@@ -33,7 +33,7 @@ static ssize_t fscontext_read(struct file *file,
 	int index, n;
 
 	ret = mutex_lock_interruptible(&fc->uapi_mutex);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (log->head == log->tail) {
fs/namespace.c +1 -1
index a3ed3f2980cb..dce085d51944 100644
@@ -4198,7 +4198,7 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
 	fc = fd_file(f)->private_data;
 
 	ret = mutex_lock_interruptible(&fc->uapi_mutex);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	/* There must be a valid superblock or we can't mount it */
fs/orangefs/devorangefs-req.c +1 -1
index 33ee8cb32f83..faf655549aff 100644
@@ -637,7 +637,7 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
 		 * mounts to fail)
 		 */
 		ret = mutex_lock_interruptible(&orangefs_request_mutex);
-		if (ret < 0)
+		if (ret)
 			return ret;
 		gossip_debug(GOSSIP_DEV_DEBUG,
 			     "%s: priority remount in progress\n",
fs/proc/base.c +1 -1
index cd89e956c322..630fad43d4d3 100644
@@ -2841,7 +2841,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
 
 	/* Guard against adverse ptrace interaction */
 	rv = mutex_lock_interruptible(&current->signal->cred_guard_mutex);
-	if (rv < 0)
+	if (rv)
 		goto out_free;
 
 	rv = security_setprocattr(PROC_I(inode)->op.lsmid,
kernel/seccomp.c +5 -5
index f59381c4a2ff..84c9b42f11ef 100644
@@ -1603,7 +1603,7 @@ static long seccomp_notify_send(struct seccomp_filter *filter,
 		return -EINVAL;
 
 	ret = mutex_lock_interruptible(&filter->notify_lock);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	knotif = find_notification(filter, resp.id);
@@ -1643,7 +1643,7 @@ static long seccomp_notify_id_valid(struct seccomp_filter *filter,
 		return -EFAULT;
 
 	ret = mutex_lock_interruptible(&filter->notify_lock);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	knotif = find_notification(filter, id);
@@ -1665,7 +1665,7 @@ static long seccomp_notify_set_flags(struct seccomp_filter *filter,
 		return -EINVAL;
 
 	ret = mutex_lock_interruptible(&filter->notify_lock);
-	if (ret < 0)
+	if (ret)
 		return ret;
 	filter->notif->flags = flags;
 	mutex_unlock(&filter->notify_lock);
@@ -1711,7 +1711,7 @@ static long seccomp_notify_addfd(struct seccomp_filter *filter,
 	init_completion(&kaddfd.completion);
 
 	ret = mutex_lock_interruptible(&filter->notify_lock);
-	if (ret < 0)
+	if (ret)
 		goto out;
 
 	knotif = find_notification(filter, addfd.id);
@@ -1824,7 +1824,7 @@ static __poll_t seccomp_notify_poll(struct file *file,
 
 	poll_wait(file, &filter->wqh, poll_tab);
 
-	if (mutex_lock_interruptible(&filter->notify_lock) < 0)
+	if (mutex_lock_interruptible(&filter->notify_lock))
 		return EPOLLERR;
 
 	list_for_each_entry(cur, &filter->notif->notifications, list) {
mm/kmemleak.c +2 -2
index c6ed68604136..9f81f4f30fca 100644
@@ -1916,7 +1916,7 @@ static void *kmemleak_seq_start(struct seq_file *seq, loff_t *pos)
 	int err;
 
 	err = mutex_lock_interruptible(&scan_mutex);
-	if (err < 0)
+	if (err)
 		return ERR_PTR(err);
 
 	rcu_read_lock();
@@ -2074,7 +2074,7 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf,
 	buf[buf_size] = 0;
 
 	ret = mutex_lock_interruptible(&scan_mutex);
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (strncmp(buf, "clear", 5) == 0) {
net/rxrpc/recvmsg.c +1 -1
index 32cd5f1d541d..bb385070a729 100644
@@ -368,7 +368,7 @@ int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 		if (flags & MSG_DONTWAIT)
 			goto error_requeue_call;
 		ret = -ERESTARTSYS;
-		if (mutex_lock_interruptible(&call->user_mutex) < 0)
+		if (mutex_lock_interruptible(&call->user_mutex))
 			goto error_requeue_call;
 	}
 
net/rxrpc/sendmsg.c +1 -1
index 0e8da909d4f2..216d9db6b9ac 100644
@@ -487,7 +487,7 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
 	if (ret < 0)
 		goto maybe_error;
 	if (call->interruptibility == RXRPC_INTERRUPTIBLE) {
-		if (mutex_lock_interruptible(&call->user_mutex) < 0) {
+		if (mutex_lock_interruptible(&call->user_mutex)) {
 			ret = sock_intr_errno(timeo);
 			goto maybe_error;
 		}
security/integrity/ima/ima_fs.c +1 -1
index e4a79a9b2d58..42e0b2716483 100644
@@ -370,7 +370,7 @@ static ssize_t ima_write_policy(struct file *file, const char __user *buf,
 	}
 
 	result = mutex_lock_interruptible(&ima_write_mutex);
-	if (result < 0)
+	if (result)
 		goto out_free;
 
 	if (data[0] == '/') {
sound/pci/oxygen/oxygen_lib.c +1 -1
index 92ffe9dc20c5..02c4c05d1492 100644
@@ -203,7 +203,7 @@ static void oxygen_proc_read(struct snd_info_entry *entry,
 			snd_iprintf(buffer, " %02x", oxygen_read8(chip, i + j));
 		snd_iprintf(buffer, "\n");
 	}
-	if (mutex_lock_interruptible(&chip->mutex) < 0)
+	if (mutex_lock_interruptible(&chip->mutex))
 		return;
 	if (chip->has_ac97_0) {
 		snd_iprintf(buffer, "\nAC97:\n");
author maintainer
#18 lore raw

RFC PATCH 11/33 PNP: isapnp: Check the isapnp_cfg_begin() return value

In reply to Bart Van Assche

Instead of ignoring isapnp_cfg_begin() failures, propagate the value returned by this function in case of a failure. This patch prepares for annotating mutex operations since isapnp_cfg_begin() only locks a particular mutex if it returns zero.

Cc Jaroslav Kysela <[email protected]>
Cc Adam Belay <[email protected]>
Fixes f72e5c5c861c ("[PATCH] PnP Rewrite V0.9 - 2.5.43")
---
 drivers/pnp/isapnp/core.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/pnp/isapnp/core.c +12 -4
index c43d8ad02529..261bf85b0200 100644
@@ -851,7 +851,9 @@ static int isapnp_get_resources(struct pnp_dev *dev)
 
 	pnp_dbg(&dev->dev, "get resources\n");
 	pnp_init_resources(dev);
-	isapnp_cfg_begin(dev->card->number, dev->number);
+	ret = isapnp_cfg_begin(dev->card->number, dev->number);
+	if (ret)
+		return ret;
 	dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE);
 	if (!dev->active)
 		goto __end;
@@ -885,10 +887,12 @@ static int isapnp_get_resources(struct pnp_dev *dev)
 static int isapnp_set_resources(struct pnp_dev *dev)
 {
 	struct resource *res;
-	int tmp;
+	int tmp, ret;
 
 	pnp_dbg(&dev->dev, "set resources\n");
-	isapnp_cfg_begin(dev->card->number, dev->number);
+	ret = isapnp_cfg_begin(dev->card->number, dev->number);
+	if (ret)
+		return ret;
 	dev->active = 1;
 	for (tmp = 0; tmp < ISAPNP_MAX_PORT; tmp++) {
 		res = pnp_get_resource(dev, IORESOURCE_IO, tmp);
@@ -934,9 +938,13 @@ static int isapnp_set_resources(struct pnp_dev *dev)
 
 static int isapnp_disable_resources(struct pnp_dev *dev)
 {
+	int ret;
+
 	if (!dev->active)
 		return -EINVAL;
-	isapnp_cfg_begin(dev->card->number, dev->number);
+	ret = isapnp_cfg_begin(dev->card->number, dev->number);
+	if (ret)
+		return ret;
 	isapnp_deactivate(dev->number);
 	dev->active = 0;
 	isapnp_cfg_end();
author maintainer
#19 lore raw

RFC PATCH 12/33 scsi: mpi3mr: Fix locking in an error path

In reply to Bart Van Assche

Make all error paths unlock rioc->bsg_cmds.mutex.

This bug has been detected by the Clang thread-safety analyzer.

Cc Martin K. Petersen <[email protected]>
Cc Sathya Prakash <[email protected]>
Fixes fb231d7deffb ("scsi: mpi3mr: Support for preallocation of SGL BSG data buffers part-2")
---
 drivers/scsi/mpi3mr/mpi3mr_app.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/mpi3mr/mpi3mr_app.c +1 -0
index 7589f48aebc8..f4b5813e6fc4 100644
@@ -2339,6 +2339,7 @@ static long mpi3mr_bsg_process_mpt_cmds(struct bsg_job *job)
 	}
 
 	if (!mrioc->ioctl_sges_allocated) {
+		mutex_unlock(&mrioc->bsg_cmds.mutex);
 		dprint_bsg_err(mrioc, "%s: DMA memory was not allocated\n",
 			       __func__);
 		return -ENOMEM;
author maintainer
#20 lore raw

RFC PATCH 13/33 scsi: mpt3sas: Fix a locking bug in an error path

In reply to Bart Van Assche

Call mutex_unlock(&ioc->hostdiag_unlock_mutex) once from error paths instead of twice.

This bug has been detected by the Clang thread-safety analyzer.

Cc Martin K. Petersen <[email protected]>
Cc Ranjan Kumar <[email protected]>
Fixes c0767560b012 ("scsi: mpt3sas: Reload SBR without rebooting HBA")
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +7 -5
index dc43cfa83088..212e3b86bb81 100644
@@ -8018,7 +8018,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc)
 
 	mutex_lock(&ioc->hostdiag_unlock_mutex);
 	if (mpt3sas_base_unlock_and_get_host_diagnostic(ioc, &host_diagnostic))
-		goto out;
+		goto unlock;
 
 	hcb_size = ioc->base_readl(&ioc->chip->HCBSize);
 	drsprintk(ioc, ioc_info(ioc, "diag reset: issued\n"));
@@ -8038,7 +8038,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc)
 			ioc_info(ioc,
 			    "Invalid host diagnostic register value\n");
 			_base_dump_reg_set(ioc);
-			goto out;
+			goto unlock;
 		}
 		if (!(host_diagnostic & MPI2_DIAG_RESET_ADAPTER))
 			break;
@@ -8074,17 +8074,19 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc)
 		ioc_err(ioc, "%s: failed going to ready state (ioc_state=0x%x)\n",
 			__func__, ioc_state);
 		_base_dump_reg_set(ioc);
-		goto out;
+		goto fail;
 	}
 
 	pci_cfg_access_unlock(ioc->pdev);
 	ioc_info(ioc, "diag reset: SUCCESS\n");
 	return 0;
 
- out:
+unlock:
+	mutex_unlock(&ioc->hostdiag_unlock_mutex);
+
+fail:
 	pci_cfg_access_unlock(ioc->pdev);
 	ioc_err(ioc, "diag reset: FAILED\n");
-	mutex_unlock(&ioc->hostdiag_unlock_mutex);
 	return -EFAULT;
 }
 
author maintainer
#21 lore raw

RFC PATCH 14/33 ice: Split ice_dcb_rebuild()

In reply to Bart Van Assche

Prepare for adding a second caller. No functionality has been changed.

Cc Tony Nguyen <[email protected]>
Cc Przemek Kitszel <[email protected]>
---
 drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 46 +++++++++++---------
 1 file changed, 25 insertions(+), 21 deletions(-)
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +25 -21
index a7c510832824..69a4b84f935f 100644
@@ -526,6 +526,30 @@ ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,
 	return need_reconfig;
 }
 
+static void disable_dcb(struct ice_pf *pf)
+{
+	struct ice_dcbx_cfg *err_cfg;
+	struct device *dev = ice_pf_to_dev(pf);
+
+	dev_err(dev, "Disabling DCB until new settings occur\n");
+	err_cfg = kzalloc(sizeof(*err_cfg), GFP_KERNEL);
+	if (!err_cfg)
+		return;
+
+	err_cfg->etscfg.willing = true;
+	err_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW;
+	err_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;
+	memcpy(&err_cfg->etsrec, &err_cfg->etscfg, sizeof(err_cfg->etsrec));
+	/* Coverity warns the return code of ice_pf_dcb_cfg() is not checked
+	 * here as is done for other calls to that function. That check is
+	 * not necessary since this is in this function's error cleanup path.
+	 * Suppress the Coverity warning with the following comment...
+	 */
+	/* coverity[check_return] */
+	ice_pf_dcb_cfg(pf, err_cfg, false);
+	kfree(err_cfg);
+}
+
 /**
  * ice_dcb_rebuild - rebuild DCB post reset
  * @pf: physical function instance
@@ -534,7 +558,6 @@ void ice_dcb_rebuild(struct ice_pf *pf)
 {
 	struct ice_aqc_port_ets_elem buf = { 0 };
 	struct device *dev = ice_pf_to_dev(pf);
-	struct ice_dcbx_cfg *err_cfg;
 	int ret;
 
 	ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
@@ -574,26 +597,7 @@ void ice_dcb_rebuild(struct ice_pf *pf)
 	return;
 
 dcb_error:
-	dev_err(dev, "Disabling DCB until new settings occur\n");
-	err_cfg = kzalloc(sizeof(*err_cfg), GFP_KERNEL);
-	if (!err_cfg) {
-		mutex_unlock(&pf->tc_mutex);
-		return;
-	}
-
-	err_cfg->etscfg.willing = true;
-	err_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW;
-	err_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;
-	memcpy(&err_cfg->etsrec, &err_cfg->etscfg, sizeof(err_cfg->etsrec));
-	/* Coverity warns the return code of ice_pf_dcb_cfg() is not checked
-	 * here as is done for other calls to that function. That check is
-	 * not necessary since this is in this function's error cleanup path.
-	 * Suppress the Coverity warning with the following comment...
-	 */
-	/* coverity[check_return] */
-	ice_pf_dcb_cfg(pf, err_cfg, false);
-	kfree(err_cfg);
-
+	disable_dcb(pf);
 	mutex_unlock(&pf->tc_mutex);
 }
 
maintainer
#22 lore raw

Re: [PATCH RFC 14/33] ice: Split ice_dcb_rebuild()

Quoted 5 lines · Bart Van Assche

Prepare for adding a second caller. No functionality has been changed.

Cc Tony Nguyen <[email protected]>
Cc Przemek Kitszel <[email protected]>

Thank you for fixes for our driver!
Just minor issues from me below.

drivers/net/ethernet/intel/ice/ice_dcb_lib.c ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg, · line 529

Quoted 13 lines
---
  drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 46 +++++++++++---------
  1 file changed, 25 insertions(+), 21 deletions(-)
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +1 -0
index a7c510832824..69a4b84f935f 100644
@@ -526,6 +526,30 @@ ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,
  	return need_reconfig;
  }
 
+static void disable_dcb(struct ice_pf *pf)

you have to prefix it with ice_

drivers/net/ethernet/intel/ice/ice_dcb_lib.c ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg, · line 532

Quoted 3 lines
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +3 -0
+{
+	struct ice_dcbx_cfg *err_cfg;
+	struct device *dev = ice_pf_to_dev(pf);

Networking code mandates to sort declaration lines by their length, longest to shortest. We call that "reverse xmass tree rule".

drivers/net/ethernet/intel/ice/ice_dcb_lib.c ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg, · line 534

Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +2 -0
+
+	dev_err(dev, "Disabling DCB until new settings occur\n");

even for copy-pasted code, it hurts to have this as error here

Quoted 4 lines
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +4 -0
+	err_cfg = kzalloc(sizeof(*err_cfg), GFP_KERNEL);
+	if (!err_cfg)
+		return;
+

drivers/net/ethernet/intel/ice/ice_dcb_lib.c ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg, · line 548

Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +10 -0
+	err_cfg->etscfg.willing = true;
+	err_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW;
+	err_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;
+	memcpy(&err_cfg->etsrec, &err_cfg->etscfg, sizeof(err_cfg->etsrec));
+	/* Coverity warns the return code of ice_pf_dcb_cfg() is not checked
+	 * here as is done for other calls to that function. That check is
+	 * not necessary since this is in this function's error cleanup path.
+	 * Suppress the Coverity warning with the following comment...
+	 */
+	/* coverity[check_return] */

the comment was silly in the first place, but makes even less sense when extracted to helper function

Quoted 43 lines
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +5 -21
+	ice_pf_dcb_cfg(pf, err_cfg, false);
+	kfree(err_cfg);
+}
+
  /**
   * ice_dcb_rebuild - rebuild DCB post reset
   * @pf: physical function instance
@@ -534,7 +558,6 @@ void ice_dcb_rebuild(struct ice_pf *pf)
  {
  	struct ice_aqc_port_ets_elem buf = { 0 };
  	struct device *dev = ice_pf_to_dev(pf);
-	struct ice_dcbx_cfg *err_cfg;
  	int ret;
 
  	ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
@@ -574,26 +597,7 @@ void ice_dcb_rebuild(struct ice_pf *pf)
  	return;
 
  dcb_error:
-	dev_err(dev, "Disabling DCB until new settings occur\n");
-	err_cfg = kzalloc(sizeof(*err_cfg), GFP_KERNEL);
-	if (!err_cfg) {
-		mutex_unlock(&pf->tc_mutex);
-		return;
-	}
-
-	err_cfg->etscfg.willing = true;
-	err_cfg->etscfg.tcbwtable[0] = ICE_TC_MAX_BW;
-	err_cfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;
-	memcpy(&err_cfg->etsrec, &err_cfg->etscfg, sizeof(err_cfg->etsrec));
-	/* Coverity warns the return code of ice_pf_dcb_cfg() is not checked
-	 * here as is done for other calls to that function. That check is
-	 * not necessary since this is in this function's error cleanup path.
-	 * Suppress the Coverity warning with the following comment...
-	 */
-	/* coverity[check_return] */
-	ice_pf_dcb_cfg(pf, err_cfg, false);
-	kfree(err_cfg);
-
+	disable_dcb(pf);
  	mutex_unlock(&pf->tc_mutex);
  }
 
author maintainer
#23 lore raw

RFC PATCH 15/33 ice: Fix a locking bug in an error path

In reply to Bart Van Assche

Do not unlock pf->tc_mutex if it has not been locked. Jumping to 'dcb_error' causes pf->tc_mutex to be unlocked. This bug has been detected by the Clang thread-safety analyzer.

Cc Tony Nguyen <[email protected]>
Cc Przemek Kitszel <[email protected]>
Fixes 242b5e068b25 ("ice: Fix DCB rebuild after reset")
---
 drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +2 -1
index 69a4b84f935f..65545613e1e8 100644
@@ -563,7 +563,8 @@ void ice_dcb_rebuild(struct ice_pf *pf)
 	ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
 	if (ret) {
 		dev_err(dev, "Query Port ETS failed\n");
-		goto dcb_error;
+		disable_dcb(pf);
+		return;
 	}
 
 	mutex_lock(&pf->tc_mutex);
maintainer
#24 lore raw

Re: [PATCH RFC 15/33] ice: Fix a locking bug in an error path

Quoted 3 lines · Bart Van Assche

Do not unlock pf->tc_mutex if it has not been locked. Jumping to 'dcb_error' causes pf->tc_mutex to be unlocked. This bug has been detected by the Clang thread-safety analyzer.

Thanks for catching this Bart. I think it would be better to move the tc_mutex up to cover this call. Though unlikely, the DCB settings could change after this call so it would be better to protect this under the mutex. Also, as the error path is changing configuration, that should be done under this mutex as well.

Thanks,
Tony

Quoted 22 lines
Cc Tony Nguyen <[email protected]>
Cc Przemek Kitszel <[email protected]>
Fixes 242b5e068b25 ("ice: Fix DCB rebuild after reset")
---
  drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_dcb_lib.c +2 -1
index 69a4b84f935f..65545613e1e8 100644
@@ -563,7 +563,8 @@ void ice_dcb_rebuild(struct ice_pf *pf)
  	ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
  	if (ret) {
  		dev_err(dev, "Query Port ETS failed\n");
-		goto dcb_error;
+		disable_dcb(pf);
+		return;
  	}
 
  	mutex_lock(&pf->tc_mutex);
author maintainer
#25 lore raw

Re: [PATCH RFC 15/33] ice: Fix a locking bug in an error path

Quoted 6 lines · Tony Nguyen
Quoted 3 lines · Bart Van Assche

Do not unlock pf->tc_mutex if it has not been locked. Jumping to 'dcb_error' causes pf->tc_mutex to be unlocked. This bug has been detected by the Clang thread-safety analyzer.

Thanks for catching this Bart. I think it would be better to move the tc_mutex up to cover this call. Though unlikely, the DCB settings could change after this call so it would be better to protect this under the mutex. Also, as the error path is changing configuration, that should be done under this mutex as well.

Thanks Tony for having taken a look. Is this perhaps the change that you want me to make?

Thanks,

Bart.

drivers/net/ethernet/intel/ice/ice_dcb_lib.c +2 -2
index a7c510832824..d185b1aba7a4 100644
@@ -537,14 +537,14 @@ void ice_dcb_rebuild(struct ice_pf *pf)
 	struct ice_dcbx_cfg *err_cfg;
 	int ret;
 
+	mutex_lock(&pf->tc_mutex);
+
 	ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
 	if (ret) {
 		dev_err(dev, "Query Port ETS failed\n");
 		goto dcb_error;
 	}
 
-	mutex_lock(&pf->tc_mutex);
-
 	if (!pf->hw.port_info->qos_cfg.is_sw_lldp)
 		ice_cfg_etsrec_defaults(pf->hw.port_info);
 
maintainer
#26 lore raw

Re: [PATCH RFC 15/33] ice: Fix a locking bug in an error path

Quoted 10 lines · Bart Van Assche
Quoted 6 lines · Tony Nguyen
Quoted 3 lines · Bart Van Assche

Do not unlock pf->tc_mutex if it has not been locked. Jumping to 'dcb_error' causes pf->tc_mutex to be unlocked. This bug has been detected by the Clang thread-safety analyzer.

Thanks for catching this Bart. I think it would be better to move the tc_mutex up to cover this call. Though unlikely, the DCB settings could change after this call so it would be better to protect this under the mutex. Also, as the error path is changing configuration, that should be done under this mutex as well.

Thanks Tony for having taken a look. Is this perhaps the change that you want me to make?

Yes, looks good to me.

Thanks,
Tony

Quoted 26 lines

Thanks,

Bart.

drivers/net/ethernet/intel/ice/ice_dcb_lib.c +2 -2
index a7c510832824..d185b1aba7a4 100644
@@ -537,14 +537,14 @@ void ice_dcb_rebuild(struct ice_pf *pf)
      struct ice_dcbx_cfg *err_cfg;
      int ret;
 
+    mutex_lock(&pf->tc_mutex);
+
      ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
      if (ret) {
          dev_err(dev, "Query Port ETS failed\n");
          goto dcb_error;
      }
 
-    mutex_lock(&pf->tc_mutex);
-
      if (!pf->hw.port_info->qos_cfg.is_sw_lldp)
          ice_cfg_etsrec_defaults(pf->hw.port_info);
 
author maintainer
#27 lore raw

RFC PATCH 16/33 net/mlx5e: Make the code easier to analyze

In reply to Bart Van Assche

Make it possible for clang to perform its compile-time thread-safety analysis by making the arguments of mutex_lock() and mutex_unlock() derived from function arguments instead of local variables. Additionally, move initializers of variables that are not changed into the declaration block.

Cc Dragos Tatulea <[email protected]>
Cc Cosmin Ratiu <[email protected]>
Cc Lior Nahmanson <[email protected]>
Cc Tariq Toukan <[email protected]>
Cc Jakub Kicinski <[email protected]>
---
 .../mellanox/mlx5/core/en_accel/macsec.c      | 62 +++++++------------
 1 file changed, 24 insertions(+), 38 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +24 -38
index 6ab02f3fc291..97d8fcde3648 100644
@@ -510,12 +510,11 @@ static int mlx5e_macsec_add_txsa(struct macsec_context *ctx)
 	struct mlx5_core_dev *mdev = priv->mdev;
 	u8 assoc_num = ctx->sa.assoc_num;
 	struct mlx5e_macsec_sa *tx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
+	mutex_lock(&macsec->lock);
 
-	macsec = priv->macsec;
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -581,13 +580,12 @@ static int mlx5e_macsec_upd_txsa(struct macsec_context *ctx)
 	struct mlx5e_macsec_device *macsec_device;
 	u8 assoc_num = ctx->sa.assoc_num;
 	struct mlx5e_macsec_sa *tx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	struct net_device *netdev;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
+	mutex_lock(&macsec->lock);
 
-	macsec = priv->macsec;
 	netdev = ctx->netdev;
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
@@ -641,11 +639,10 @@ static int mlx5e_macsec_del_txsa(struct macsec_context *ctx)
 	struct mlx5e_macsec_device *macsec_device;
 	u8 assoc_num = ctx->sa.assoc_num;
 	struct mlx5e_macsec_sa *tx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -679,11 +676,10 @@ static int mlx5e_macsec_add_rxsc(struct macsec_context *ctx)
 	struct mlx5e_macsec_device *macsec_device;
 	struct mlx5e_macsec_rx_sc *rx_sc;
 	struct list_head *rx_sc_list;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -759,14 +755,12 @@ static int mlx5e_macsec_upd_rxsc(struct macsec_context *ctx)
 	struct mlx5e_macsec_device *macsec_device;
 	struct mlx5e_macsec_rx_sc *rx_sc;
 	struct mlx5e_macsec_sa *rx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	struct list_head *list;
 	int i;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
-
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -838,13 +832,11 @@ static int mlx5e_macsec_del_rxsc(struct macsec_context *ctx)
 	struct mlx5e_priv *priv = macsec_netdev_priv(ctx->netdev);
 	struct mlx5e_macsec_device *macsec_device;
 	struct mlx5e_macsec_rx_sc *rx_sc;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	struct list_head *list;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
-
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -879,13 +871,11 @@ static int mlx5e_macsec_add_rxsa(struct macsec_context *ctx)
 	struct mlx5e_macsec_rx_sc *rx_sc;
 	sci_t sci = ctx_rx_sa->sc->sci;
 	struct mlx5e_macsec_sa *rx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	struct list_head *list;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
-
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -963,13 +953,11 @@ static int mlx5e_macsec_upd_rxsa(struct macsec_context *ctx)
 	struct mlx5e_macsec_rx_sc *rx_sc;
 	sci_t sci = ctx_rx_sa->sc->sci;
 	struct mlx5e_macsec_sa *rx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	struct list_head *list;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
-
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -1020,13 +1008,11 @@ static int mlx5e_macsec_del_rxsa(struct macsec_context *ctx)
 	struct mlx5e_macsec_rx_sc *rx_sc;
 	u8 assoc_num = ctx->sa.assoc_num;
 	struct mlx5e_macsec_sa *rx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	struct list_head *list;
 	int err = 0;
 
-	mutex_lock(&priv->macsec->lock);
-
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -1078,8 +1064,9 @@ static int mlx5e_macsec_add_secy(struct macsec_context *ctx)
 	if (!mlx5e_macsec_secy_features_validate(ctx))
 		return -EINVAL;
 
-	mutex_lock(&priv->macsec->lock);
 	macsec = priv->macsec;
+
+	mutex_lock(&macsec->lock);
 	if (mlx5e_macsec_get_macsec_device_context(macsec, ctx)) {
 		netdev_err(netdev, "MACsec offload: MACsec net_device already exist\n");
 		goto out;
@@ -1180,9 +1167,9 @@ static int mlx5e_macsec_upd_secy(struct macsec_context *ctx)
 	if (!mlx5e_macsec_secy_features_validate(ctx))
 		return -EINVAL;
 
-	mutex_lock(&priv->macsec->lock);
-
 	macsec = priv->macsec;
+
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
@@ -1229,13 +1216,12 @@ static int mlx5e_macsec_del_secy(struct macsec_context *ctx)
 	struct mlx5e_macsec_device *macsec_device;
 	struct mlx5e_macsec_rx_sc *rx_sc, *tmp;
 	struct mlx5e_macsec_sa *tx_sa;
-	struct mlx5e_macsec *macsec;
+	struct mlx5e_macsec *macsec = priv->macsec;
 	struct list_head *list;
 	int err = 0;
 	int i;
 
-	mutex_lock(&priv->macsec->lock);
-	macsec = priv->macsec;
+	mutex_lock(&macsec->lock);
 	macsec_device = mlx5e_macsec_get_macsec_device_context(macsec, ctx);
 	if (!macsec_device) {
 		netdev_err(ctx->netdev, "MACsec offload: Failed to find device context\n");
author maintainer
#28 lore raw

RFC PATCH 17/33 Input: synaptics-rmi4 - fix a locking bug in an error path

In reply to Bart Van Assche

Lock f54->data_mutex before the first 'goto error' statement since jumping to the 'error' label causes that mutex to be unlocked.

Cc Dmitry Torokhov <[email protected]>
Cc Nick Dyer <[email protected]>
Fixes 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support for F54 diagnostics")
---
 drivers/input/rmi4/rmi_f54.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/input/rmi4/rmi_f54.c +3 -2
index 5c3da910b5b2..f7387527e8b3 100644
@@ -541,6 +541,9 @@ static void rmi_f54_work(struct work_struct *work)
 	int i;
 
 	report_size = rmi_f54_get_report_size(f54);
+
+	mutex_lock(&f54->data_mutex);
+
 	if (report_size == 0) {
 		dev_err(&fn->dev, "Bad report size, report type=%d\n",
 				f54->report_type);
@@ -548,8 +551,6 @@ static void rmi_f54_work(struct work_struct *work)
 		goto error;     /* retry won't help */
 	}
 
-	mutex_lock(&f54->data_mutex);
-
 	/*
 	 * Need to check if command has completed.
 	 * If not try again later.
author maintainer
#29 lore raw

RFC PATCH 18/33 misc: nsm: Fix a locking bug in an error path

In reply to Bart Van Assche

If nsm->lock has not been locked, do not unlock it from any error path. This bug has been detected by the Clang thread-safety analyzer.

Cc Krzysztof Kozlowski <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
---
 drivers/misc/nsm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/nsm.c +1 -1
index ef7b32742340..185900cdad4a 100644
@@ -367,7 +367,7 @@ static long nsm_dev_ioctl(struct file *file, unsigned int cmd,
 	/* Copy user argument struct to kernel argument struct */
 	r = -EFAULT;
 	if (copy_from_user(&raw, argp, _IOC_SIZE(cmd)))
-		goto out;
+		return r;
 
 	mutex_lock(&nsm->lock);
 
author maintainer
#30 lore raw

RFC PATCH 19/33 drm/amdgpu: Unlock a mutex before destroying it

In reply to Bart Van Assche

Mutexes must be unlocked before these are destroyed. This has been detected by the Clang thread-safety analyzer.

Cc Yang Wang <[email protected]>
Cc Hawking Zhang <[email protected]>
Cc Alex Deucher <[email protected]>
Fixes f5e4cc8461c4 ("drm/amdgpu: implement RAS ACA driver framework")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c +1 -0
index 9d6345146495..069b004f941e 100644
@@ -572,6 +572,7 @@ static void aca_error_fini(struct aca_error *aerr)
 		aca_bank_error_remove(aerr, bank_error);
 
 out_unlock:
+	mutex_unlock(&aerr->lock);
 	mutex_destroy(&aerr->lock);
 }
 
author maintainer
#31 lore raw

RFC PATCH 20/33 drm/amdgpu: Fix a locking bug in an error path

In reply to Bart Van Assche

Do not unlock con->recovery_lock if it has not been locked.

This bug has been detected by the Clang thread-safety checker.

Cc Tao Zhou <[email protected]>
Cc Hawking Zhang <[email protected]>
Cc Alex Deucher <[email protected]>
Fixes a8d133e625ce ("drm/amdgpu: parse legacy RAS bad page mixed with new data in various NPS modes")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +2 -3
index f0924aa3f4e4..740889b71a73 100644
@@ -2820,8 +2820,7 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
 				sizeof(struct eeprom_table_record), GFP_KERNEL);
 		if (!err_data.err_addr) {
 			dev_warn(adev->dev, "Failed to alloc UMC error address record in mca2pa conversion!\n");
-			ret = -ENOMEM;
-			goto out;
+			return -ENOMEM;
 		}
 
 		err_rec = err_data.err_addr;
@@ -2927,7 +2926,7 @@ int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
 free:
 	if (from_rom)
 		kfree(err_data.err_addr);
-out:
+
 	mutex_unlock(&con->recovery_lock);
 
 	return ret;
author maintainer
#32 lore raw

RFC PATCH 21/33 drm/amdgpu: Fix locking bugs in error paths

In reply to Bart Van Assche

Do not unlock psp->ras_context.mutex if it has not been locked. This has been detected by the Clang thread-safety analyzer.

Cc YiPeng Chai <[email protected]>
Cc Hawking Zhang <[email protected]>
Cc Alex Deucher <[email protected]>
Fixes b3fb79cda568 ("drm/amdgpu: add mutex to protect ras shared memory")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c +8 -6
index 38face981c3e..6b0135ce83b4 100644
@@ -332,7 +332,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
 		return -ENOMEM;
 	if (copy_from_user((void *)shared_buf, &buf[copy_pos], shared_buf_len)) {
 		ret = -EFAULT;
-		goto err_free_shared_buf;
+		goto free_shared_buf;
 	}
 
 	set_ta_context_funcs(psp, ta_type, &context);
@@ -340,13 +340,13 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
 	if (!context || !context->initialized) {
 		dev_err(adev->dev, "TA is not initialized\n");
 		ret = -EINVAL;
-		goto err_free_shared_buf;
+		goto free_shared_buf;
 	}
 
 	if (!psp->ta_funcs || !psp->ta_funcs->fn_ta_invoke) {
 		dev_err(adev->dev, "Unsupported function to invoke TA\n");
 		ret = -EOPNOTSUPP;
-		goto err_free_shared_buf;
+		goto free_shared_buf;
 	}
 
 	context->session_id = ta_id;
@@ -354,7 +354,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
 	mutex_lock(&psp->ras_context.mutex);
 	ret = prep_ta_mem_context(&context->mem_context, shared_buf, shared_buf_len);
 	if (ret)
-		goto err_free_shared_buf;
+		goto unlock;
 
 	ret = psp_fn_ta_invoke(psp, cmd_id);
 	if (ret || context->resp_status) {
@@ -362,15 +362,17 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
 			ret, context->resp_status);
 		if (!ret) {
 			ret = -EINVAL;
-			goto err_free_shared_buf;
+			goto unlock;
 		}
 	}
 
 	if (copy_to_user((char *)&buf[copy_pos], context->mem_context.shared_buf, shared_buf_len))
 		ret = -EFAULT;
 
-err_free_shared_buf:
+unlock:
 	mutex_unlock(&psp->ras_context.mutex);
+
+free_shared_buf:
 	kfree(shared_buf);
 
 	return ret;
author maintainer
#33 lore raw

RFC PATCH 22/33 drm: bridge: cdns-mhdp8546: Fix a locking bug in an error path

In reply to Bart Van Assche

Do not unlock mhdp->mbox_mutex if it has not been locked.

This bug has been detected by the Clang thread-safety analyzer.

Cc Swapnil Jakhade <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes fb43aa0acdfd ("drm: bridge: Add support for Cadence MHDP8546 DPI/DP bridge")
---
 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +1 -2
index d081850e3c03..9295b2a9f9be 100644
@@ -502,8 +502,7 @@ int cdns_mhdp_adjust_lt(struct cdns_mhdp_device *mhdp, unsigned int nlanes,
 
 	if (nlanes != 4 && nlanes != 2 && nlanes != 1) {
 		dev_err(mhdp->dev, "invalid number of lanes: %u\n", nlanes);
-		ret = -EINVAL;
-		goto out;
+		return -EINVAL;
 	}
 
 	payload[0] = nlanes;
author maintainer
#34 lore raw

RFC PATCH 23/33 drm: bridge: cdns-mhdp8546: Fix a locking bug in an error path

In reply to Bart Van Assche

Unlock mhdp->link_mutex before returning.

This bug has been detected by the Clang thread-safety analyzer.

Cc Aleksandr Mishin <[email protected]>
Cc Robert Foss <[email protected]>
Fixes 935a92a1c400 ("drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference")
---
 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +4 -2
index 9295b2a9f9be..51e2caa9c815 100644
@@ -2053,8 +2053,10 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge,
 	mhdp_state = to_cdns_mhdp_bridge_state(new_state);
 
 	mhdp_state->current_mode = drm_mode_duplicate(bridge->dev, mode);
-	if (!mhdp_state->current_mode)
-		return;
+	if (!mhdp_state->current_mode) {
+		ret = 0;
+		goto out;
+	}
 
 	drm_mode_set_name(mhdp_state->current_mode);
 
author maintainer
#35 lore raw

RFC PATCH 24/33 drm: zynqmp_dp: Fix a deadlock in zynqmp_dp_ignore_hpd_set()

In reply to Bart Van Assche

Instead of attempting the same mutex twice, lock and unlock it.

This bug has been detected by the Clang thread-safety analyzer.

Cc Sean Anderson <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes 28edaacb821c ("drm: zynqmp_dp: Add debugfs interface for compliance testing")
---
 drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +1 -1
index 979f6d3239ba..189a08cdc73c 100644
@@ -2295,7 +2295,7 @@ static int zynqmp_dp_ignore_hpd_set(void *data, u64 val)
 
 	mutex_lock(&dp->lock);
 	dp->ignore_hpd = val;
-	mutex_lock(&dp->lock);
+	mutex_unlock(&dp->lock);
 	return 0;
 }
 
Reviewed-by on v1 24/33
#36 lore raw

Re: [PATCH RFC 24/33] drm: zynqmp_dp: Fix a deadlock in zynqmp_dp_ignore_hpd_set()

Quoted 17 lines · Bart Van Assche

Instead of attempting the same mutex twice, lock and unlock it.

This bug has been detected by the Clang thread-safety analyzer.

Cc Sean Anderson <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes 28edaacb821c ("drm: zynqmp_dp: Add debugfs interface for compliance testing")
---
 drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/xlnx/zynqmp_dp.c +0 -0
index 979f6d3239ba..189a08cdc73c 100644

drivers/gpu/drm/xlnx/zynqmp_dp.c static int zynqmp_dp_ignore_hpd_set(void *data, u64 val) · line 2301

Quoted 8 lines
drivers/gpu/drm/xlnx/zynqmp_dp.c +1 -1
@@ -2295,7 +2295,7 @@ static int zynqmp_dp_ignore_hpd_set(void *data, u64 val)
 
 	mutex_lock(&dp->lock);
 	dp->ignore_hpd = val;
-	mutex_lock(&dp->lock);
+	mutex_unlock(&dp->lock);
 	return 0;
 }
 

Since this patch is marked RFC will it be applied soon? I am about to send a patch which conflicts with this one. I would like to just add this patch to my series.

--Sean

author maintainer
#37 lore raw

Re: [PATCH RFC 24/33] drm: zynqmp_dp: Fix a deadlock in zynqmp_dp_ignore_hpd_set()

Quoted 3 lines · Sean Anderson

Since this patch is marked RFC will it be applied soon? I am about to send a patch which conflicts with this one. I would like to just add this patch to my series.

Hi Sean,

Thanks for having taken a look. Please include this patch in your patch series if you want it to be merged in the upstream kernel soon.

Bart.

author maintainer
#38 lore raw

RFC PATCH 25/33 wifi: ath12k: Fix locking in error paths

In reply to Bart Van Assche

If ag->mutex has been locked, unlock it before returning. If it has not been locked, do not unlock it before returning. These bugs have been detected by the Clang thread-safety analyzer.

Cc Karthikeyan Periyasamy <[email protected]>
Cc Jeff Johnson <[email protected]>
Fixes ee146e11b4d9 ("wifi: ath12k: refactor core start based on hardware group")
---
 drivers/net/wireless/ath/ath12k/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/core.c +3 -1
index 0606116d6b9c..212cd935e60a 100644
@@ -1122,16 +1122,18 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
 		ath12k_core_stop(ab);
 		mutex_unlock(&ab->core_lock);
 	}
+	mutex_unlock(&ag->mutex);
 	goto exit;
 
 err_dp_free:
 	ath12k_dp_free(ab);
 	mutex_unlock(&ab->core_lock);
+	mutex_unlock(&ag->mutex);
+
 err_firmware_stop:
 	ath12k_qmi_firmware_stop(ab);
 
 exit:
-	mutex_unlock(&ag->mutex);
 	return ret;
 }
 
#39 lore raw

Re: [PATCH RFC 25/33] wifi: ath12k: Fix locking in error paths

Quoted 26 lines · Bart Van Assche

If ag->mutex has been locked, unlock it before returning. If it has not been locked, do not unlock it before returning. These bugs have been detected by the Clang thread-safety analyzer.

Cc Karthikeyan Periyasamy <[email protected]>
Cc Jeff Johnson <[email protected]>
Fixes ee146e11b4d9 ("wifi: ath12k: refactor core start based on hardware group")
---
 drivers/net/wireless/ath/ath12k/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/core.c +1 -0
index 0606116d6b9c..212cd935e60a 100644
@@ -1122,16 +1122,18 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
 		ath12k_core_stop(ab);
 		mutex_unlock(&ab->core_lock);
 	}
+	mutex_unlock(&ag->mutex);
 	goto exit;
 
 err_dp_free:
 	ath12k_dp_free(ab);
 	mutex_unlock(&ab->core_lock);

drivers/net/wireless/ath/ath12k/core.c int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab) · line 1139

Quoted 10 lines
drivers/net/wireless/ath/ath12k/core.c +2 -1
+	mutex_unlock(&ag->mutex);
+
 err_firmware_stop:
 	ath12k_qmi_firmware_stop(ab);
 
 exit:
-	mutex_unlock(&ag->mutex);
 	return ret;
 }
 

This looks like a legitimate issue.

Can you submit this as a single patch and cc the ath12k and linux-wireless lists (as I've done in this reply)

author maintainer
#40 lore raw

Re: [PATCH RFC 25/33] wifi: ath12k: Fix locking in error paths

Quoted 2 lines · Jeff Johnson

Can you submit this as a single patch and cc the ath12k and linux-wireless lists (as I've done in this reply)

Done :-)

author maintainer
#41 lore raw

RFC PATCH 26/33 mctp i3c: Fix locking in error paths

In reply to Bart Van Assche

Only unlock mi->lock if it is locked. This bug has been detected by the Clang thread-safety analyzer.

Cc Leo Yang <[email protected]>
Cc Paolo Abeni <[email protected]>
Fixes 2d2d4f60ed26 ("mctp i3c: fix MCTP I3C driver multi-thread issue")
---
 drivers/net/mctp/mctp-i3c.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/mctp/mctp-i3c.c +4 -1
index d247fe483c58..360eb6490483 100644
@@ -112,7 +112,7 @@ static int mctp_i3c_read(struct mctp_i3c_device *mi)
 	if (!skb) {
 		stats->rx_dropped++;
 		rc = -ENOMEM;
-		goto err;
+		goto free_skb;
 	}
 
 	skb->protocol = htons(ETH_P_MCTP);
@@ -170,8 +170,11 @@ static int mctp_i3c_read(struct mctp_i3c_device *mi)
 
 	mutex_unlock(&mi->lock);
 	return 0;
+
 err:
 	mutex_unlock(&mi->lock);
+
+free_skb:
 	kfree_skb(skb);
 	return rc;
 }
author maintainer
#42 lore raw

RFC PATCH 27/33 iavf: Fix a locking bug in an error path

In reply to Bart Van Assche

If the netdev lock has been obtained, unlock it before returning. This bug has been detected by the Clang thread-safety analyzer.

Cc Jakub Kicinski <[email protected]>
Fixes afc664987ab3 ("eth: iavf: extend the netdev_lock usage")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -1
index 2d7a18fcc3be..852e5b62f0a5 100644
@@ -2903,8 +2903,8 @@ static void iavf_watchdog_task(struct work_struct *work)
 	}
 
 	mutex_unlock(&adapter->crit_lock);
-	netdev_unlock(netdev);
 restart_watchdog:
+	netdev_unlock(netdev);
 	if (adapter->state >= __IAVF_DOWN)
 		queue_work(adapter->wq, &adapter->adminq_task);
 	if (adapter->aq_required)
maintainer Applied
#43 lore raw

Re: [PATCH RFC 27/33] iavf: Fix a locking bug in an error path

Quoted 6 lines · On Thu, 6 Feb 2025 09:51:08 -0800 Bart Van Assche wrote:

If the netdev lock has been obtained, unlock it before returning. This bug has been detected by the Clang thread-safety analyzer.

Cc Jakub Kicinski <[email protected]>
Fixes afc664987ab3 ("eth: iavf: extend the netdev_lock usage")

Applied to net, thanks!

author maintainer
#44 lore raw

RFC PATCH 28/33 wifi: mt76: mt7925: Fix a locking bug in an error path

In reply to Bart Van Assche

Call mt792x_mutex_release() before returning.

This bug has been detected by the Clang thread-safety checker.

Cc Charles Han <[email protected]>
Cc Felix Fietkau <[email protected]>
Fixes 5cd0bd815c8a ("wifi: mt76: mt7925: fix NULL deref check in mt7925_change_vif_links")
---
 drivers/net/wireless/mediatek/mt76/mt7925/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7925/main.c +4 -2
index 98daf80ac131..40e898f24628 100644
@@ -1992,8 +1992,10 @@ mt7925_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 					     GFP_KERNEL);
 			mlink = devm_kzalloc(dev->mt76.dev, sizeof(*mlink),
 					     GFP_KERNEL);
-			if (!mconf || !mlink)
-				return -ENOMEM;
+			if (!mconf || !mlink) {
+				err = -ENOMEM;
+				goto free;
+			}
 		}
 
 		mconfs[link_id] = mconf;
author maintainer
#45 lore raw

RFC PATCH 29/33 hwmon: (it87) Check the it87_lock() return value

In reply to Bart Van Assche

Return early in it87_resume() if it87_lock() fails instead of ignoring the return value of that function. This patch suppresses a Clang thread-safety warning.

Cc Frank Crawford <[email protected]>
Cc Guenter Roeck <[email protected]>
Fixes 376e1a937b30 ("hwmon: (it87) Add calls to smbus_enable/smbus_disable as required")
---
 drivers/hwmon/it87.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hwmon/it87.c +3 -1
index e233aafa8856..8e3935089fca 100644
@@ -3593,7 +3593,9 @@ static int it87_resume(struct device *dev)
 
 	it87_resume_sio(pdev);
 
-	it87_lock(data);
+	int err = it87_lock(data);
+	if (err)
+		return err;
 
 	it87_check_pwm(dev);
 	it87_check_limit_regs(data);
maintainer
#46 lore raw

Re: [PATCH RFC 29/33] hwmon: (it87) Check the it87_lock() return value

Quoted 17 lines · Bart Van Assche

Return early in it87_resume() if it87_lock() fails instead of ignoring the return value of that function. This patch suppresses a Clang thread-safety warning.

Cc Frank Crawford <[email protected]>
Cc Guenter Roeck <[email protected]>
Fixes 376e1a937b30 ("hwmon: (it87) Add calls to smbus_enable/smbus_disable as required")
---
  drivers/hwmon/it87.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hwmon/it87.c +0 -0
index e233aafa8856..8e3935089fca 100644

drivers/hwmon/it87.c static int it87_resume(struct device *dev) · line 3596

Quoted 5 lines
drivers/hwmon/it87.c +1 -1
@@ -3593,7 +3593,9 @@ static int it87_resume(struct device *dev)
 
  	it87_resume_sio(pdev);
 
-	it87_lock(data);
+	int err = it87_lock(data);

I am not going to accept patches with inline variable declarations if the patch is fixing an earlier problem, sorry. This only results in unnecessary backport failures.

Guenter

author maintainer
#47 lore raw

Re: [PATCH RFC 29/33] hwmon: (it87) Check the it87_lock() return value

Quoted 13 lines · Guenter Roeck

drivers/hwmon/it87.c static int it87_resume(struct device *dev) · line 3594

Quoted 8 lines · Bart Van Assche
drivers/hwmon/it87.c +1 -1
index e233aafa8856..8e3935089fca 100644
@@ -3593,7 +3593,9 @@ static int it87_resume(struct device *dev)
       it87_resume_sio(pdev);
-    it87_lock(data);
+    int err = it87_lock(data);

I am not going to accept patches with inline variable declarations if the patch is fixing an earlier problem, sorry. This only results in unnecessary backport failures.

Hi Guenter,

Is this perhaps how you want me to format this patch?

drivers/hwmon/it87.c +4 -1
index e233aafa8856..5cfb98a0512f 100644
@@ -3590,10 +3590,13 @@ static int it87_resume(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct it87_data *data = dev_get_drvdata(dev);
+       int err;
 
        it87_resume_sio(pdev);
 
-       it87_lock(data);
+       err = it87_lock(data);
+       if (err)
+               return err;
 
        it87_check_pwm(dev);
        it87_check_limit_regs(data);

Thanks,

Bart.

maintainer
#48 lore raw

Re: [PATCH RFC 29/33] hwmon: (it87) Check the it87_lock() return value

Quoted 15 lines · Bart Van Assche
Quoted 13 lines · Guenter Roeck

drivers/hwmon/it87.c static int it87_resume(struct device *dev) · line 3594

Quoted 8 lines · Bart Van Assche
drivers/hwmon/it87.c +1 -1
index e233aafa8856..8e3935089fca 100644
@@ -3593,7 +3593,9 @@ static int it87_resume(struct device *dev)
       it87_resume_sio(pdev);
-    it87_lock(data);
+    int err = it87_lock(data);

I am not going to accept patches with inline variable declarations if the patch is fixing an earlier problem, sorry. This only results in unnecessary backport failures.

Quoted 4 lines

Hi Guenter,

Is this perhaps how you want me to format this patch?

Yes, that would be ok.

Guenter

Quoted 23 lines
drivers/hwmon/it87.c +4 -1
index e233aafa8856..5cfb98a0512f 100644
@@ -3590,10 +3590,13 @@ static int it87_resume(struct device *dev)
  {
         struct platform_device *pdev = to_platform_device(dev);
         struct it87_data *data = dev_get_drvdata(dev);
+       int err;
 
         it87_resume_sio(pdev);
 
-       it87_lock(data);
+       err = it87_lock(data);
+       if (err)
+               return err;
 
         it87_check_pwm(dev);
         it87_check_limit_regs(data);

Thanks,

Bart.

#49 lore raw

Re: [PATCH RFC 29/33] hwmon: (it87) Check the it87_lock() return value

Bart,

Quoted 40 lines · Guenter Roeck
Quoted 18 lines · Bart Van Assche
Quoted 16 lines · Guenter Roeck

drivers/hwmon/it87.c static int it87_resume(struct device · line 3595

Quoted 9 lines · Bart Van Assche
drivers/hwmon/it87.c +1 -1
index e233aafa8856..8e3935089fca 100644
@@ -3593,7 +3593,9 @@ static int it87_resume(struct device
 *dev)
       it87_resume_sio(pdev);
-    it87_lock(data);
+    int err = it87_lock(data);

I am not going to accept patches with inline variable declarations
if the patch is fixing an earlier problem, sorry. This only results
in unnecessary backport failures.

Quoted 4 lines

Hi Guenter,

Is this perhaps how you want me to format this patch?

Yes, that would be ok.

Guenter

Quoted 12 lines
drivers/hwmon/it87.c +1 -0
index e233aafa8856..5cfb98a0512f 100644
@@ -3590,10 +3590,13 @@ static int it87_resume(struct device *dev)
   {
          struct platform_device *pdev = to_platform_device(dev);
          struct it87_data *data = dev_get_drvdata(dev);
+       int err;
 
          it87_resume_sio(pdev);
 
Quoted 8 lines

drivers/hwmon/it87.c static int it87_resume(struct device *dev) · line 3602

Quoted 8 lines
drivers/hwmon/it87.c +3 -1
-       it87_lock(data);
+       err = it87_lock(data);
+       if (err)
+               return err;
 
          it87_check_pwm(dev);
          it87_check_limit_regs(data);

Thanks for that (and to Guenter to get it correctly formatted).

I will check it doesn't cause any other problems, but given the location, I think it should be all fine.

Quoted 4 lines
Quoted 3 lines

Thanks,

Bart.

Regards
Frank

#50 lore raw

Re: [PATCH RFC 29/33] hwmon: (it87) Check the it87_lock() return value

In reply to Guenter Roeck
Quoted 6 lines · Guenter Roeck

drivers/hwmon/it87.c static int it87_resume(struct device *dev) · line 3596

Quoted 2 lines
  -	it87_lock(data);
drivers/hwmon/it87.c +1 -0
+	int err = it87_lock(data);

I am not going to accept patches with inline variable declarations if the patch is fixing an earlier problem, sorry. This only results in unnecessary backport failures.

In fact the inline variable declarations should never be used in "normal" code by Linux coding standards. The only reason the warning is disabled is for some of the magic scoping macros.

author maintainer
#51 lore raw

RFC PATCH 30/33 drivers/net/ethernet/marvell/octeontx2/nic: Fix locking in an error path

In reply to Bart Van Assche

Only unlock pf->mbox.lock if it has been locked by otx2_do_set_vf_vlan(). This bug has been detected by the Clang thread-safety analyzer.

Cc Naveen Mamindlapalli <[email protected]>
Cc Jakub Kicinski <[email protected]>
Fixes f0c2982aaf98 ("octeontx2-pf: Add support for SR-IOV management functions")
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 -1
index e1dde93e8af8..6cd599e12f69 100644
@@ -2517,7 +2517,7 @@ static int otx2_do_set_vf_vlan(struct otx2_nic *pf, int vf, u16 vlan, u8 qos,
 	config = &pf->vf_configs[vf];
 
 	if (!vlan && !config->vlan)
-		goto out;
+		return err;
 
 	mutex_lock(&pf->mbox.lock);
 
author maintainer
#52 lore raw

RFC PATCH 31/33 md/raid*: Fix raid*_set_queue_limits()

In reply to Bart Van Assche

queue_limits_cancel_update() must only be called if queue_limits_start_update() is called first. Remove the queue_limits_cancel_update() calls from the raid*_set_limits() functions because there is no corresponding queue_limits_start_update() call.

Cc Christoph Hellwig <[email protected]>
Fixes c6e56cf6b2e7 ("block: move integrity information into queue_limits")
---
 drivers/md/raid0.c  | 4 +---
 drivers/md/raid1.c  | 4 +---
 drivers/md/raid10.c | 4 +---
 3 files changed, 3 insertions(+), 9 deletions(-)
drivers/md/raid0.c +1 -3
index 8fc9339b00c7..70bcc3cdf2cd 100644
@@ -386,10 +386,8 @@ static int raid0_set_limits(struct mddev *mddev)
 	lim.io_opt = lim.io_min * mddev->raid_disks;
 	lim.features |= BLK_FEAT_ATOMIC_WRITES;
 	err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
-	if (err) {
-		queue_limits_cancel_update(mddev->gendisk->queue);
+	if (err)
 		return err;
-	}
 	return queue_limits_set(mddev->gendisk->queue, &lim);
 }
 
drivers/md/raid1.c +1 -3
index 9d57a88dbd26..10ea3af40991 100644
@@ -3219,10 +3219,8 @@ static int raid1_set_limits(struct mddev *mddev)
 	lim.max_write_zeroes_sectors = 0;
 	lim.features |= BLK_FEAT_ATOMIC_WRITES;
 	err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
-	if (err) {
-		queue_limits_cancel_update(mddev->gendisk->queue);
+	if (err)
 		return err;
-	}
 	return queue_limits_set(mddev->gendisk->queue, &lim);
 }
 
drivers/md/raid10.c +1 -3
index efe93b979167..15b9ae5bf84d 100644
@@ -4020,10 +4020,8 @@ static int raid10_set_queue_limits(struct mddev *mddev)
 	lim.io_opt = lim.io_min * raid10_nr_stripes(conf);
 	lim.features |= BLK_FEAT_ATOMIC_WRITES;
 	err = mddev_stack_rdev_limits(mddev, &lim, MDDEV_STACK_INTEGRITY);
-	if (err) {
-		queue_limits_cancel_update(mddev->gendisk->queue);
+	if (err)
 		return err;
-	}
 	return queue_limits_set(mddev->gendisk->queue, &lim);
 }
 
author maintainer
#53 lore raw

RFC PATCH 32/33 treewide: Annotate all struct mutex users

In reply to Bart Van Assche

Annotate functions with one of the following attributes as appropriate:
* ACQUIRE() if a mutex is acquired by a function.
* RELEASE() if a mutex is unlocked by a function.
* REQUIRES() if a mutex is unlocked and locked by a function.
* NO_THREAD_SAFETY_ANALYSIS if the locking pattern is too complex for the Clang thread-safety analyzer.

Expand local variables in mutex lock/unlock calls where necessary since the Clang thread-safety checker does not support alias analysis.

---
 arch/arm64/kvm/arm.c                          |  2 ++
 arch/powerpc/kernel/rtas.c                    |  1 +
 arch/powerpc/platforms/powermac/low_i2c.c     |  6 ++++
 arch/powerpc/platforms/pseries/papr-vpd.c     |  2 ++
 arch/x86/events/core.c                        |  1 +
 arch/x86/kernel/cpu/resctrl/pseudo_lock.c     |  1 +
 arch/x86/kernel/cpu/resctrl/rdtgroup.c        |  2 ++
 arch/x86/kernel/cpu/sgx/encl.c                |  2 ++
 arch/x86/kernel/ftrace.c                      |  2 ++
 arch/x86/kernel/module.c                      |  1 +
 arch/x86/kvm/svm/sev.c                        |  6 ++++
 block/bdev.c                                  |  3 ++
 block/blk-cgroup.c                            |  2 ++
 block/ioctl.c                                 |  1 +
 drivers/accel/amdxdna/aie2_error.c            |  5 +--
 drivers/accel/qaic/qaic_control.c             |  1 +
 drivers/acpi/scan.c                           |  5 +++
 drivers/ata/libata-core.c                     | 31 +++++++++++++++++--
 drivers/ata/libata-eh.c                       |  2 ++
 drivers/ata/libata.h                          |  6 ++--
 drivers/base/bus.c                            |  1 +
 drivers/base/core.c                           |  7 +++++
 drivers/base/dd.c                             |  2 ++
 drivers/base/power/clock_ops.c                |  4 +++
 drivers/base/power/main.c                     |  2 ++
 drivers/base/regmap/regmap-irq.c              |  2 ++
 drivers/base/regmap/regmap.c                  |  2 ++
 drivers/block/drbd/drbd_bitmap.c              |  2 ++
 drivers/block/drbd/drbd_main.c                |  7 +++++
 drivers/block/drbd/drbd_nl.c                  |  1 +
 drivers/block/drbd/drbd_receiver.c            |  1 +
 drivers/block/drbd/drbd_state.c               |  4 +++
 drivers/block/loop.c                          |  2 ++
 drivers/block/nbd.c                           |  3 ++
 drivers/block/null_blk/zoned.c                |  2 ++
 drivers/block/rnbd/rnbd-clt.c                 |  2 ++
 drivers/bus/fsl-mc/mc-sys.c                   |  1 +
 drivers/bus/vexpress-config.c                 |  2 ++
 drivers/cdx/cdx_msi.c                         |  2 ++
 drivers/char/ipmi/ipmi_msghandler.c           |  1 +
 drivers/char/misc.c                           |  2 ++
 drivers/char/powernv-op-panel.c               |  2 ++
 drivers/char/tpm/tpm-chip.c                   |  3 ++
 drivers/char/xillybus/xillybus_core.c         |  1 +
 drivers/clk/clk.c                             |  4 +++
 drivers/comedi/comedi_fops.c                  |  2 ++
 drivers/comedi/drivers.c                      |  1 +
 drivers/comedi/drivers/usbduxsigma.c          |  1 +
 drivers/counter/rz-mtu3-cnt.c                 |  3 ++
 drivers/cpuidle/cpuidle.c                     |  2 ++
 drivers/crypto/exynos-rng.c                   |  1 +
 drivers/crypto/hisilicon/qm.c                 |  4 +++
 drivers/crypto/intel/qat/qat_common/adf_cfg.c |  2 ++
 .../qat/qat_common/adf_transport_debug.c      |  4 +++
 drivers/cxl/core/port.c                       |  2 ++
 drivers/devfreq/devfreq.c                     |  1 +
 drivers/dpll/dpll_netlink.c                   |  6 ++++
 drivers/firmware/arm_ffa/driver.c             |  1 +
 drivers/firmware/arm_scmi/notify.c            |  1 +
 .../firmware/arm_scmi/transports/mailbox.c    |  2 ++
 drivers/firmware/arm_scmi/transports/optee.c  |  2 ++
 .../firmware/qcom/qcom_qseecom_uefisecapp.c   |  2 ++
 drivers/fpga/fpga-bridge.c                    |  2 ++
 drivers/fpga/fpga-region.c                    |  3 ++
 drivers/gpio/gpio-adnp.c                      |  2 ++
 drivers/gpio/gpio-crystalcove.c               |  2 ++
 drivers/gpio/gpio-dln2.c                      |  2 ++
 drivers/gpio/gpio-ljca.c                      |  2 ++
 drivers/gpio/gpio-max77620.c                  |  2 ++
 drivers/gpio/gpio-mlxbf2.c                    |  2 ++
 drivers/gpio/gpio-pca953x.c                   |  2 ++
 drivers/gpio/gpio-pcf857x.c                   |  2 ++
 drivers/gpio/gpio-pmic-eic-sprd.c             |  2 ++
 drivers/gpio/gpio-stmpe.c                     |  2 ++
 drivers/gpio/gpio-tc3589x.c                   |  2 ++
 drivers/gpio/gpio-virtio.c                    |  2 ++
 drivers/gpio/gpio-wcove.c                     |  2 ++
 drivers/gpu/drm/amd/amdgpu/aldebaran.c        |  1 +
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c    |  4 +++
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c  |  4 +++
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c    |  4 +++
 .../drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c    |  4 +++
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c |  4 +++
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c |  4 +++
 .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c |  8 +++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c        |  3 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c    |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c       |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c       |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c       |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h       |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c       |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c     |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h  |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c        |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h        |  3 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c     |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c       |  1 +
 drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c        |  3 +-
 drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c    |  2 ++
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c         |  4 ++-
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c      |  4 +++
 .../drm/amd/amdkfd/kfd_device_queue_manager.c |  5 +++
 .../drm/amd/amdkfd/kfd_device_queue_manager.h |  2 ++
 drivers/gpu/drm/amd/amdkfd/kfd_svm.h          |  2 ++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 ++
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    |  1 +
 drivers/gpu/drm/ast/ast_ddc.c                 |  2 ++
 drivers/gpu/drm/bridge/lontium-lt9611uxc.c    |  2 ++
 drivers/gpu/drm/clients/drm_log.c             |  2 ++
 drivers/gpu/drm/display/drm_dp_helper.c       |  3 ++
 drivers/gpu/drm/display/drm_dp_mst_topology.c |  2 ++
 drivers/gpu/drm/drm_atomic_helper.c           |  3 ++
 drivers/gpu/drm/drm_auth.c                    |  2 ++
 drivers/gpu/drm/drm_client_modeset.c          |  1 +
 drivers/gpu/drm/drm_color_mgmt.c              |  1 +
 drivers/gpu/drm/drm_crtc.c                    |  1 +
 drivers/gpu/drm/drm_drv.c                     |  1 +
 drivers/gpu/drm/drm_fb_helper.c               |  1 +
 drivers/gpu/drm/drm_file.c                    |  4 +++
 drivers/gpu/drm/drm_gem.c                     |  4 ++-
 drivers/gpu/drm/drm_mode_object.c             |  2 ++
 drivers/gpu/drm/drm_modeset_lock.c            |  2 ++
 drivers/gpu/drm/drm_plane.c                   |  1 +
 drivers/gpu/drm/drm_prime.c                   |  1 +
 drivers/gpu/drm/i915/display/intel_cdclk.c    |  1 +
 .../drm/i915/display/intel_display_reset.c    |  2 ++
 drivers/gpu/drm/i915/display/intel_gmbus.c    |  3 ++
 drivers/gpu/drm/i915/display/intel_pps.c      |  2 ++
 drivers/gpu/drm/i915/display/intel_psr.c      |  3 ++
 drivers/gpu/drm/i915/display/intel_tc.c       |  4 +++
 drivers/gpu/drm/i915/gem/i915_gem_context.h   |  2 ++
 .../gpu/drm/i915/gem/i915_gem_execbuffer.c    |  1 +
 drivers/gpu/drm/i915/gt/intel_context.h       |  4 +++
 drivers/gpu/drm/i915/gt/selftest_context.c    |  1 +
 drivers/gpu/drm/i915/gt/selftest_timeline.c   |  1 +
 drivers/gpu/drm/i915/gvt/vgpu.c               |  1 +
 drivers/gpu/drm/i915/i915_request.c           |  1 +
 drivers/gpu/drm/i915/i915_vma.c               |  3 +-
 drivers/gpu/drm/i915/intel_sbi.c              |  2 ++
 drivers/gpu/drm/i915/intel_wakeref.c          |  2 ++
 drivers/gpu/drm/i915/intel_wakeref.h          |  2 ++
 drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c      |  1 +
 drivers/gpu/drm/i915/vlv_sideband.c           |  2 ++
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c     |  1 +
 drivers/gpu/drm/mgag200/mgag200_ddc.c         |  2 ++
 drivers/gpu/drm/msm/msm_atomic.c              |  2 ++
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |  2 ++
 drivers/gpu/drm/nouveau/nouveau_abi16.c       |  2 ++
 drivers/gpu/drm/nouveau/nouveau_uvmm.h        |  2 ++
 drivers/gpu/drm/nouveau/nvkm/core/subdev.c    |  1 +
 .../gpu/drm/nouveau/nvkm/engine/fifo/chan.c   |  3 +-
 .../gpu/drm/nouveau/nvkm/engine/fifo/uchan.c  |  1 +
 drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c    |  3 ++
 .../gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c   |  2 ++
 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c |  2 ++
 drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c |  2 ++
 .../drm/nouveau/nvkm/subdev/instmem/nv50.c    | 24 +++++++-------
 drivers/gpu/drm/panthor/panthor_mmu.c         |  1 +
 drivers/gpu/drm/qxl/qxl_cmd.c                 |  1 +
 drivers/gpu/drm/qxl/qxl_display.c             |  2 ++
 drivers/gpu/drm/radeon/radeon_i2c.c           |  2 ++
 drivers/gpu/drm/radeon/radeon_ring.c          |  3 ++
 drivers/gpu/drm/rockchip/cdn-dp-core.c        |  1 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c  |  2 ++
 drivers/gpu/drm/tegra/hdmi.c                  |  2 ++
 drivers/gpu/drm/ttm/tests/ttm_bo_test.c       |  1 +
 drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c           |  7 ++++-
 drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c        |  5 +++
 drivers/gpu/drm/vmwgfx/vmwgfx_validation.c    |  3 ++
 drivers/gpu/drm/xe/xe_migrate.c               |  1 +
 drivers/gpu/drm/xe/xe_pcode.c                 |  1 +
 drivers/gpu/host1x/bus.c                      |  2 ++
 drivers/gpu/host1x/cdma.c                     |  6 ++++
 drivers/gpu/host1x/context.c                  |  1 +
 drivers/gpu/host1x/mipi.c                     |  2 ++
 drivers/hid/hid-wiimote.h                     |  3 ++
 drivers/hv/channel.c                          |  2 ++
 drivers/hwmon/abituguru.c                     |  2 ++
 drivers/hwmon/abituguru3.c                    |  2 ++
 drivers/hwmon/it87.c                          |  2 ++
 drivers/hwmon/lm78.c                          |  1 +
 drivers/hwmon/nct7904.c                       |  2 ++
 drivers/hwmon/pmbus/pmbus_core.c              |  1 +
 drivers/hwmon/w83781d.c                       |  1 +
 drivers/hwtracing/intel_th/msu.c              |  1 +
 drivers/hwtracing/stm/policy.c                |  2 ++
 drivers/i2c/busses/i2c-amd-mp2-pci.c          |  2 ++
 drivers/i2c/busses/i2c-xiic.c                 |  1 +
 drivers/i2c/i2c-atr.c                         |  3 ++
 drivers/iio/accel/kionix-kx022a.c             |  3 ++
 drivers/iio/adc/meson_saradc.c                |  2 ++
 drivers/iio/buffer/industrialio-buffer-dma.c  |  2 ++
 drivers/iio/industrialio-core.c               |  4 +++
 drivers/iio/light/opt3001.c                   |  1 +
 drivers/infiniband/core/cma.c                 |  5 +++
 drivers/infiniband/core/security.c            |  1 +
 drivers/infiniband/core/umem_odp.c            |  1 +
 drivers/infiniband/hw/hns/hns_roce_hem.c      |  2 ++
 drivers/infiniband/hw/mlx4/main.c             |  2 ++
 drivers/infiniband/hw/mlx5/mr.c               |  1 +
 drivers/infiniband/hw/mlx5/odp.c              |  1 +
 drivers/infiniband/hw/mlx5/umr.c              |  2 ++
 drivers/input/input.c                         |  3 ++
 drivers/input/joystick/pxrc.c                 |  2 ++
 drivers/input/keyboard/adp5588-keys.c         |  2 ++
 drivers/input/misc/ati_remote2.c              |  2 ++
 drivers/input/misc/cm109.c                    |  2 ++
 drivers/input/mouse/psmouse-base.c            |  1 +
 drivers/input/mouse/synaptics_usb.c           |  2 ++
 drivers/input/serio/i8042.c                   |  2 ++
 drivers/input/serio/libps2.c                  |  2 ++
 drivers/iommu/iommufd/device.c                |  2 ++
 drivers/iommu/iommufd/hw_pagetable.c          |  1 +
 drivers/md/bcache/alloc.c                     |  2 ++
 drivers/md/bcache/btree.c                     |  1 +
 drivers/md/bcache/super.c                     |  2 ++
 drivers/md/dm-bufio.c                         |  2 ++
 drivers/md/dm-crypt.c                         |  1 +
 drivers/md/dm-vdo/indexer/index-session.c     |  1 +
 drivers/md/dm-vdo/indexer/volume-index.c      |  3 ++
 drivers/md/dm-vdo/indexer/volume.c            |  1 +
 drivers/md/dm-writecache.c                    |  6 ++++
 drivers/md/dm-zoned-metadata.c                |  6 ++++
 drivers/md/dm.c                               |  5 +++
 drivers/md/md-cluster.c                       | 12 +++++--
 drivers/md/md.c                               |  8 +++++
 drivers/md/md.h                               |  9 +++++-
 drivers/media/cec/core/cec-adap.c             |  5 +++
 .../media/common/videobuf2/videobuf2-core.c   |  2 ++
 .../media/common/videobuf2/videobuf2-v4l2.c   |  7 +++++
 drivers/media/dvb-core/dvb_frontend.c         |  1 +
 drivers/media/dvb-core/dvb_vb2.c              |  2 ++
 drivers/media/dvb-frontends/dib9000.c         |  1 +
 drivers/media/dvb-frontends/stv090x.c         |  2 ++
 drivers/media/dvb-frontends/stv0910.c         |  1 +
 drivers/media/dvb-frontends/ts2020.c          |  2 ++
 drivers/media/mc/mc-device.c                  |  1 +
 drivers/media/mc/mc-entity.c                  |  1 +
 drivers/media/pci/cx18/cx18-alsa.h            |  2 ++
 drivers/media/pci/ddbridge/ddbridge-core.c    |  1 +
 drivers/media/pci/ivtv/ivtv-alsa.h            |  2 ++
 drivers/media/pci/ivtv/ivtv-fileops.c         |  2 ++
 drivers/media/pci/ivtv/ivtv-ioctl.c           |  3 ++
 drivers/media/pci/ivtv/ivtv-yuv.c             |  3 ++
 drivers/media/platform/amphion/vpu_v4l2.c     |  3 ++
 .../platform/chips-media/coda/coda-jpeg.c     |  1 +
 .../mediatek/vcodec/decoder/mtk_vcodec_dec.c  |  2 ++
 .../vcodec/decoder/mtk_vcodec_dec_pm.c        |  2 ++
 .../mediatek/vcodec/encoder/mtk_vcodec_enc.c  |  2 ++
 .../media/platform/nvidia/tegra-vde/h264.c    |  5 +++
 drivers/media/platform/nvidia/tegra-vde/vde.c |  2 ++
 .../platform/samsung/exynos4-is/media-dev.h   |  2 ++
 .../media/platform/samsung/s5p-mfc/s5p_mfc.c  |  2 ++
 drivers/media/platform/st/sti/hva/hva-hw.c    |  1 +
 drivers/media/platform/ti/omap3isp/ispvideo.c |  2 ++
 .../test-drivers/vivid/vivid-kthread-cap.c    |  1 +
 drivers/media/usb/dvb-usb-v2/mxl111sf.c       |  2 ++
 drivers/media/usb/dvb-usb/cxusb-analog.c      |  1 +
 drivers/media/usb/dvb-usb/cxusb.c             |  1 +
 drivers/media/usb/go7007/go7007-i2c.c         |  3 ++
 drivers/media/usb/gspca/finepix.c             |  1 +
 drivers/media/usb/gspca/jl2005bcd.c           |  1 +
 drivers/media/usb/gspca/sn9c20x.c             |  1 +
 drivers/media/usb/gspca/sonixj.c              |  1 +
 drivers/media/usb/gspca/sq905.c               |  2 ++
 drivers/media/usb/gspca/sq905c.c              |  1 +
 drivers/media/usb/gspca/vicam.c               |  1 +
 drivers/media/usb/gspca/zc3xx.c               |  1 +
 drivers/media/usb/hdpvr/hdpvr-video.c         |  1 +
 drivers/media/usb/pvrusb2/pvrusb2-context.c   |  2 ++
 drivers/media/usb/uvc/uvc_ctrl.c              |  1 +
 drivers/media/v4l2-core/v4l2-event.c          |  1 +
 drivers/media/v4l2-core/v4l2-ioctl.c          |  1 +
 drivers/media/v4l2-core/v4l2-mem2mem.c        |  1 +
 drivers/media/v4l2-core/v4l2-subdev.c         |  1 +
 drivers/message/fusion/mptctl.c               | 11 +++++--
 drivers/mfd/88pm860x-core.c                   |  2 ++
 drivers/mfd/atc260x-core.c                    |  2 ++
 drivers/mfd/kempld-core.c                     |  2 ++
 drivers/mfd/lp8788-irq.c                      |  2 ++
 drivers/mfd/max8925-core.c                    |  2 ++
 drivers/mfd/max8997-irq.c                     |  2 ++
 drivers/mfd/max8998-irq.c                     |  2 ++
 drivers/mfd/mc13xxx-core.c                    |  2 ++
 drivers/mfd/mt6358-irq.c                      |  2 ++
 drivers/mfd/mt6397-irq.c                      |  2 ++
 drivers/mfd/rc5t583-irq.c                     |  2 ++
 drivers/mfd/stmfx.c                           |  2 ++
 drivers/mfd/stmpe.c                           |  2 ++
 drivers/mfd/tps65217.c                        |  2 ++
 drivers/mfd/tps6586x.c                        |  2 ++
 drivers/mfd/twl4030-irq.c                     |  2 ++
 drivers/mfd/wm831x-irq.c                      |  2 ++
 drivers/mfd/wm8350-irq.c                      |  2 ++
 drivers/misc/cardreader/rtsx_usb.c            |  2 ++
 drivers/misc/mei/client.c                     |  7 +++++
 drivers/misc/mei/hbm.c                        |  1 +
 drivers/misc/mei/hw-me.c                      |  9 ++++++
 drivers/misc/mei/hw-txe.c                     |  4 +++
 drivers/misc/mei/main.c                       |  1 +
 drivers/misc/ntsync.c                         |  2 ++
 drivers/misc/sgi-gru/grufault.c               |  3 ++
 drivers/misc/sgi-gru/grumain.c                |  1 +
 drivers/misc/vmw_vmci/vmci_queue_pair.c       |  2 ++
 drivers/mmc/host/vub300.c                     |  2 ++
 drivers/mtd/chips/cfi_cmdset_0001.c           |  4 +++
 drivers/mtd/chips/cfi_cmdset_0002.c           |  6 ++++
 drivers/mtd/lpddr/lpddr_cmds.c                |  4 +++
 drivers/mtd/nand/ecc-mtk.c                    |  2 ++
 drivers/mtd/nand/ecc-mxic.c                   |  2 ++
 drivers/mtd/nand/raw/atmel/pmecc.c            |  2 ++
 drivers/mtd/nand/raw/nand_base.c              |  4 +++
 drivers/mtd/spi-nor/controllers/hisi-sfc.c    |  2 ++
 drivers/mtd/spi-nor/core.c                    |  6 ++++
 drivers/net/can/softing/softing_main.c        |  1 +
 drivers/net/dsa/microchip/ksz_common.c        |  2 ++
 drivers/net/dsa/microchip/ksz_common.h        |  2 ++
 drivers/net/dsa/microchip/ksz_ptp.c           |  2 ++
 drivers/net/dsa/mt7530-mdio.c                 |  2 ++
 drivers/net/dsa/mt7530.c                      |  2 ++
 drivers/net/dsa/mv88e6xxx/chip.c              |  3 ++
 drivers/net/dsa/mv88e6xxx/chip.h              |  2 ++
 drivers/net/dsa/mv88e6xxx/global2.c           |  2 ++
 drivers/net/dsa/mv88e6xxx/pcs-6352.c          |  2 ++
 drivers/net/dsa/mv88e6xxx/phy.c               |  2 ++
 drivers/net/dsa/qca/ar9331.c                  |  2 ++
 drivers/net/dsa/realtek/rtl83xx.c             |  2 ++
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c   |  2 ++
 .../net/ethernet/broadcom/bnx2x/bnx2x_cmn.c   |  2 ++
 .../net/ethernet/broadcom/bnx2x/bnx2x_sriov.c |  2 ++
 .../net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c  |  2 ++
 .../net/ethernet/broadcom/bnxt/bnxt_hwrm.c    |  2 ++
 drivers/net/ethernet/broadcom/tg3.c           |  1 +
 drivers/net/ethernet/davicom/dm9000.c         |  1 +
 drivers/net/ethernet/davicom/dm9051.c         |  2 ++
 drivers/net/ethernet/emulex/benet/be_cmds.c   |  2 ++
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  |  2 ++
 drivers/net/ethernet/hisilicon/hns3/hnae3.c   |  2 ++
 .../hisilicon/hns3/hns3pf/hclge_main.c        |  1 +
 drivers/net/ethernet/intel/e1000e/82571.c     |  3 ++
 drivers/net/ethernet/intel/e1000e/ich8lan.c   |  2 ++
 drivers/net/ethernet/intel/iavf/iavf_main.c   |  1 +
 drivers/net/ethernet/intel/ice/ice_common.c   |  1 +
 drivers/net/ethernet/intel/ice/ice_ddp.c      |  2 ++
 drivers/net/ethernet/intel/ice/ice_ethtool.c  |  1 +
 drivers/net/ethernet/intel/ice/ice_main.c     |  1 +
 drivers/net/ethernet/intel/ice/ice_vf_lib.c   |  1 +
 drivers/net/ethernet/intel/idpf/idpf.h        |  2 ++
 .../ethernet/marvell/octeontx2/af/rvu_nix.c   |  3 ++
 .../marvell/octeontx2/af/rvu_npc_fs.c         |  1 +
 .../net/ethernet/marvell/octeontx2/nic/rep.c  |  1 +
 .../marvell/prestera/prestera_counter.c       |  4 +++
 .../ethernet/marvell/prestera/prestera_pci.c  |  2 ++
 drivers/net/ethernet/mellanox/mlx4/cmd.c      |  2 ++
 drivers/net/ethernet/mellanox/mlx4/port.c     |  5 +++
 .../ethernet/mellanox/mlx5/core/en/mod_hdr.c  |  1 +
 .../mellanox/mlx5/core/en/reporter_rx.c       |  2 ++
 .../mellanox/mlx5/core/en/tc/ct_fs_hmfs.c     |  1 +
 .../mellanox/mlx5/core/en/tc/ct_fs_smfs.c     |  1 +
 .../mellanox/mlx5/core/en/tc/int_port.c       |  1 +
 .../mellanox/mlx5/core/en/tc_tun_encap.c      |  3 ++
 .../net/ethernet/mellanox/mlx5/core/en_tc.c   |  1 +
 .../net/ethernet/mellanox/mlx5/core/esw/qos.c |  2 ++
 .../net/ethernet/mellanox/mlx5/core/main.c    |  2 ++
 .../mellanox/mlx5/core/steering/hws/bwc.c     |  2 ++
 .../mlx5/core/steering/sws/dr_types.h         |  6 ++++
 drivers/net/ethernet/micrel/ks8851_spi.c      |  2 ++
 .../ethernet/microchip/encx24j600-regmap.c    |  2 ++
 .../net/ethernet/microchip/vcap/vcap_api.c    |  4 +++
 .../netronome/nfp/nfpcore/nfp_cppcore.c       |  2 ++
 drivers/net/ethernet/qlogic/qed/qed_ll2.c     |  1 +
 drivers/net/ethernet/qlogic/qed/qed_vf.c      |  4 ++-
 drivers/net/ethernet/qlogic/qede/qede_main.c  |  7 +++++
 drivers/net/ethernet/sfc/ef10_sriov.c         |  1 +
 drivers/net/ethernet/sfc/efx_common.c         |  5 +++
 drivers/net/ethernet/sfc/falcon/efx.c         |  2 ++
 drivers/net/ethernet/sfc/mcdi_filters.c       |  1 +
 drivers/net/ethernet/sfc/siena/efx_common.c   |  3 ++
 drivers/net/ethernet/xilinx/xilinx_axienet.h  |  2 ++
 drivers/net/macsec.c                          |  1 +
 drivers/net/mctp/mctp-i3c.c                   |  2 ++
 drivers/net/phy/dp83640.c                     |  2 ++
 drivers/net/phy/phy-core.c                    |  3 ++
 drivers/net/phy/phy_device.c                  |  1 +
 drivers/net/phy/sfp-bus.c                     |  1 +
 drivers/net/pse-pd/pse_core.c                 |  2 +-
 drivers/net/team/team_core.c                  |  2 ++
 drivers/net/tun.c                             |  1 +
 drivers/net/usb/hso.c                         |  2 ++
 drivers/net/usb/lan78xx.c                     |  2 ++
 drivers/net/wireless/ath/ath6kl/sdio.c        |  1 +
 drivers/net/wireless/ath/ath9k/hif_usb.c      |  1 +
 drivers/net/wireless/ath/wil6210/main.c       |  1 +
 drivers/net/wireless/ath/wil6210/p2p.c        |  2 ++
 drivers/net/wireless/broadcom/b43/main.c      |  1 +
 .../net/wireless/broadcom/b43legacy/main.c    |  1 +
 .../broadcom/brcm80211/brcmfmac/fwvid.c       |  2 ++
 drivers/net/wireless/intel/iwlwifi/dvm/lib.c  |  1 +
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c   |  3 ++
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c  |  3 ++
 .../wireless/intel/iwlwifi/mvm/time-event.c   |  2 ++
 drivers/net/wireless/intersil/p54/p54pci.c    |  1 +
 drivers/net/wireless/intersil/p54/p54usb.c    |  1 +
 drivers/net/wireless/marvell/mwl8k.c          |  2 ++
 .../wireless/mediatek/mt76/mt7615/testmode.c  |  1 +
 .../net/wireless/mediatek/mt76/mt76_connac.h  |  2 ++
 .../net/wireless/mediatek/mt76/mt7915/main.c  |  1 +
 .../wireless/mediatek/mt76/mt7915/testmode.c  |  5 +++
 .../net/wireless/microchip/wilc1000/wlan.c    |  2 ++
 drivers/net/wireless/quantenna/qtnfmac/bus.h  |  2 ++
 drivers/net/wireless/realtek/rtw88/main.c     |  1 +
 drivers/net/wireless/realtek/rtw89/core.c     |  1 +
 drivers/net/wireless/realtek/rtw89/mac80211.c |  2 ++
 drivers/net/wireless/realtek/rtw89/wow.c      |  4 +++
 drivers/net/wireless/realtek/rtw89/wow.h      |  2 +-
 drivers/net/wireless/rsi/rsi_91x_hal.c        |  1 +
 drivers/net/wireless/st/cw1200/pm.c           |  2 ++
 drivers/net/wireless/ti/wl12xx/main.c         |  1 +
 drivers/net/wireless/ti/wlcore/main.c         |  4 +++
 drivers/net/wireless/zydas/zd1211rw/zd_usb.c  |  2 ++
 drivers/nvdimm/bus.c                          |  1 +
 drivers/nvdimm/core.c                         |  2 ++
 drivers/nvdimm/namespace_devs.c               |  1 +
 drivers/nvme/host/core.c                      |  2 ++
 drivers/nvme/host/pci.c                       |  1 +
 drivers/nvmem/sc27xx-efuse.c                  |  2 ++
 drivers/nvmem/sprd-efuse.c                    |  2 ++
 drivers/of/dynamic.c                          |  4 +++
 drivers/of/overlay.c                          |  2 ++
 drivers/opp/core.c                            |  2 ++
 drivers/pci/pci.c                             | 10 ++++++
 drivers/pci/pcie/bwctrl.c                     |  1 +
 drivers/pci/probe.c                           |  2 ++
 drivers/pci/switch/switchtec.c                |  1 +
 drivers/pcmcia/rsrc_nonstatic.c               |  1 +
 drivers/perf/arm-cci.c                        |  1 +
 drivers/pinctrl/pinctrl-aw9523.c              |  2 ++
 drivers/pinctrl/pinctrl-cy8c95x0.c            |  2 ++
 drivers/pinctrl/pinctrl-mcp23s08.c            |  2 ++
 drivers/pinctrl/pinctrl-stmfx.c               |  2 ++
 drivers/pinctrl/pinctrl-sx150x.c              |  2 ++
 drivers/platform/chrome/cros_ec_lpc_mec.c     |  2 ++
 .../platform/cznic/turris-omnia-mcu-gpio.c    |  2 ++
 .../platform/x86/intel/crystal_cove_charger.c |  2 ++
 drivers/pmdomain/core.c                       |  4 +++
 drivers/pmdomain/rockchip/pm-domains.c        |  2 ++
 drivers/pnp/isapnp/core.c                     |  2 ++
 drivers/power/supply/da9150-fg.c              |  2 ++
 drivers/power/supply/power_supply_core.c      |  1 +
 drivers/pwm/core.c                            |  8 +++++
 drivers/regulator/core.c                      |  2 ++
 drivers/remoteproc/mtk_scp_ipi.c              |  2 ++
 drivers/scsi/aacraid/commctrl.c               |  1 +
 drivers/scsi/fnic/fnic_scsi.c                 |  1 +
 drivers/scsi/libfc/fc_disc.c                  |  6 +++-
 drivers/scsi/libiscsi.c                       |  1 +
 drivers/scsi/megaraid/megaraid_sas.h          |  3 +-
 drivers/scsi/megaraid/megaraid_sas_base.c     | 20 +++++++++---
 drivers/scsi/megaraid/megaraid_sas_fusion.c   |  2 ++
 drivers/scsi/scsi_transport_iscsi.c           |  1 +
 drivers/scsi/sg.c                             |  1 +
 drivers/scsi/smartpqi/smartpqi_init.c         | 18 +++++++++++
 drivers/siox/siox-core.c                      |  2 ++
 drivers/soc/qcom/qcom_pd_mapper.c             |  1 +
 drivers/soc/tegra/pmc.c                       |  1 +
 drivers/soundwire/stream.c                    |  3 ++
 drivers/spi/spi-mem.c                         |  2 ++
 drivers/spi/spi.c                             |  3 ++
 drivers/ssb/main.c                            |  2 ++
 drivers/staging/greybus/light.c               |  2 ++
 .../interface/vchiq_arm/vchiq_core.c          |  1 +
 drivers/target/iscsi/iscsi_target_tpg.c       |  1 +
 drivers/target/target_core_device.c           |  1 +
 drivers/tee/amdtee/core.c                     |  1 +
 drivers/thermal/mediatek/auxadc_thermal.c     |  2 ++
 drivers/thermal/tegra/soctherm.c              |  2 ++
 drivers/thermal/thermal_debugfs.c             |  4 +++
 drivers/tty/n_tty.c                           |  1 +
 drivers/tty/serial/sc16is7xx.c                |  2 ++
 drivers/tty/tty_buffer.c                      |  2 ++
 drivers/tty/tty_io.c                          |  2 ++
 drivers/tty/tty_mutex.c                       |  5 +++
 drivers/ufs/core/ufshcd.c                     |  4 +++
 drivers/usb/class/cdc-wdm.c                   |  3 ++
 drivers/usb/class/usblp.c                     |  3 +-
 drivers/usb/class/usbtmc.c                    |  3 ++
 drivers/usb/core/devio.c                      |  7 +++++
 drivers/usb/core/hcd-pci.c                    |  2 ++
 drivers/usb/core/hub.c                        |  7 +++++
 drivers/usb/gadget/configfs.c                 |  6 ++++
 drivers/usb/gadget/function/f_fs.c            | 14 ++++++---
 drivers/usb/gadget/function/u_fs.h            |  2 ++
 drivers/usb/gadget/legacy/inode.c             |  1 +
 drivers/usb/serial/mos7720.c                  |  2 ++
 drivers/usb/serial/usb-serial.c               |  3 ++
 drivers/usb/storage/transport.c               |  1 +
 drivers/usb/storage/usb.c                     |  2 ++
 drivers/usb/typec/tcpm/tcpm.c                 | 16 ++++++++++
 drivers/usb/usbip/stub_main.c                 |  1 +
 drivers/vdpa/vdpa_sim/vdpa_sim_blk.c          |  2 ++
 drivers/vfio/group.c                          |  1 +
 drivers/vfio/pci/mlx5/cmd.h                   |  3 +-
 drivers/vfio/pci/virtio/migrate.c             |  1 +
 drivers/vfio/vfio_iommu_type1.c               |  1 +
 drivers/vhost/vhost.c                         |  3 ++
 drivers/video/fbdev/core/fb_procfs.c          |  2 ++
 drivers/video/fbdev/smscufx.c                 |  1 +
 drivers/video/fbdev/udlfb.c                   |  1 +
 drivers/virt/vboxguest/vboxguest_linux.c      |  2 ++
 drivers/virtio/virtio_mem.c                   |  5 +++
 drivers/w1/slaves/w1_therm.c                  |  9 ++++++
 drivers/w1/w1.c                               |  3 ++
 drivers/w1/w1_netlink.c                       |  1 +
 drivers/xen/balloon.c                         |  2 ++
 drivers/xen/xen-pciback/passthrough.c         |  1 +
 drivers/xen/xen-pciback/vpci.c                |  1 +
 drivers/xen/xenbus/xenbus_comms.c             |  1 +
 drivers/xen/xenbus/xenbus_xs.c                |  4 +++
 fs/affs/affs.h                                |  6 ++++
 fs/afs/validation.c                           |  1 +
 fs/autofs/waitq.c                             |  3 ++
 fs/bcachefs/alloc_foreground.c                |  4 +++
 fs/bcachefs/alloc_foreground.h                |  1 +
 fs/bcachefs/btree_locking.c                   |  1 +
 fs/bcachefs/btree_write_buffer.c              |  4 +++
 fs/bcachefs/debug.c                           |  2 ++
 fs/bcachefs/ec.c                              |  3 ++
 fs/bcachefs/fs-ioctl.c                        |  1 +
 fs/bcachefs/fs.c                              |  4 +++
 fs/bcachefs/io_write.c                        |  3 ++
 fs/bcachefs/journal.c                         |  2 ++
 fs/bcachefs/quota.c                           |  2 ++
 fs/bcachefs/seqmutex.h                        |  4 +++
 fs/btrfs/block-group.c                        |  2 ++
 fs/btrfs/delayed-ref.c                        |  4 +++
 fs/btrfs/delayed-ref.h                        |  1 +
 fs/btrfs/extent-tree.c                        |  1 +
 fs/btrfs/free-space-cache.c                   |  1 +
 fs/btrfs/ioctl.c                              |  2 ++
 fs/btrfs/qgroup.c                             |  1 +
 fs/btrfs/scrub.c                              |  2 ++
 fs/btrfs/tests/delayed-refs-tests.c           |  1 +
 fs/btrfs/tree-log.c                           |  2 ++
 fs/btrfs/volumes.c                            |  4 +++
 fs/btrfs/zoned.h                              |  4 +++
 fs/ceph/caps.c                                |  4 +++
 fs/ceph/mds_client.c                          |  1 +
 fs/coda/upcall.c                              |  1 +
 fs/dcache.c                                   |  1 +
 fs/dlm/recoverd.c                             |  2 ++
 fs/ecryptfs/main.c                            |  1 +
 fs/ecryptfs/messaging.c                       |  1 +
 fs/erofs/zdata.c                              |  3 ++
 fs/eventpoll.c                                |  3 ++
 fs/exec.c                                     |  4 +++
 fs/ext4/fast_commit.c                         |  1 +
 fs/ext4/mballoc.c                             |  2 ++
 fs/f2fs/data.c                                |  1 +
 fs/fat/fatent.c                               |  2 ++
 fs/fat/inode.c                                |  2 ++
 fs/file.c                                     |  2 ++
 fs/fuse/inode.c                               |  2 ++
 fs/gfs2/rgrp.c                                |  2 ++
 fs/gfs2/util.c                                |  1 +
 fs/hfs/bfind.c                                |  2 ++
 fs/hfsplus/bfind.c                            |  2 ++
 fs/hfsplus/extents.c                          |  2 ++
 fs/hpfs/hpfs_fn.h                             |  2 ++
 fs/jbd2/checkpoint.c                          |  2 ++
 fs/jbd2/commit.c                              |  1 +
 fs/jbd2/journal.c                             |  5 +++
 fs/jbd2/transaction.c                         |  2 ++
 fs/jffs2/dir.c                                |  4 +++
 fs/jffs2/fs.c                                 |  1 +
 fs/jffs2/gc.c                                 |  1 +
 fs/jffs2/nodemgmt.c                           |  2 ++
 fs/jffs2/write.c                              |  2 ++
 fs/jfs/namei.c                                |  1 +
 fs/kernfs/file.c                              |  9 ++++++
 fs/lockd/host.c                               |  1 +
 fs/lockd/svclock.c                            |  1 +
 fs/namei.c                                    |  4 +++
 fs/netfs/write_issue.c                        |  2 ++
 fs/nfsd/nfs4layouts.c                         |  2 ++
 fs/nfsd/nfs4proc.c                            |  2 ++
 fs/nfsd/nfs4state.c                           | 11 +++++++
 fs/ntfs3/frecord.c                            |  4 ++-
 fs/ntfs3/inode.c                              |  1 +
 fs/ntfs3/namei.c                              |  2 ++
 fs/ntfs3/ntfs_fs.h                            |  4 +++
 fs/ntfs3/record.c                             |  1 +
 fs/ntfs3/xattr.c                              |  2 ++
 fs/ocfs2/cluster/nodemanager.c                |  2 ++
 fs/ocfs2/dlmglue.c                            |  2 ++
 fs/ocfs2/inode.c                              |  2 ++
 fs/ocfs2/refcounttree.c                       |  2 ++
 fs/orangefs/orangefs-debugfs.c                |  2 ++
 fs/orangefs/waitqueue.c                       |  1 +
 fs/overlayfs/overlayfs.h                      |  3 ++
 fs/pipe.c                                     |  2 ++
 fs/proc/proc_tty.c                            |  2 ++
 fs/pstore/zone.c                              |  1 +
 fs/smb/client/cifsglob.h                      |  2 ++
 fs/smb/client/connect.c                       |  3 +-
 fs/smb/client/fs_context.h                    |  2 ++
 fs/smb/client/smbdirect.c                     |  2 ++
 fs/smb/client/smbdirect.h                     |  2 +-
 fs/smb/server/connection.h                    |  6 ++--
 fs/super.c                                    |  6 ++++
 fs/ubifs/compress.c                           |  2 ++
 fs/ubifs/dir.c                                |  4 +++
 fs/ubifs/file.c                               |  6 ++++
 fs/ubifs/journal.c                            |  3 ++
 fs/ubifs/misc.h                               |  2 ++
 fs/xfs/scrub/dirtree.c                        |  2 ++
 fs/xfs/scrub/dirtree_repair.c                 |  3 ++
 fs/xfs/scrub/quota.c                          |  1 +
 fs/xfs/scrub/quota_repair.c                   |  3 ++
 fs/xfs/scrub/quotacheck_repair.c              |  3 ++
 fs/xfs/scrub/rmap_repair.c                    |  1 +
 fs/xfs/scrub/rtrmap_repair.c                  |  1 +
 fs/xfs/xfs_dquot.c                            |  7 +++++
 fs/xfs/xfs_dquot.h                            | 10 ++++--
 fs/xfs/xfs_dquot_item.c                       |  2 ++
 fs/xfs/xfs_qm.c                               |  3 ++
 fs/xfs/xfs_qm_syscalls.c                      |  1 +
 fs/xfs/xfs_trans_dquot.c                      |  3 ++
 include/linux/blkdev.h                        | 11 +++++--
 include/linux/cgroup.h                        |  2 ++
 include/linux/fb.h                            |  2 ++
 include/linux/fpga/fpga-bridge.h              |  2 +-
 include/linux/fpga/fpga-mgr.h                 |  4 +--
 include/linux/fsnotify_backend.h              |  2 ++
 include/linux/gameport.h                      |  1 +
 include/linux/memory_hotplug.h                |  2 ++
 include/linux/mfd/si476x-core.h               |  2 ++
 include/linux/netdevice.h                     |  2 ++
 include/linux/phy.h                           |  2 ++
 include/linux/usb.h                           |  3 +-
 include/media/v4l2-ctrls.h                    |  2 ++
 include/media/v4l2-subdev.h                   |  5 +++
 include/net/bluetooth/l2cap.h                 |  2 ++
 include/net/cfg80211.h                        |  2 ++
 include/sound/emu10k1.h                       | 12 +++++--
 include/sound/i2c.h                           |  2 ++
 include/sound/soc-card.h                      |  3 ++
 include/sound/soc.h                           | 14 +++++++++
 io_uring/cancel.c                             |  1 +
 io_uring/fdinfo.c                             |  1 +
 io_uring/io_uring.c                           |  5 +++
 io_uring/io_uring.h                           |  2 ++
 io_uring/msg_ring.c                           |  3 ++
 io_uring/register.c                           |  6 ++++
 io_uring/rsrc.c                               |  3 ++
 io_uring/sqpoll.c                             |  3 ++
 io_uring/tctx.c                               |  1 +
 kernel/acct.c                                 |  3 ++
 kernel/audit.c                                |  2 ++
 kernel/audit_tree.c                           |  2 ++
 kernel/audit_watch.c                          |  1 +
 kernel/bpf/btf.c                              |  1 +
 kernel/bpf/cgroup_iter.c                      |  2 ++
 kernel/bpf/verifier.c                         |  1 +
 kernel/cgroup/cgroup-v1.c                     |  4 +++
 kernel/cgroup/cgroup.c                        | 18 +++++++++++
 kernel/cgroup/cpuset.c                        |  2 ++
 kernel/cpu.c                                  |  2 ++
 kernel/events/callchain.c                     |  1 +
 kernel/events/core.c                          |  9 ++++++
 kernel/events/hw_breakpoint.c                 |  2 ++
 kernel/fail_function.c                        |  2 ++
 kernel/futex/core.c                           |  3 ++
 kernel/irq/autoprobe.c                        |  3 ++
 kernel/irq/irqdesc.c                          |  2 ++
 kernel/irq/msi.c                              |  2 ++
 kernel/jump_label.c                           |  2 ++
 kernel/kprobes.c                              |  3 ++
 kernel/locking/locktorture.c                  |  4 +++
 kernel/module/main.c                          |  1 +
 kernel/module/procfs.c                        |  2 ++
 kernel/params.c                               |  2 ++
 kernel/power/autosleep.c                      |  2 ++
 kernel/power/main.c                           |  2 ++
 kernel/printk/printk.c                        |  2 ++
 kernel/rcu/srcutree.c                         |  4 ++-
 kernel/rcu/tree_exp.h                         |  1 +
 kernel/sched/core.c                           |  1 +
 kernel/seccomp.c                              |  1 +
 kernel/static_call_inline.c                   |  2 ++
 kernel/torture.c                              |  2 ++
 kernel/trace/ftrace.c                         |  7 +++++
 kernel/trace/ring_buffer.c                    |  2 ++
 kernel/trace/rv/rv.c                          |  3 ++
 kernel/trace/rv/rv_reactors.c                 |  2 ++
 kernel/trace/trace.c                          | 12 +++++++
 kernel/trace/trace_dynevent.c                 |  2 ++
 kernel/trace/trace_events.c                   | 10 ++++++
 kernel/trace/trace_events_trigger.c           |  2 ++
 kernel/trace/trace_events_user.c              |  1 +
 kernel/trace/trace_hwlat.c                    |  2 ++
 kernel/trace/trace_osnoise.c                  |  2 ++
 kernel/trace/trace_printk.c                   |  8 +++++
 kernel/trace/trace_recursion_record.c         |  2 ++
 kernel/trace/trace_stat.c                     |  2 ++
 kernel/trace/trace_uprobe.c                   |  2 ++
 kernel/workqueue.c                            |  2 ++
 lib/Makefile                                  |  2 ++
 lib/dynamic_debug.c                           |  2 ++
 lib/error-inject.c                            |  2 ++
 lib/kunit/platform.c                          |  1 +
 lib/once.c                                    |  2 ++
 mm/damon/sysfs.c                              |  3 ++
 mm/hugetlb.c                                  |  4 +++
 mm/kmemleak.c                                 |  2 ++
 mm/ksm.c                                      |  1 +
 mm/oom_kill.c                                 |  1 +
 mm/page_alloc.c                               |  4 +++
 mm/percpu.c                                   |  1 +
 mm/slab_common.c                              |  2 ++
 mm/swap_slots.c                               |  2 ++
 mm/swapfile.c                                 |  2 ++
 mm/vma.c                                      |  2 ++
 mm/zswap.c                                    |  2 ++
 net/atm/resources.c                           |  2 ++
 net/bluetooth/l2cap_core.c                    |  9 ++++++
 net/bluetooth/l2cap_sock.c                    |  2 ++
 net/bluetooth/rfcomm/sock.c                   |  1 +
 net/bridge/netfilter/ebtables.c               |  5 +++
 net/caif/caif_socket.c                        |  2 ++
 net/can/j1939/main.c                          |  2 ++
 net/ceph/messenger.c                          |  3 ++
 net/ceph/messenger_v1.c                       |  2 ++
 net/ceph/messenger_v2.c                       | 14 +++++++++
 net/core/dev.c                                |  4 +++
 net/core/drop_monitor.c                       |  2 ++
 net/core/netdev-genl.c                        |  5 +++
 net/core/pktgen.c                             |  1 +
 net/core/rtnetlink.c                          | 12 +++++++
 net/core/sock.c                               |  2 ++
 net/devlink/core.c                            |  3 ++
 net/devlink/devl_internal.h                   |  2 ++
 net/ethtool/ioctl.c                           |  1 +
 net/ipv6/mcast.c                              |  1 +
 net/mac802154/cfg.c                           |  2 ++
 net/mac802154/mib.c                           |  2 ++
 net/netfilter/ipset/ip_set_core.c             |  2 ++
 net/netfilter/ipvs/ip_vs_app.c                |  2 ++
 net/netfilter/nf_log.c                        |  2 ++
 net/netfilter/nf_tables_api.c                 |  5 +++
 net/netfilter/nfnetlink.c                     |  2 ++
 net/netfilter/x_tables.c                      |  8 +++++
 net/netfilter/xt_hashlimit.c                  |  1 +
 net/netlink/af_netlink.c                      |  2 ++
 net/netlink/genetlink.c                       |  7 +++++
 net/openvswitch/datapath.c                    |  2 ++
 net/phonet/socket.c                           |  2 ++
 net/qrtr/af_qrtr.c                            |  1 +
 net/rds/ib_cm.c                               |  1 +
 net/rds/rdma_transport.c                      |  1 +
 net/rds/tcp_listen.c                          |  1 +
 net/rxrpc/af_rxrpc.c                          |  1 +
 net/rxrpc/call_object.c                       |  1 +
 net/rxrpc/sendmsg.c                           |  3 ++
 net/sched/act_api.c                           |  1 +
 net/sched/cls_api.c                           |  1 +
 net/shaper/shaper.c                           |  2 ++
 net/smc/af_smc.c                              |  1 +
 net/sunrpc/rpc_pipe.c                         |  2 ++
 net/sunrpc/svc_xprt.c                         |  2 ++
 net/unix/af_unix.c                            |  1 +
 net/unix/unix_bpf.c                           |  1 +
 net/wireless/nl80211.c                        |  9 ++++++
 samples/vfio-mdev/mtty.c                      |  1 +
 security/apparmor/apparmorfs.c                |  3 ++
 security/integrity/ima/ima_main.c             |  1 +
 security/keys/keyring.c                       |  3 ++
 security/tomoyo/gc.c                          |  3 ++
 sound/core/compress_offload.c                 |  3 ++
 sound/core/oss/pcm_oss.c                      |  9 ++++++
 sound/core/pcm_native.c                       |  8 +++++
 sound/core/seq/oss/seq_oss.c                  |  1 +
 sound/core/seq/seq_clientmgr.c                |  2 ++
 sound/core/seq/seq_memory.c                   |  1 +
 sound/core/sound.c                            |  1 +
 sound/isa/gus/gus_mem.c                       |  3 ++
 sound/pci/ac97/ac97_codec.c                   |  2 ++
 sound/pci/hda/hda_intel.c                     |  1 +
 sound/pci/hda/patch_realtek.c                 |  2 ++
 sound/pci/hda/tas2781_hda_i2c.c               |  1 +
 sound/pci/ice1712/ak4xxx.c                    |  2 ++
 sound/pci/ice1712/delta.c                     |  4 +++
 sound/pci/ice1712/ews.c                       |  6 ++++
 sound/pci/ice1712/hoontech.c                  |  1 +
 sound/pci/ice1712/ice1712.h                   |  2 ++
 sound/pci/ice1712/prodigy192.c                |  2 ++
 sound/pci/ice1712/revo.c                      |  4 +++
 sound/pci/pcxhr/pcxhr_core.c                  |  1 +
 sound/soc/codecs/rt5677.c                     |  2 ++
 sound/soc/codecs/wcd-mbhc-v2.c                |  7 ++++-
 sound/soc/soc-dapm.c                          |  9 ++++++
 sound/soc/soc-pcm.c                           | 25 +++++++++++++++
 sound/soc/sof/intel/hda-mlink.c               |  2 ++
 sound/soc/sof/ipc3-control.c                  |  1 +
 sound/soc/sof/ipc4-control.c                  |  1 +
 sound/synth/emux/soundfont.c                  |  2 ++
 virt/kvm/kvm_main.c                           |  3 ++
 808 files changed, 2057 insertions(+), 63 deletions(-)
arch/arm64/kvm/arm.c +2 -0
index 646e806c6ca6..babbf8b464b2 100644
@@ -1886,6 +1886,7 @@ int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
 
 /* unlocks vcpus from @vcpu_lock_idx and smaller */
 static void unlock_vcpus(struct kvm *kvm, int vcpu_lock_idx)
+	NO_THREAD_SAFETY_ANALYSIS /* too complex to be annotated */
 {
 	struct kvm_vcpu *tmp_vcpu;
 
@@ -1904,6 +1905,7 @@ void unlock_all_vcpus(struct kvm *kvm)
 
 /* Returns true if all vcpus were locked, false otherwise */
 bool lock_all_vcpus(struct kvm *kvm)
+	NO_THREAD_SAFETY_ANALYSIS /* too complex to be annotated */
 {
 	struct kvm_vcpu *tmp_vcpu;
 	unsigned long c;
arch/powerpc/kernel/rtas.c +1 -0
index d31c9799cab2..6aec52f1e065 100644
@@ -1884,6 +1884,7 @@ static bool block_rtas_call(const struct rtas_function *func, int nargs,
 
 /* We assume to be passed big endian arguments */
 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	const struct rtas_function *func;
 	struct pin_cookie cookie;
arch/powerpc/platforms/powermac/low_i2c.c +6 -0
index c097d591670e..1aa2e37c89d0 100644
@@ -381,6 +381,7 @@ static void kw_i2c_timeout(struct timer_list *t)
 }
 
 static int kw_i2c_open(struct pmac_i2c_bus *bus)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct pmac_i2c_host_kw *host = bus->hostdata;
 	mutex_lock(&host->mutex);
@@ -388,6 +389,7 @@ static int kw_i2c_open(struct pmac_i2c_bus *bus)
 }
 
 static void kw_i2c_close(struct pmac_i2c_bus *bus)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct pmac_i2c_host_kw *host = bus->hostdata;
 	mutex_unlock(&host->mutex);
@@ -1092,6 +1094,7 @@ EXPORT_SYMBOL_GPL(pmac_low_i2c_unlock);
 
 
 int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled)
+	TRY_ACQUIRE(0, bus->mutex)
 {
 	int rc;
 
@@ -1109,6 +1112,7 @@ int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled)
 EXPORT_SYMBOL_GPL(pmac_i2c_open);
 
 void pmac_i2c_close(struct pmac_i2c_bus *bus)
+	RELEASE(bus->mutex)
 {
 	WARN_ON(!bus->opened);
 	if (bus->close)
@@ -1232,6 +1236,7 @@ struct pmac_i2c_pf_inst
 };
 
 static void* pmac_i2c_do_begin(struct pmf_function *func, struct pmf_args *args)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct pmac_i2c_pf_inst *inst;
 	struct pmac_i2c_bus	*bus;
@@ -1265,6 +1270,7 @@ static void* pmac_i2c_do_begin(struct pmf_function *func, struct pmf_args *args)
 }
 
 static void pmac_i2c_do_end(struct pmf_function *func, void *instdata)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct pmac_i2c_pf_inst *inst = instdata;
 
arch/powerpc/platforms/pseries/papr-vpd.c +2 -0
index 1574176e3ffc..76ec272ff838 100644
@@ -234,6 +234,7 @@ struct vpd_sequence {
  */
 static void vpd_sequence_begin(struct vpd_sequence *seq,
 			       const struct papr_location_code *loc_code)
+	ACQUIRE(rtas_ibm_get_vpd_lock)
 {
 	/*
 	 * Use a static data structure for the location code passed to
@@ -266,6 +267,7 @@ static void vpd_sequence_begin(struct vpd_sequence *seq,
  * Releases resources obtained by vpd_sequence_begin().
  */
 static void vpd_sequence_end(struct vpd_sequence *seq)
+	RELEASE(rtas_ibm_get_vpd_lock)
 {
 	rtas_work_area_free(seq->params.work_area);
 	mutex_unlock(&rtas_ibm_get_vpd_lock);
arch/x86/events/core.c +1 -0
index 8f218ac0d445..54baf10a4820 100644
@@ -422,6 +422,7 @@ int x86_reserve_hardware(void)
 }
 
 void x86_release_hardware(void)
+	NO_THREAD_SAFETY_ANALYSIS /* needed because of a clang bug? */
 {
 	if (atomic_dec_and_mutex_lock(&pmc_refcount, &pmc_reserve_mutex)) {
 		release_pmc_hardware();
arch/x86/kernel/cpu/resctrl/pseudo_lock.c +1 -0
index 42cc162f7fc9..482219879239 100644
@@ -1288,6 +1288,7 @@ static const struct file_operations pseudo_measure_fops = {
  * on failure. Descriptive error will be written to last_cmd_status buffer.
  */
 int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp)
+	REQUIRES(rdtgroup_mutex)
 {
 	struct pseudo_lock_region *plr = rdtgrp->plr;
 	struct task_struct *thread;
arch/x86/kernel/cpu/resctrl/rdtgroup.c +2 -0
index 6419e04d8a7b..9ee24ec5b4af 100644
@@ -2470,6 +2470,7 @@ static void rdtgroup_kn_put(struct rdtgroup *rdtgrp, struct kernfs_node *kn)
 }
 
 struct rdtgroup *rdtgroup_kn_lock_live(struct kernfs_node *kn)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking + returns a pointer */
 {
 	struct rdtgroup *rdtgrp = kernfs_to_rdtgroup(kn);
 
@@ -2489,6 +2490,7 @@ struct rdtgroup *rdtgroup_kn_lock_live(struct kernfs_node *kn)
 }
 
 void rdtgroup_kn_unlock(struct kernfs_node *kn)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the lock function */
 {
 	struct rdtgroup *rdtgrp = kernfs_to_rdtgroup(kn);
 
arch/x86/kernel/cpu/sgx/encl.c +2 -0
index 279148e72459..8c2d88b1f944 100644
@@ -606,6 +606,7 @@ static int sgx_encl_debug_write(struct sgx_encl *encl, struct sgx_encl_page *pag
 static struct sgx_encl_page *sgx_encl_reserve_page(struct sgx_encl *encl,
 						   unsigned long addr,
 						   unsigned long vm_flags)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking + returns a pointer */
 {
 	struct sgx_encl_page *entry;
 
@@ -627,6 +628,7 @@ static struct sgx_encl_page *sgx_encl_reserve_page(struct sgx_encl *encl,
 
 static int sgx_vma_access(struct vm_area_struct *vma, unsigned long addr,
 			  void *buf, int len, int write)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the lock function */
 {
 	struct sgx_encl *encl = vma->vm_private_data;
 	struct sgx_encl_page *entry = NULL;
arch/x86/kernel/ftrace.c +2 -0
index 166bc0ea3bdf..7651a3feaa99 100644
@@ -40,6 +40,7 @@ static int ftrace_poke_late = 0;
 
 void ftrace_arch_code_modify_prepare(void)
     __acquires(&text_mutex)
+	ACQUIRE(text_mutex)
 {
 	/*
 	 * Need to grab text_mutex to prevent a race from module loading
@@ -52,6 +53,7 @@ void ftrace_arch_code_modify_prepare(void)
 
 void ftrace_arch_code_modify_post_process(void)
     __releases(&text_mutex)
+	RELEASE(text_mutex)
 {
 	/*
 	 * ftrace_make_{call,nop}() may be called during
arch/x86/kernel/module.c +1 -0
index 8984abd91c00..3c250b56033e 100644
@@ -180,6 +180,7 @@ static int write_relocate_add(Elf64_Shdr *sechdrs,
 			      unsigned int relsec,
 			      struct module *me,
 			      bool apply)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int ret;
 	bool early = me->state == MODULE_STATE_UNFORMED;
arch/x86/kvm/svm/sev.c +6 -0
index a2a794c32050..9acc922e6e16 100644
@@ -1857,6 +1857,8 @@ static bool is_cmd_allowed_from_mirror(u32 cmd_id)
 }
 
 static int sev_lock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm)
+	TRY_ACQUIRE(0, dst_kvm->lock)
+	TRY_ACQUIRE(0, src_kvm->lock)
 {
 	struct kvm_sev_info *dst_sev = &to_kvm_svm(dst_kvm)->sev_info;
 	struct kvm_sev_info *src_sev = &to_kvm_svm(src_kvm)->sev_info;
@@ -1892,6 +1894,8 @@ static int sev_lock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm)
 }
 
 static void sev_unlock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm)
+	RELEASE(&dst_kvm->lock)
+	RELEASE(&src_kvm->lock)
 {
 	struct kvm_sev_info *dst_sev = &to_kvm_svm(dst_kvm)->sev_info;
 	struct kvm_sev_info *src_sev = &to_kvm_svm(src_kvm)->sev_info;
@@ -1911,6 +1915,7 @@ enum sev_migration_role {
 
 static int sev_lock_vcpus_for_migration(struct kvm *kvm,
 					enum sev_migration_role role)
+	NO_THREAD_SAFETY_ANALYSIS /* too complex for annotations */
 {
 	struct kvm_vcpu *vcpu;
 	unsigned long i, j;
@@ -1950,6 +1955,7 @@ static int sev_lock_vcpus_for_migration(struct kvm *kvm,
 }
 
 static void sev_unlock_vcpus_for_migration(struct kvm *kvm)
+	NO_THREAD_SAFETY_ANALYSIS /* too complex for annotations */
 {
 	struct kvm_vcpu *vcpu;
 	unsigned long i;
block/bdev.c +3 -0
index 9d73a8fbf7f9..1bba899f2712 100644
@@ -241,6 +241,7 @@ EXPORT_SYMBOL(sync_blockdev_range);
  * Return: On success zero is returned, negative error code on failure.
  */
 int bdev_freeze(struct block_device *bdev)
+	NO_THREAD_SAFETY_ANALYSIS /* too complex */
 {
 	int error = 0;
 
@@ -277,6 +278,7 @@ EXPORT_SYMBOL(bdev_freeze);
  * Return: On success zero is returned, negative error code on failure.
  */
 int bdev_thaw(struct block_device *bdev)
+	NO_THREAD_SAFETY_ANALYSIS /* too complex */
 {
 	int error = -EINVAL, nr_freeze;
 
@@ -1194,6 +1196,7 @@ EXPORT_SYMBOL(lookup_bdev);
  * the file system.  In addition we also invalidate the block device mapping.
  */
 void bdev_mark_dead(struct block_device *bdev, bool surprise)
+	NO_THREAD_SAFETY_ANALYSIS /* too complex */
 {
 	mutex_lock(&bdev->bd_holder_lock);
 	if (bdev->bd_holder_ops && bdev->bd_holder_ops->mark_dead)
block/blk-cgroup.c +2 -0
index 9ed93d91d754..5bc8e66c03f3 100644
@@ -779,6 +779,7 @@ EXPORT_SYMBOL_GPL(blkg_conf_init);
  * of @ctx->input. Returns -errno on error.
  */
 int blkg_conf_open_bdev(struct blkg_conf_ctx *ctx)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	char *input = ctx->input;
 	unsigned int major, minor;
@@ -956,6 +957,7 @@ EXPORT_SYMBOL_GPL(blkg_conf_prep);
 void blkg_conf_exit(struct blkg_conf_ctx *ctx)
 	__releases(&ctx->bdev->bd_queue->queue_lock)
 	__releases(&ctx->bdev->bd_queue->rq_qos_mutex)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	if (ctx->blkg) {
 		spin_unlock_irq(&bdev_get_queue(ctx->bdev)->queue_lock);
block/ioctl.c +1 -0
index 6554b728bae6..597517589026 100644
@@ -417,6 +417,7 @@ static int blkdev_pr_clear(struct block_device *bdev, blk_mode_t mode,
 
 static int blkdev_flushbuf(struct block_device *bdev, unsigned cmd,
 		unsigned long arg)
+	TRY_ACQUIRE(0, bdev->bd_holder_lock)
 {
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
drivers/accel/amdxdna/aie2_error.c +3 -2
index b1defaa8513b..7b9c3ad96dc9 100644
@@ -290,15 +290,16 @@ int aie2_error_async_events_send(struct amdxdna_dev_hdl *ndev)
 }
 
 void aie2_error_async_events_free(struct amdxdna_dev_hdl *ndev)
+	REQUIRES(ndev->xdna->dev_lock)
 {
 	struct amdxdna_dev *xdna = ndev->xdna;
 	struct async_events *events;
 
 	events = ndev->async_events;
 
-	mutex_unlock(&xdna->dev_lock);
+	mutex_unlock(&ndev->xdna->dev_lock);
 	destroy_workqueue(events->wq);
-	mutex_lock(&xdna->dev_lock);
+	mutex_lock(&ndev->xdna->dev_lock);
 
 	dma_free_noncoherent(xdna->ddev.dev, events->size, events->buf,
 			     events->addr, DMA_FROM_DEVICE);
drivers/accel/qaic/qaic_control.c +1 -0
index d8bdab69f800..7890cf6a785a 100644
@@ -1014,6 +1014,7 @@ static int decode_message(struct qaic_device *qdev, struct manage_msg *user_msg,
 
 static void *msg_xfer(struct qaic_device *qdev, struct wrapper_list *wrappers, u32 seq_num,
 		      bool ignore_signal)
+	RELEASE(qdev->cntl_mutex)
 {
 	struct xfer_queue_elem elem;
 	struct wire_msg *out_buf;
drivers/acpi/scan.c +5 -0
index 9f4efa8f75a6..49534e4ff395 100644
@@ -50,23 +50,27 @@ static DEFINE_MUTEX(acpi_hp_context_lock);
 static u64 spcr_uart_addr;
 
 void acpi_scan_lock_acquire(void)
+	ACQUIRE(acpi_scan_lock)
 {
 	mutex_lock(&acpi_scan_lock);
 }
 EXPORT_SYMBOL_GPL(acpi_scan_lock_acquire);
 
 void acpi_scan_lock_release(void)
+	RELEASE(acpi_scan_lock)
 {
 	mutex_unlock(&acpi_scan_lock);
 }
 EXPORT_SYMBOL_GPL(acpi_scan_lock_release);
 
 void acpi_lock_hp_context(void)
+	ACQUIRE(acpi_hp_context_lock)
 {
 	mutex_lock(&acpi_hp_context_lock);
 }
 
 void acpi_unlock_hp_context(void)
+	RELEASE(acpi_hp_context_lock)
 {
 	mutex_unlock(&acpi_hp_context_lock);
 }
@@ -1867,6 +1871,7 @@ static void acpi_scan_init_status(struct acpi_device *adev)
 
 static int acpi_add_single_object(struct acpi_device **child,
 				  acpi_handle handle, int type, bool dep_init)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct acpi_device *device;
 	bool release_dep_lock = false;
drivers/ata/libata-core.c +29 -2
index 63ec2f218431..14cfc12eb785 100644
@@ -1492,6 +1492,7 @@ unsigned int ata_exec_internal(struct ata_device *dev, struct ata_taskfile *tf,
 			       const u8 *cdb, enum dma_data_direction dma_dir,
 			       void *buf, unsigned int buflen,
 			       unsigned int timeout)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_link *link = dev->link;
 	struct ata_port *ap = link->ap;
@@ -1572,11 +1573,11 @@ unsigned int ata_exec_internal(struct ata_device *dev, struct ata_taskfile *tf,
 		}
 	}
 
-	ata_eh_release(ap);
+	ata_eh_release(dev->link->ap);
 
 	rc = wait_for_completion_timeout(&wait, msecs_to_jiffies(timeout));
 
-	ata_eh_acquire(ap);
+	ata_eh_acquire(dev->link->ap);
 
 	ata_sff_flush_pio_task(ap);
 
@@ -1702,6 +1703,7 @@ static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
  */
 unsigned int ata_do_dev_read_id(struct ata_device *dev,
 				struct ata_taskfile *tf, __le16 *id)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	return ata_exec_internal(dev, tf, NULL, DMA_FROM_DEVICE,
 				     id, sizeof(id[0]) * ATA_ID_WORDS, 0);
@@ -1731,6 +1733,7 @@ EXPORT_SYMBOL_GPL(ata_do_dev_read_id);
  */
 int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
 		    unsigned int flags, u16 *id)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_port *ap = dev->link->ap;
 	unsigned int class = *p_class;
@@ -1945,6 +1948,7 @@ bool ata_dev_power_init_tf(struct ata_device *dev, struct ata_taskfile *tf,
 }
 
 static bool ata_dev_power_is_active(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_taskfile tf;
 	unsigned int err_mask;
@@ -1982,6 +1986,7 @@ static bool ata_dev_power_is_active(struct ata_device *dev)
  *	Kernel thread context (may sleep).
  */
 void ata_dev_power_set_standby(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned long ap_flags = dev->link->ap->flags;
 	struct ata_taskfile tf;
@@ -2029,6 +2034,7 @@ void ata_dev_power_set_standby(struct ata_device *dev)
  *	Kernel thread context (may sleep).
  */
 void ata_dev_power_set_active(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_taskfile tf;
 	unsigned int err_mask;
@@ -2073,6 +2079,7 @@ void ata_dev_power_set_active(struct ata_device *dev)
  */
 unsigned int ata_read_log_page(struct ata_device *dev, u8 log,
 			       u8 page, void *buf, unsigned int sectors)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned long ap_flags = dev->link->ap->flags;
 	struct ata_taskfile tf;
@@ -2124,6 +2131,7 @@ unsigned int ata_read_log_page(struct ata_device *dev, u8 log,
 }
 
 static int ata_log_supported(struct ata_device *dev, u8 log)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	if (dev->quirks & ATA_QUIRK_NO_LOG_DIR)
 		return 0;
@@ -2134,6 +2142,7 @@ static int ata_log_supported(struct ata_device *dev, u8 log)
 }
 
 static bool ata_identify_page_supported(struct ata_device *dev, u8 page)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int err, i;
 
@@ -2214,6 +2223,7 @@ static inline bool ata_dev_knobble(struct ata_device *dev)
 }
 
 static void ata_dev_config_ncq_send_recv(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int err_mask;
 
@@ -2238,6 +2248,7 @@ static void ata_dev_config_ncq_send_recv(struct ata_device *dev)
 }
 
 static void ata_dev_config_ncq_non_data(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int err_mask;
 
@@ -2254,6 +2265,7 @@ static void ata_dev_config_ncq_non_data(struct ata_device *dev)
 }
 
 static void ata_dev_config_ncq_prio(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int err_mask;
 
@@ -2300,6 +2312,7 @@ static bool ata_dev_check_adapter(struct ata_device *dev,
 
 static int ata_dev_config_ncq(struct ata_device *dev,
 			       char *desc, size_t desc_sz)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_port *ap = dev->link->ap;
 	int hdepth = 0, ddepth = ata_id_queue_depth(dev->id);
@@ -2382,6 +2395,7 @@ static void ata_dev_config_sense_reporting(struct ata_device *dev)
 }
 
 static void ata_dev_config_zac(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int err_mask;
 	u8 *identify_buf = dev->sector_buf;
@@ -2435,6 +2449,7 @@ static void ata_dev_config_zac(struct ata_device *dev)
 }
 
 static void ata_dev_config_trusted(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	u64 trusted_cap;
 	unsigned int err;
@@ -2471,6 +2486,7 @@ void ata_dev_cleanup_cdl_resources(struct ata_device *dev)
 }
 
 static int ata_dev_init_cdl_resources(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_cdl *cdl = dev->cdl;
 	unsigned int err_mask;
@@ -2494,6 +2510,7 @@ static int ata_dev_init_cdl_resources(struct ata_device *dev)
 }
 
 static void ata_dev_config_cdl(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int err_mask;
 	bool cdl_enabled;
@@ -2610,6 +2627,7 @@ static void ata_dev_config_cdl(struct ata_device *dev)
 }
 
 static int ata_dev_config_lba(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	const u16 *id = dev->id;
 	const char *lba_desc;
@@ -2689,6 +2707,7 @@ static void ata_dev_config_fua(struct ata_device *dev)
 }
 
 static void ata_dev_config_devslp(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	u8 *sata_setting = dev->sector_buf;
 	unsigned int err_mask;
@@ -2717,6 +2736,7 @@ static void ata_dev_config_devslp(struct ata_device *dev)
 }
 
 static void ata_dev_config_cpr(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int err_mask;
 	size_t buf_len;
@@ -2801,6 +2821,7 @@ static void ata_dev_print_features(struct ata_device *dev)
  *	0 on success, -errno otherwise
  */
 int ata_dev_configure(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_port *ap = dev->link->ap;
 	bool print_info = ata_dev_print_info(dev);
@@ -3758,6 +3779,7 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
  *	0 on success, negative errno otherwise
  */
 int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	unsigned int class = dev->class;
 	u16 *id = (void *)dev->sector_buf;
@@ -3793,6 +3815,7 @@ int ata_dev_reread_id(struct ata_device *dev, unsigned int readid_flags)
  */
 int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
 		       unsigned int readid_flags)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	u64 n_sectors = dev->n_sectors;
 	u64 n_native_sectors = dev->n_native_sectors;
@@ -4416,6 +4439,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
  */
 
 static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_taskfile tf;
 
@@ -4461,6 +4485,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
  *	0 on success, AC_ERR_* mask otherwise.
  */
 unsigned int ata_dev_set_feature(struct ata_device *dev, u8 subcmd, u8 action)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_taskfile tf;
 	unsigned int timeout = 0;
@@ -4497,6 +4522,7 @@ EXPORT_SYMBOL_GPL(ata_dev_set_feature);
  */
 static unsigned int ata_dev_init_params(struct ata_device *dev,
 					u16 heads, u16 sectors)
+	REQUIRES(dev->link->ap->host->eh_mutex)
 {
 	struct ata_taskfile tf;
 	unsigned int err_mask;
@@ -6549,6 +6575,7 @@ EXPORT_SYMBOL_GPL(ata_ratelimit);
  *	Might sleep.
  */
 void ata_msleep(struct ata_port *ap, unsigned int msecs)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	bool owns_eh = ap && ap->host->eh_owner == current;
 
drivers/ata/libata-eh.c +2 -0
index 3b303d4ae37a..e2bb3b965fbd 100644
@@ -2613,6 +2613,7 @@ static int ata_eh_followup_srst_needed(struct ata_link *link, int rc)
 int ata_eh_reset(struct ata_link *link, int classify,
 		 ata_prereset_fn_t prereset, ata_reset_fn_t softreset,
 		 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset)
+	NO_THREAD_SAFETY_ANALYSIS /*REQUIRES(link->ap->host->eh_mutex)*/
 {
 	struct ata_port *ap = link->ap;
 	struct ata_link *slave = ap->slave_link;
@@ -3730,6 +3731,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
 		   ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
 		   ata_postreset_fn_t postreset,
 		   struct ata_link **r_failed_link)
+	NO_THREAD_SAFETY_ANALYSIS /*REQUIRES(link->ap->host->eh_mutex)*/
 {
 	struct ata_link *link;
 	struct ata_device *dev;
drivers/ata/libata.h +4 -2
index 0337be4faec7..89b8ddc8ec08 100644
@@ -157,8 +157,10 @@ int __ata_scsi_queuecmd(struct scsi_cmnd *scmd, struct ata_device *dev);
 /* libata-eh.c */
 extern unsigned int ata_internal_cmd_timeout(struct ata_device *dev, u8 cmd);
 extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd);
-extern void ata_eh_acquire(struct ata_port *ap);
-extern void ata_eh_release(struct ata_port *ap);
+extern void ata_eh_acquire(struct ata_port *ap)
+	ACQUIRE(ap->host->eh_mutex);
+extern void ata_eh_release(struct ata_port *ap)
+	RELEASE(ap->host->eh_mutex);
 extern void ata_scsi_error(struct Scsi_Host *host);
 extern void ata_eh_fastdrain_timerfn(struct timer_list *t);
 extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc);
drivers/base/bus.c +1 -0
index 6b9e65a42cd2..2249bee87ac3 100644
@@ -760,6 +760,7 @@ void bus_remove_driver(struct device_driver *drv)
 /* Helper for bus_rescan_devices's iter */
 static int __must_check bus_rescan_devices_helper(struct device *dev,
 						  void *data)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int ret = 0;
 
drivers/base/core.c +7 -0
index 5a1f05198114..a7e3599993fc 100644
@@ -239,11 +239,13 @@ static DEFINE_MUTEX(device_links_lock);
 DEFINE_STATIC_SRCU(device_links_srcu);
 
 static inline void device_links_write_lock(void)
+	ACQUIRE(device_links_lock)
 {
 	mutex_lock(&device_links_lock);
 }
 
 static inline void device_links_write_unlock(void)
+	RELEASE(device_links_lock)
 {
 	mutex_unlock(&device_links_lock);
 }
@@ -1160,6 +1162,7 @@ static void __device_links_queue_sync_state(struct device *dev,
  */
 static void device_links_flush_sync_list(struct list_head *list,
 					 struct device *dont_lock_dev)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct device *dev, *tmp;
 
@@ -2343,16 +2346,19 @@ static struct kobject *sysfs_dev_block_kobj;
 static DEFINE_MUTEX(device_hotplug_lock);
 
 void lock_device_hotplug(void)
+	NO_THREAD_SAFETY_ANALYSIS /* function declaration has been annotated */
 {
 	mutex_lock(&device_hotplug_lock);
 }
 
 void unlock_device_hotplug(void)
+	NO_THREAD_SAFETY_ANALYSIS /* function declaration has been annotated */
 {
 	mutex_unlock(&device_hotplug_lock);
 }
 
 int lock_device_hotplug_sysfs(void)
+	NO_THREAD_SAFETY_ANALYSIS /* function declaration has been annotated */
 {
 	if (mutex_trylock(&device_hotplug_lock))
 		return 0;
@@ -4763,6 +4769,7 @@ EXPORT_SYMBOL_GPL(device_change_owner);
  * device_shutdown - call ->shutdown() on each device to shutdown.
  */
 void device_shutdown(void)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct device *dev, *parent;
 
drivers/base/dd.c +2 -0
index f0e4b4aba885..6193ea5789ca 100644
@@ -1089,6 +1089,7 @@ void device_initial_probe(struct device *dev)
  * interface, @parent lock will be held as well.
  */
 static void __device_driver_lock(struct device *dev, struct device *parent)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (parent && dev->bus->need_parent_lock)
 		device_lock(parent);
@@ -1105,6 +1106,7 @@ static void __device_driver_lock(struct device *dev, struct device *parent)
  * USB interface, @parent lock will be released as well.
  */
 static void __device_driver_unlock(struct device *dev, struct device *parent)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	device_unlock(dev);
 	if (parent && dev->bus->need_parent_lock)
drivers/base/power/clock_ops.c +4 -0
index e18ba676cdf6..1a042b447f4f 100644
@@ -51,6 +51,7 @@ struct pm_clock_entry {
  */
 static void pm_clk_list_lock(struct pm_subsys_data *psd)
 	__acquires(&psd->lock)
+	ACQUIRE(psd->clock_mutex)
 {
 	mutex_lock(&psd->clock_mutex);
 	spin_lock_irq(&psd->lock);
@@ -63,6 +64,7 @@ static void pm_clk_list_lock(struct pm_subsys_data *psd)
  */
 static void pm_clk_list_unlock(struct pm_subsys_data *psd)
 	__releases(&psd->lock)
+	RELEASE(psd->clock_mutex)
 {
 	spin_unlock_irq(&psd->lock);
 	mutex_unlock(&psd->clock_mutex);
@@ -86,6 +88,7 @@ static void pm_clk_list_unlock(struct pm_subsys_data *psd)
 static int pm_clk_op_lock(struct pm_subsys_data *psd, unsigned long *flags,
 			  const char *fn)
 	/* sparse annotations don't work here as exit state isn't static */
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	bool atomic_context = in_atomic() || irqs_disabled();
 
@@ -129,6 +132,7 @@ static int pm_clk_op_lock(struct pm_subsys_data *psd, unsigned long *flags,
  */
 static void pm_clk_op_unlock(struct pm_subsys_data *psd, unsigned long *flags)
 	/* sparse annotations don't work here as entry state isn't static */
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (psd->clock_op_might_sleep) {
 		mutex_unlock(&psd->clock_mutex);
drivers/base/power/main.c +2 -0
index d497d448e4b2..c59fe19e1257 100644
@@ -109,6 +109,7 @@ void device_pm_sleep_init(struct device *dev)
  * device_pm_lock - Lock the list of active devices used by the PM core.
  */
 void device_pm_lock(void)
+	ACQUIRE(dpm_list_mtx)
 {
 	mutex_lock(&dpm_list_mtx);
 }
@@ -117,6 +118,7 @@ void device_pm_lock(void)
  * device_pm_unlock - Unlock the list of active devices used by the PM core.
  */
 void device_pm_unlock(void)
+	RELEASE(dpm_list_mtx)
 {
 	mutex_unlock(&dpm_list_mtx);
 }
drivers/base/regmap/regmap-irq.c +2 -0
index 0bcd81389a29..ddcc75251d7f 100644
@@ -70,6 +70,7 @@ static bool regmap_irq_can_bulk_read_status(struct regmap_irq_chip_data *data)
 }
 
 static void regmap_irq_lock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex is not a member of an argument */
 {
 	struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
 
@@ -77,6 +78,7 @@ static void regmap_irq_lock(struct irq_data *data)
 }
 
 static void regmap_irq_sync_unlock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex is not a member of an argument */
 {
 	struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
 	struct regmap *map = d->map;
drivers/base/regmap/regmap.c +2 -0
index f2843f814675..68a91578473d 100644
@@ -440,12 +440,14 @@ static void regmap_lock_unlock_none(void *__map)
 }
 
 static void regmap_lock_mutex(void *__map)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex is not a member of an argument */
 {
 	struct regmap *map = __map;
 	mutex_lock(&map->mutex);
 }
 
 static void regmap_unlock_mutex(void *__map)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex is not a member of an argument */
 {
 	struct regmap *map = __map;
 	mutex_unlock(&map->mutex);
drivers/block/drbd/drbd_bitmap.c +2 -0
index 85ca000a0564..da332953adec 100644
@@ -122,6 +122,7 @@ static void __bm_print_lock_info(struct drbd_device *device, const char *func)
 }
 
 void drbd_bm_lock(struct drbd_device *device, char *why, enum bm_flag flags)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drbd_bitmap *b = device->bitmap;
 	int trylock_failed;
@@ -149,6 +150,7 @@ void drbd_bm_lock(struct drbd_device *device, char *why, enum bm_flag flags)
 }
 
 void drbd_bm_unlock(struct drbd_device *device)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drbd_bitmap *b = device->bitmap;
 	if (!b) {
drivers/block/drbd/drbd_main.c +7 -0
index 5bbd312c3e14..ea19b3d5bce7 100644
@@ -598,6 +598,7 @@ static void *__conn_prepare_command(struct drbd_connection *connection,
 }
 
 void *conn_prepare_command(struct drbd_connection *connection, struct drbd_socket *sock)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	void *p;
 
@@ -655,6 +656,7 @@ static int __conn_send_command(struct drbd_connection *connection, struct drbd_s
 int conn_send_command(struct drbd_connection *connection, struct drbd_socket *sock,
 		      enum drbd_packet cmd, unsigned int header_size,
 		      void *data, unsigned int size)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the mutex_lock() caller */
 {
 	int err;
 
@@ -666,6 +668,7 @@ int conn_send_command(struct drbd_connection *connection, struct drbd_socket *so
 int drbd_send_command(struct drbd_peer_device *peer_device, struct drbd_socket *sock,
 		      enum drbd_packet cmd, unsigned int header_size,
 		      void *data, unsigned int size)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the mutex_lock() caller */
 {
 	int err;
 
@@ -1649,6 +1652,7 @@ static u32 bio_flags_to_wire(struct drbd_connection *connection,
  * R_PRIMARY -> Peer	(P_DATA, P_TRIM)
  */
 int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *req)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the mutex_lock() caller */
 {
 	struct drbd_device *device = peer_device->device;
 	struct drbd_socket *sock;
@@ -1742,6 +1746,7 @@ int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *
  */
 int drbd_send_block(struct drbd_peer_device *peer_device, enum drbd_packet cmd,
 		    struct drbd_peer_request *peer_req)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the mutex_lock() caller */
 {
 	struct drbd_device *device = peer_device->device;
 	struct drbd_socket *sock;
@@ -3705,6 +3710,7 @@ int drbd_wait_misc(struct drbd_device *device, struct drbd_interval *i)
 }
 
 void lock_all_resources(void)
+	ACQUIRE(resources_mutex)
 {
 	struct drbd_resource *resource;
 	int __maybe_unused i = 0;
@@ -3716,6 +3722,7 @@ void lock_all_resources(void)
 }
 
 void unlock_all_resources(void)
+	RELEASE(resources_mutex)
 {
 	struct drbd_resource *resource;
 
drivers/block/drbd/drbd_nl.c +1 -0
index 720fc30e2ecc..d960832cf106 100644
@@ -3432,6 +3432,7 @@ int drbd_adm_dump_connections_done(struct netlink_callback *cb)
 enum { SINGLE_RESOURCE, ITERATE_RESOURCES };
 
 int drbd_adm_dump_connections(struct sk_buff *skb, struct netlink_callback *cb)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct nlattr *resource_filter;
 	struct drbd_resource *resource = NULL, *next_resource;
drivers/block/drbd/drbd_receiver.c +1 -0
index 0c9f54197768..fe94f2f23aaa 100644
@@ -921,6 +921,7 @@ int drbd_connected(struct drbd_peer_device *peer_device)
  *  -2 We do not have a network config...
  */
 static int conn_connect(struct drbd_connection *connection)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drbd_socket sock, msock;
 	struct drbd_peer_device *peer_device;
drivers/block/drbd/drbd_state.c +4 -0
index c2b6c4d9729d..f5dace68a8e2 100644
@@ -562,6 +562,7 @@ _req_st_cond(struct drbd_device *device, union drbd_state mask,
 static enum drbd_state_rv
 drbd_req_state(struct drbd_device *device, union drbd_state mask,
 	       union drbd_state val, enum chg_state_flags f)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct completion done;
 	unsigned long flags;
@@ -699,6 +700,7 @@ int drbd_request_detach_interruptible(struct drbd_device *device)
 enum drbd_state_rv
 _drbd_request_state_holding_state_mutex(struct drbd_device *device, union drbd_state mask,
 		    union drbd_state val, enum chg_state_flags f)
+	REQUIRES(device->state_mutex)
 {
 	enum drbd_state_rv rv;
 
@@ -2292,6 +2294,7 @@ _conn_rq_cond(struct drbd_connection *connection, union drbd_state mask, union d
 enum drbd_state_rv
 _conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val,
 		    enum chg_state_flags flags)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	enum drbd_state_rv rv = SS_SUCCESS;
 	struct after_conn_state_chg_work *acscw;
@@ -2386,6 +2389,7 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u
 enum drbd_state_rv
 conn_request_state(struct drbd_connection *connection, union drbd_state mask, union drbd_state val,
 		   enum chg_state_flags flags)
+	REQUIRES(connection->cstate_mutex)
 {
 	enum drbd_state_rv rv;
 
drivers/block/loop.c +2 -0
index c05fe27a96b6..fbd5c8846bff 100644
@@ -108,6 +108,7 @@ static DEFINE_MUTEX(loop_validate_mutex);
  * loop_configure()/loop_change_fd()/__loop_clr_fd() calls.
  */
 static int loop_global_lock_killable(struct loop_device *lo, bool global)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int err;
 
@@ -129,6 +130,7 @@ static int loop_global_lock_killable(struct loop_device *lo, bool global)
  * @global: true if @lo was about to bind another "struct loop_device", false otherwise
  */
 static void loop_global_unlock(struct loop_device *lo, bool global)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	mutex_unlock(&lo->lo_mutex);
 	if (global)
drivers/block/nbd.c +3 -0
index 7bdc7eb808ea..e223d94f462f 100644
@@ -1419,6 +1419,7 @@ static void nbd_clear_sock(struct nbd_device *nbd)
 }
 
 static void nbd_config_put(struct nbd_device *nbd)
+	NO_THREAD_SAFETY_ANALYSIS /* because of a clang bug */
 {
 	if (refcount_dec_and_mutex_lock(&nbd->config_refs,
 					&nbd->config_lock)) {
@@ -1520,6 +1521,7 @@ static int nbd_start_device(struct nbd_device *nbd)
 }
 
 static int nbd_start_device_ioctl(struct nbd_device *nbd)
+	REQUIRES(nbd->config_lock)
 {
 	struct nbd_config *config = nbd->config;
 	int ret;
@@ -1571,6 +1573,7 @@ static void nbd_set_cmd_timeout(struct nbd_device *nbd, u64 timeout)
 /* Must be called with config_lock held */
 static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
 		       unsigned int cmd, unsigned long arg)
+	REQUIRES(nbd->config_lock)
 {
 	struct nbd_config *config = nbd->config;
 	loff_t bytesize;
drivers/block/null_blk/zoned.c +2 -0
index 0d5f9bf95229..2ca5f790c7ee 100644
@@ -32,6 +32,7 @@ static inline void null_init_zone_lock(struct nullb_device *dev,
 
 static inline void null_lock_zone(struct nullb_device *dev,
 				  struct nullb_zone *zone)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (!dev->memory_backed)
 		spin_lock_irq(&zone->spinlock);
@@ -41,6 +42,7 @@ static inline void null_lock_zone(struct nullb_device *dev,
 
 static inline void null_unlock_zone(struct nullb_device *dev,
 				    struct nullb_zone *zone)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (!dev->memory_backed)
 		spin_unlock_irq(&zone->spinlock);
drivers/block/rnbd/rnbd-clt.c +2 -0
index 82467ecde7ec..7fb977f115f8 100644
@@ -831,6 +831,7 @@ static int wait_for_rtrs_connection(struct rnbd_clt_session *sess)
 static void wait_for_rtrs_disconnection(struct rnbd_clt_session *sess)
 	__releases(&sess_lock)
 	__acquires(&sess_lock)
+	REQUIRES(sess_lock)
 {
 	DEFINE_WAIT(wait);
 
@@ -853,6 +854,7 @@ static void wait_for_rtrs_disconnection(struct rnbd_clt_session *sess)
 static struct rnbd_clt_session *__find_and_get_sess(const char *sessname)
 	__releases(&sess_lock)
 	__acquires(&sess_lock)
+	REQUIRES(sess_lock)
 {
 	struct rnbd_clt_session *sess, *sn;
 	int err;
drivers/bus/fsl-mc/mc-sys.c +1 -0
index f2052cd0a051..24cfdf457bb1 100644
@@ -243,6 +243,7 @@ static int mc_polling_wait_atomic(struct fsl_mc_io *mc_io,
  * Returns '0' on Success; Error code otherwise.
  */
 int mc_send_command(struct fsl_mc_io *mc_io, struct fsl_mc_command *cmd)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int error;
 	enum mc_cmd_status status;
drivers/bus/vexpress-config.c +2 -0
index 64ee920721ee..99bfbafce3e8 100644
@@ -78,11 +78,13 @@ static void vexpress_config_set_master(u32 site)
 }
 
 static void vexpress_config_lock(void *arg)
+	ACQUIRE(vexpress_config_mutex)
 {
 	mutex_lock(&vexpress_config_mutex);
 }
 
 static void vexpress_config_unlock(void *arg)
+	RELEASE(vexpress_config_mutex)
 {
 	mutex_unlock(&vexpress_config_mutex);
 }
drivers/cdx/cdx_msi.c +2 -0
index 06d723978232..4e035b4e4c65 100644
@@ -29,6 +29,7 @@ static void cdx_msi_write_msg(struct irq_data *irq_data, struct msi_msg *msg)
 }
 
 static void cdx_msi_write_irq_lock(struct irq_data *irq_data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct msi_desc *msi_desc = irq_data_get_msi_desc(irq_data);
 	struct cdx_device *cdx_dev = to_cdx_device(msi_desc->dev);
@@ -37,6 +38,7 @@ static void cdx_msi_write_irq_lock(struct irq_data *irq_data)
 }
 
 static void cdx_msi_write_irq_unlock(struct irq_data *irq_data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct msi_desc *msi_desc = irq_data_get_msi_desc(irq_data);
 	struct cdx_device *cdx_dev = to_cdx_device(msi_desc->dev);
drivers/char/ipmi/ipmi_msghandler.c +1 -0
index 1e5313748f8b..e9472c570d79 100644
@@ -3103,6 +3103,7 @@ static void ipmi_bmc_unregister(struct ipmi_smi *intf)
 static int __ipmi_bmc_register(struct ipmi_smi *intf,
 			       struct ipmi_device_id *id,
 			       bool guid_set, guid_t *guid, int intf_num)
+	REQUIRES(&intf->bmc_reg_mutex)
 {
 	int               rv;
 	struct bmc_device *bmc;
drivers/char/misc.c +2 -0
index 2cf595d2e10b..50b42514200e 100644
@@ -101,6 +101,7 @@ static void misc_minor_free(int minor)
 
 #ifdef CONFIG_PROC_FS
 static void *misc_seq_start(struct seq_file *seq, loff_t *pos)
+	ACQUIRE(misc_mtx)
 {
 	mutex_lock(&misc_mtx);
 	return seq_list_start(&misc_list, *pos);
@@ -112,6 +113,7 @@ static void *misc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 }
 
 static void misc_seq_stop(struct seq_file *seq, void *v)
+	RELEASE(misc_mtx)
 {
 	mutex_unlock(&misc_mtx);
 }
drivers/char/powernv-op-panel.c +2 -0
index 53467b0a6187..41de1373776f 100644
@@ -113,6 +113,7 @@ static ssize_t oppanel_write(struct file *filp, const char __user *userbuf,
 }
 
 static int oppanel_open(struct inode *inode, struct file *filp)
+	TRY_ACQUIRE(0, oppanel_mutex)
 {
 	if (!mutex_trylock(&oppanel_mutex)) {
 		pr_debug("Device Busy\n");
@@ -122,6 +123,7 @@ static int oppanel_open(struct inode *inode, struct file *filp)
 }
 
 static int oppanel_release(struct inode *inode, struct file *filp)
+	RELEASE(oppanel_mutex)
 {
 	mutex_unlock(&oppanel_mutex);
 	return 0;
drivers/char/tpm/tpm-chip.c +3 -0
index 7df7abaf3e52..16f11bc5dd6c 100644
@@ -155,6 +155,7 @@ EXPORT_SYMBOL_GPL(tpm_chip_stop);
  * Returns -ERRNO if the chip could not be got.
  */
 int tpm_try_get_ops(struct tpm_chip *chip)
+	NO_THREAD_SAFETY_ANALYSIS /* to match tpm_find_get_ops() */
 {
 	int rc = -EIO;
 
@@ -190,6 +191,7 @@ EXPORT_SYMBOL_GPL(tpm_try_get_ops);
  * be kfree'd.
  */
 void tpm_put_ops(struct tpm_chip *chip)
+	NO_THREAD_SAFETY_ANALYSIS /* to match tpm_find_get_ops() */
 {
 	tpm_chip_stop(chip);
 	mutex_unlock(&chip->tpm_mutex);
@@ -241,6 +243,7 @@ EXPORT_SYMBOL_GPL(tpm_default_chip);
  * %NULL if the chip is not available.
  */
 struct tpm_chip *tpm_find_get_ops(struct tpm_chip *chip)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	int rc;
 
drivers/char/xillybus/xillybus_core.c +1 -0
index 11b7c4749274..f4b74cc18dbe 100644
@@ -1425,6 +1425,7 @@ static ssize_t xillybus_write(struct file *filp, const char __user *userbuf,
 }
 
 static int xillybus_open(struct inode *inode, struct file *filp)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int rc;
 	unsigned long flags;
drivers/clk/clk.c +4 -0
index cf7720b9172f..91bed1378287 100644
@@ -143,6 +143,7 @@ static void clk_pm_runtime_put(struct clk_core *core)
  * Return: 0 on success, negative errno otherwise.
  */
 static int clk_pm_runtime_get_all(void)
+	TRY_ACQUIRE(0, clk_rpm_list_lock)
 {
 	int ret;
 	struct clk_core *core, *failed;
@@ -189,6 +190,7 @@ static int clk_pm_runtime_get_all(void)
  * the 'clk_rpm_list_lock'.
  */
 static void clk_pm_runtime_put_all(void)
+	RELEASE(clk_rpm_list_lock)
 {
 	struct clk_core *core;
 
@@ -212,6 +214,7 @@ static void clk_pm_runtime_init(struct clk_core *core)
 
 /***           locking             ***/
 static void clk_prepare_lock(void)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (!mutex_trylock(&prepare_lock)) {
 		if (prepare_owner == current) {
@@ -227,6 +230,7 @@ static void clk_prepare_lock(void)
 }
 
 static void clk_prepare_unlock(void)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	WARN_ON_ONCE(prepare_owner != current);
 	WARN_ON_ONCE(prepare_refcnt == 0);
drivers/comedi/comedi_fops.c +2 -0
index b9df9b19d4bd..6f8b71793815 100644
@@ -3250,6 +3250,7 @@ EXPORT_SYMBOL_GPL(comedi_event);
 
 /* Note: the ->mutex is pre-locked on successful return */
 struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	struct comedi_device *dev;
 	struct device *csdev;
@@ -3370,6 +3371,7 @@ static void comedi_cleanup_board_minors(void)
 }
 
 static int __init comedi_init(void)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int i;
 	int retval;
drivers/comedi/drivers.c +1 -0
index 376130bfba8a..df903728695c 100644
@@ -1031,6 +1031,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  */
 int comedi_auto_config(struct device *hardware_device,
 		       struct comedi_driver *driver, unsigned long context)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct comedi_device *dev;
 	int ret;
drivers/comedi/drivers/usbduxsigma.c +1 -0
index 3f215ae228b2..9e0ed0d82805 100644
@@ -823,6 +823,7 @@ static int usbduxsigma_ao_inttrig(struct comedi_device *dev,
 static int usbduxsigma_ao_cmdtest(struct comedi_device *dev,
 				  struct comedi_subdevice *s,
 				  struct comedi_cmd *cmd)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct usbduxsigma_private *devpriv = dev->private;
 	unsigned int tmp;
drivers/counter/rz-mtu3-cnt.c +3 -0
index e755d54dfece..c2bf846552b2 100644
@@ -124,6 +124,7 @@ static int rz_mtu3_lock_if_counter_is_valid(struct counter_device *counter,
 					    struct rz_mtu3_channel *const ch,
 					    struct rz_mtu3_cnt *const priv,
 					    int id)
+	TRY_ACQUIRE(0, priv->lock)
 {
 	mutex_lock(&priv->lock);
 
@@ -143,6 +144,7 @@ static int rz_mtu3_lock_if_counter_is_valid(struct counter_device *counter,
 static int rz_mtu3_lock_if_count_is_enabled(struct rz_mtu3_channel *const ch,
 					    struct rz_mtu3_cnt *const priv,
 					    int id)
+	TRY_ACQUIRE(0, priv->lock)
 {
 	mutex_lock(&priv->lock);
 
@@ -518,6 +520,7 @@ static int rz_mtu3_count_enable_write(struct counter_device *counter,
 }
 
 static int rz_mtu3_lock_if_ch0_is_enabled(struct rz_mtu3_cnt *const priv)
+	TRY_ACQUIRE(0, priv->lock)
 {
 	mutex_lock(&priv->lock);
 	if (priv->ch->is_busy && !(priv->count_is_enabled[RZ_MTU3_16_BIT_MTU1_CH] ||
drivers/cpuidle/cpuidle.c +2 -0
index 0835da449db8..f0709bad728b 100644
@@ -491,6 +491,7 @@ void cpuidle_uninstall_idle_handler(void)
  * cpuidle_pause_and_lock - temporarily disables CPUIDLE
  */
 void cpuidle_pause_and_lock(void)
+	ACQUIRE(cpuidle_lock)
 {
 	mutex_lock(&cpuidle_lock);
 	cpuidle_uninstall_idle_handler();
@@ -502,6 +503,7 @@ EXPORT_SYMBOL_GPL(cpuidle_pause_and_lock);
  * cpuidle_resume_and_unlock - resumes CPUIDLE operation
  */
 void cpuidle_resume_and_unlock(void)
+	RELEASE(cpuidle_lock)
 {
 	cpuidle_install_idle_handler();
 	mutex_unlock(&cpuidle_lock);
drivers/crypto/exynos-rng.c +1 -0
index 2aaa98f9b44e..2ef178373acb 100644
@@ -170,6 +170,7 @@ static int exynos_rng_get_random(struct exynos_rng_dev *rng,
 
 /* Re-seed itself from time to time */
 static void exynos_rng_reseed(struct exynos_rng_dev *rng)
+	REQUIRES(rng->lock)
 {
 	unsigned long next_seeding = rng->last_seeding + \
 				     msecs_to_jiffies(EXYNOS_RNG_RESEED_TIME);
drivers/crypto/hisilicon/qm.c +4 -0
index d3f5d108b898..97f74525c4ba 100644
@@ -1847,6 +1847,7 @@ static int qm_set_msi_v3(struct hisi_qm *qm, bool set)
 }
 
 static int qm_set_ifc_begin_v3(struct hisi_qm *qm, enum qm_ifc_cmd cmd, u32 data, u32 fun_num)
+	ACQUIRE(qm->mailbox_lock)
 {
 	struct qm_mailbox mailbox;
 	u64 msg;
@@ -1859,6 +1860,7 @@ static int qm_set_ifc_begin_v3(struct hisi_qm *qm, enum qm_ifc_cmd cmd, u32 data
 }
 
 static void qm_set_ifc_end_v3(struct hisi_qm *qm)
+	RELEASE(qm->mailbox_lock)
 {
 	mutex_unlock(&qm->mailbox_lock);
 }
@@ -1881,6 +1883,7 @@ static int qm_get_ifc_v3(struct hisi_qm *qm, enum qm_ifc_cmd *cmd, u32 *data, u3
 }
 
 static int qm_set_ifc_begin_v4(struct hisi_qm *qm, enum qm_ifc_cmd cmd, u32 data, u32 fun_num)
+	ACQUIRE(qm->ifc_lock)
 {
 	uintptr_t offset;
 	u64 msg;
@@ -1899,6 +1902,7 @@ static int qm_set_ifc_begin_v4(struct hisi_qm *qm, enum qm_ifc_cmd cmd, u32 data
 }
 
 static void qm_set_ifc_end_v4(struct hisi_qm *qm)
+	RELEASE(qm->ifc_lock)
 {
 	mutex_unlock(&qm->ifc_lock);
 }
drivers/crypto/intel/qat/qat_common/adf_cfg.c +2 -0
index b0fc453fa3fb..ace8ba088a72 100644
@@ -11,6 +11,7 @@
 static DEFINE_MUTEX(qat_cfg_read_lock);
 
 static void *qat_dev_cfg_start(struct seq_file *sfile, loff_t *pos)
+	ACQUIRE(qat_cfg_read_lock)
 {
 	struct adf_cfg_device_data *dev_cfg = sfile->private;
 
@@ -41,6 +42,7 @@ static void *qat_dev_cfg_next(struct seq_file *sfile, void *v, loff_t *pos)
 }
 
 static void qat_dev_cfg_stop(struct seq_file *sfile, void *v)
+	RELEASE(qat_cfg_read_lock)
 {
 	mutex_unlock(&qat_cfg_read_lock);
 }
drivers/crypto/intel/qat/qat_common/adf_transport_debug.c +4 -0
index e2dd568b87b5..29a5e1cb66be 100644
@@ -11,6 +11,7 @@ static DEFINE_MUTEX(ring_read_lock);
 static DEFINE_MUTEX(bank_read_lock);
 
 static void *adf_ring_start(struct seq_file *sfile, loff_t *pos)
+	ACQUIRE(ring_read_lock)
 {
 	struct adf_etr_ring_data *ring = sfile->private;
 
@@ -74,6 +75,7 @@ static int adf_ring_show(struct seq_file *sfile, void *v)
 }
 
 static void adf_ring_stop(struct seq_file *sfile, void *v)
+	RELEASE(ring_read_lock)
 {
 	mutex_unlock(&ring_read_lock);
 }
@@ -117,6 +119,7 @@ void adf_ring_debugfs_rm(struct adf_etr_ring_data *ring)
 }
 
 static void *adf_bank_start(struct seq_file *sfile, loff_t *pos)
+	ACQUIRE(bank_read_lock)
 {
 	struct adf_etr_bank_data *bank = sfile->private;
 	u8 num_rings_per_bank = GET_NUM_RINGS_PER_BANK(bank->accel_dev);
@@ -175,6 +178,7 @@ static int adf_bank_show(struct seq_file *sfile, void *v)
 }
 
 static void adf_bank_stop(struct seq_file *sfile, void *v)
+	RELEASE(bank_read_lock)
 {
 	mutex_unlock(&bank_read_lock);
 }
drivers/cxl/core/port.c +2 -0
index 78a5c2c25982..3eb0cd094b30 100644
@@ -1082,12 +1082,14 @@ static int add_dport(struct cxl_port *port, struct cxl_dport *dport)
  * port lock in that case.
  */
 static void cond_cxl_root_lock(struct cxl_port *port)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (is_cxl_root(port))
 		device_lock(&port->dev);
 }
 
 static void cond_cxl_root_unlock(struct cxl_port *port)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (is_cxl_root(port))
 		device_unlock(&port->dev);
drivers/devfreq/devfreq.c +1 -0
index 98657d3b9435..63c7dd7d8fa8 100644
@@ -290,6 +290,7 @@ static struct devfreq_governor *find_devfreq_governor(const char *name)
  * governor's pointer or an error pointer.
  */
 static struct devfreq_governor *try_then_request_governor(const char *name)
+	REQUIRES(devfreq_list_lock)
 {
 	struct devfreq_governor *governor;
 	int err = 0;
drivers/dpll/dpll_netlink.c +6 -0
index c130f87147fa..73753b113883 100644
@@ -1575,6 +1575,7 @@ int dpll_nl_device_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
 
 int dpll_pre_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 		  struct genl_info *info)
+	TRY_ACQUIRE(0, dpll_lock)
 {
 	u32 id;
 
@@ -1596,6 +1597,7 @@ int dpll_pre_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 
 void dpll_post_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 		    struct genl_info *info)
+	RELEASE(dpll_lock)
 {
 	mutex_unlock(&dpll_lock);
 }
@@ -1603,6 +1605,7 @@ void dpll_post_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 int
 dpll_lock_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 	       struct genl_info *info)
+	ACQUIRE(dpll_lock)
 {
 	mutex_lock(&dpll_lock);
 
@@ -1612,12 +1615,14 @@ dpll_lock_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 void
 dpll_unlock_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 		 struct genl_info *info)
+	RELEASE(dpll_lock)
 {
 	mutex_unlock(&dpll_lock);
 }
 
 int dpll_pin_pre_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 		      struct genl_info *info)
+	TRY_ACQUIRE(0, dpll_lock)
 {
 	int ret;
 
@@ -1644,6 +1649,7 @@ int dpll_pin_pre_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 
 void dpll_pin_post_doit(const struct genl_split_ops *ops, struct sk_buff *skb,
 			struct genl_info *info)
+	RELEASE(dpll_lock)
 {
 	mutex_unlock(&dpll_lock);
 }
drivers/firmware/arm_ffa/driver.c +1 -0
index 2c2ec3c35f15..5a39f156ba48 100644
@@ -689,6 +689,7 @@ ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize,
 }
 
 static int ffa_memory_ops(u32 func_id, struct ffa_mem_ops_args *args)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int ret;
 	void *buffer;
drivers/firmware/arm_scmi/notify.c +1 -0
index e160ecb22948..d185bd5b43d7 100644
@@ -1264,6 +1264,7 @@ static bool scmi_put_handler_unlocked(struct scmi_notify_instance *ni,
 
 static void scmi_put_handler(struct scmi_notify_instance *ni,
 			     struct scmi_event_handler *hndl)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	bool freed;
 	u8 protocol_id;
drivers/firmware/arm_scmi/transports/mailbox.c +2 -0
index bd041c99b92b..f7dab8c47d14 100644
@@ -270,6 +270,7 @@ static int mailbox_chan_free(int id, void *p, void *data)
 
 static int mailbox_send_message(struct scmi_chan_info *cinfo,
 				struct scmi_xfer *xfer)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct scmi_mailbox *smbox = cinfo->transport_info;
 	int ret;
@@ -295,6 +296,7 @@ static int mailbox_send_message(struct scmi_chan_info *cinfo,
 
 static void mailbox_mark_txdone(struct scmi_chan_info *cinfo, int ret,
 				struct scmi_xfer *__unused)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct scmi_mailbox *smbox = cinfo->transport_info;
 
drivers/firmware/arm_scmi/transports/optee.c +2 -0
index 3949a877e17d..14530817bf0a 100644
@@ -455,6 +455,7 @@ static int scmi_optee_chan_free(int id, void *p, void *data)
 
 static int scmi_optee_send_message(struct scmi_chan_info *cinfo,
 				   struct scmi_xfer *xfer)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct scmi_optee_channel *channel = cinfo->transport_info;
 	int ret;
@@ -492,6 +493,7 @@ static void scmi_optee_fetch_response(struct scmi_chan_info *cinfo,
 
 static void scmi_optee_mark_txdone(struct scmi_chan_info *cinfo, int ret,
 				   struct scmi_xfer *__unused)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct scmi_optee_channel *channel = cinfo->transport_info;
 
drivers/firmware/qcom/qcom_qseecom_uefisecapp.c +2 -0
index 447246bd04be..2aa3da8e4dc2 100644
@@ -713,6 +713,7 @@ static int qcuefi_set_reference(struct qcuefi_client *qcuefi)
 }
 
 static struct qcuefi_client *qcuefi_acquire(void)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	mutex_lock(&__qcuefi_lock);
 	if (!__qcuefi) {
@@ -723,6 +724,7 @@ static struct qcuefi_client *qcuefi_acquire(void)
 }
 
 static void qcuefi_release(void)
+	NO_THREAD_SAFETY_ANALYSIS /* to match qcuefi_acquire() */
 {
 	mutex_unlock(&__qcuefi_lock);
 }
drivers/fpga/fpga-bridge.c +2 -0
index 8ef395b49bf8..72e141f45bb5 100644
@@ -57,6 +57,7 @@ EXPORT_SYMBOL_GPL(fpga_bridge_disable);
 
 static struct fpga_bridge *__fpga_bridge_get(struct device *bridge_dev,
 					     struct fpga_image_info *info)
+	NO_THREAD_SAFETY_ANALYSIS /* TRY_ACQUIRE() does not support pointers */
 {
 	struct fpga_bridge *bridge;
 
@@ -211,6 +212,7 @@ EXPORT_SYMBOL_GPL(fpga_bridges_disable);
  * If list is empty, do nothing.
  */
 void fpga_bridges_put(struct list_head *bridge_list)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex operation inside a loop */
 {
 	struct fpga_bridge *bridge, *next;
 	unsigned long flags;
drivers/fpga/fpga-region.c +3 -0
index 753cd142503e..a88bd7033380 100644
@@ -44,6 +44,7 @@ EXPORT_SYMBOL_GPL(fpga_region_class_find);
  * * -ENODEV if can't take parent driver module refcount.
  */
 static struct fpga_region *fpga_region_get(struct fpga_region *region)
+	NO_THREAD_SAFETY_ANALYSIS /* TRY_ACQUIRE() does not support pointers */
 {
 	struct device *dev = &region->dev;
 
@@ -70,6 +71,7 @@ static struct fpga_region *fpga_region_get(struct fpga_region *region)
  * @region: FPGA region
  */
 static void fpga_region_put(struct fpga_region *region)
+	RELEASE(region->mutex)
 {
 	struct device *dev = &region->dev;
 
@@ -95,6 +97,7 @@ static void fpga_region_put(struct fpga_region *region)
  * Return: 0 for success or negative error code.
  */
 int fpga_region_program_fpga(struct fpga_region *region)
+	NO_THREAD_SAFETY_ANALYSIS /* TRY_ACQUIRE() does not support pointers */
 {
 	struct device *dev = &region->dev;
 	struct fpga_image_info *info = region->info;
drivers/gpio/gpio-adnp.c +2 -0
index 6dafab0cf964..22adcfd4ddbb 100644
@@ -352,6 +352,7 @@ static int adnp_irq_set_type(struct irq_data *d, unsigned int type)
 }
 
 static void adnp_irq_bus_lock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct adnp *adnp = gpiochip_get_data(gc);
@@ -360,6 +361,7 @@ static void adnp_irq_bus_lock(struct irq_data *d)
 }
 
 static void adnp_irq_bus_unlock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct adnp *adnp = gpiochip_get_data(gc);
drivers/gpio/gpio-crystalcove.c +2 -0
index 25db014494a4..7956040ee838 100644
@@ -212,6 +212,7 @@ static int crystalcove_irq_type(struct irq_data *data, unsigned int type)
 }
 
 static void crystalcove_bus_lock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct crystalcove_gpio *cg = gpiochip_get_data(irq_data_get_irq_chip_data(data));
 
@@ -219,6 +220,7 @@ static void crystalcove_bus_lock(struct irq_data *data)
 }
 
 static void crystalcove_bus_sync_unlock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct crystalcove_gpio *cg = gpiochip_get_data(irq_data_get_irq_chip_data(data));
 	irq_hw_number_t hwirq = irqd_to_hwirq(data);
drivers/gpio/gpio-dln2.c +2 -0
index 596da59d4b13..ef29d3a1df10 100644
@@ -349,6 +349,7 @@ static int dln2_irq_set_type(struct irq_data *irqd, unsigned type)
 }
 
 static void dln2_irq_bus_lock(struct irq_data *irqd)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd);
 	struct dln2_gpio *dln2 = gpiochip_get_data(gc);
@@ -357,6 +358,7 @@ static void dln2_irq_bus_lock(struct irq_data *irqd)
 }
 
 static void dln2_irq_bus_unlock(struct irq_data *irqd)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd);
 	struct dln2_gpio *dln2 = gpiochip_get_data(gc);
drivers/gpio/gpio-ljca.c +2 -0
index 817ecb12d550..65d7a9731259 100644
@@ -357,6 +357,7 @@ static int ljca_irq_set_type(struct irq_data *irqd, unsigned int type)
 }
 
 static void ljca_irq_bus_lock(struct irq_data *irqd)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd);
 	struct ljca_gpio_dev *ljca_gpio = gpiochip_get_data(gc);
@@ -365,6 +366,7 @@ static void ljca_irq_bus_lock(struct irq_data *irqd)
 }
 
 static void ljca_irq_bus_unlock(struct irq_data *irqd)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(irqd);
 	struct ljca_gpio_dev *ljca_gpio = gpiochip_get_data(gc);
drivers/gpio/gpio-max77620.c +2 -0
index 8c2a5609161f..0fc01929cd11 100644
@@ -96,6 +96,7 @@ static int max77620_gpio_set_irq_type(struct irq_data *data, unsigned int type)
 }
 
 static void max77620_gpio_bus_lock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
 	struct max77620_gpio *gpio = gpiochip_get_data(chip);
@@ -104,6 +105,7 @@ static void max77620_gpio_bus_lock(struct irq_data *data)
 }
 
 static void max77620_gpio_bus_sync_unlock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
 	struct max77620_gpio *gpio = gpiochip_get_data(chip);
drivers/gpio/gpio-mlxbf2.c +2 -0
index 5ae07367955f..58c19b62b5ce 100644
@@ -128,6 +128,7 @@ static int mlxbf2_gpio_get_lock_res(struct platform_device *pdev)
  * mode. If the lock_active bit is already set, return an error.
  */
 static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
+	TRY_ACQUIRE(0, yu_arm_gpio_lock_param.lock)
 {
 	u32 arm_gpio_lock_val;
 
@@ -156,6 +157,7 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
 static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs)
 	__releases(&gs->gc.bgpio_lock)
 	__releases(yu_arm_gpio_lock_param.lock)
+	RELEASE(yu_arm_gpio_lock_param.lock)
 {
 	writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io);
 	raw_spin_unlock(&gs->gc.bgpio_lock);
drivers/gpio/gpio-pca953x.c +2 -0
index be4c9981ebc4..971269357a25 100644
@@ -742,6 +742,7 @@ static int pca953x_irq_set_wake(struct irq_data *d, unsigned int on)
 }
 
 static void pca953x_irq_bus_lock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct pca953x_chip *chip = gpiochip_get_data(gc);
@@ -750,6 +751,7 @@ static void pca953x_irq_bus_lock(struct irq_data *d)
 }
 
 static void pca953x_irq_bus_sync_unlock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct pca953x_chip *chip = gpiochip_get_data(gc);
drivers/gpio/gpio-pcf857x.c +2 -0
index 7c57eaeb0afe..a7beb36aabfa 100644
@@ -241,6 +241,7 @@ static void pcf857x_irq_disable(struct irq_data *data)
 }
 
 static void pcf857x_irq_bus_lock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct pcf857x *gpio = irq_data_get_irq_chip_data(data);
 
@@ -248,6 +249,7 @@ static void pcf857x_irq_bus_lock(struct irq_data *data)
 }
 
 static void pcf857x_irq_bus_sync_unlock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct pcf857x *gpio = irq_data_get_irq_chip_data(data);
 
drivers/gpio/gpio-pmic-eic-sprd.c +2 -0
index d9b228bea42e..3997e8fe50de 100644
@@ -199,6 +199,7 @@ static int sprd_pmic_eic_irq_set_type(struct irq_data *data,
 }
 
 static void sprd_pmic_eic_bus_lock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
 	struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip);
@@ -207,6 +208,7 @@ static void sprd_pmic_eic_bus_lock(struct irq_data *data)
 }
 
 static void sprd_pmic_eic_bus_sync_unlock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
 	struct sprd_pmic_eic *pmic_eic = gpiochip_get_data(chip);
drivers/gpio/gpio-stmpe.c +2 -0
index 75a3633ceddb..68b3fb008d7c 100644
@@ -167,6 +167,7 @@ static int stmpe_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 }
 
 static void stmpe_gpio_irq_lock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct stmpe_gpio *stmpe_gpio = gpiochip_get_data(gc);
@@ -175,6 +176,7 @@ static void stmpe_gpio_irq_lock(struct irq_data *d)
 }
 
 static void stmpe_gpio_irq_sync_unlock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct stmpe_gpio *stmpe_gpio = gpiochip_get_data(gc);
drivers/gpio/gpio-tc3589x.c +2 -0
index e62ee7e56908..043a48d6a3ac 100644
@@ -183,6 +183,7 @@ static int tc3589x_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 }
 
 static void tc3589x_gpio_irq_lock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct tc3589x_gpio *tc3589x_gpio = gpiochip_get_data(gc);
@@ -191,6 +192,7 @@ static void tc3589x_gpio_irq_lock(struct irq_data *d)
 }
 
 static void tc3589x_gpio_irq_sync_unlock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct tc3589x_gpio *tc3589x_gpio = gpiochip_get_data(gc);
drivers/gpio/gpio-virtio.c +2 -0
index 93544ff62513..819d6e6e8641 100644
@@ -318,6 +318,7 @@ static int virtio_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 }
 
 static void virtio_gpio_irq_bus_lock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct virtio_gpio *vgpio = gpiochip_get_data(gc);
@@ -326,6 +327,7 @@ static void virtio_gpio_irq_bus_lock(struct irq_data *d)
 }
 
 static void virtio_gpio_irq_bus_sync_unlock(struct irq_data *d)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 	struct virtio_gpio *vgpio = gpiochip_get_data(gc);
drivers/gpio/gpio-wcove.c +2 -0
index 94ca9d03c094..29bc5f73c686 100644
@@ -268,6 +268,7 @@ static int wcove_irq_type(struct irq_data *data, unsigned int type)
 }
 
 static void wcove_bus_lock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
 	struct wcove_gpio *wg = gpiochip_get_data(chip);
@@ -276,6 +277,7 @@ static void wcove_bus_lock(struct irq_data *data)
 }
 
 static void wcove_bus_sync_unlock(struct irq_data *data)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
 	struct wcove_gpio *wg = gpiochip_get_data(chip);
drivers/gpu/drm/amd/amdgpu/aldebaran.c +1 -0
index e13fbd974141..be3e11c4559a 100644
@@ -136,6 +136,7 @@ static int aldebaran_mode2_reset(struct amdgpu_device *adev)
 static int
 aldebaran_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
 			      struct amdgpu_reset_context *reset_context)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex operation inside a loop */
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)reset_ctl->handle;
 	struct list_head *reset_device_list = reset_context->reset_device_list;
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10.c +4 -0
index 62176d607bef..58e1fb5cddda 100644
@@ -43,12 +43,14 @@ enum hqd_dequeue_request_type {
 
 static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 			uint32_t queue, uint32_t vmid)
+	ACQUIRE(adev->srbm_mutex)
 {
 	mutex_lock(&adev->srbm_mutex);
 	nv_grbm_select(adev, mec, pipe, queue, vmid);
 }
 
 static void unlock_srbm(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	nv_grbm_select(adev, 0, 0, 0, 0);
 	mutex_unlock(&adev->srbm_mutex);
@@ -56,6 +58,7 @@ static void unlock_srbm(struct amdgpu_device *adev)
 
 static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 				uint32_t queue_id)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t mec = (pipe_id / adev->gfx.mec.num_pipe_per_mec) + 1;
 	uint32_t pipe = (pipe_id % adev->gfx.mec.num_pipe_per_mec);
@@ -73,6 +76,7 @@ static uint64_t get_queue_mask(struct amdgpu_device *adev,
 }
 
 static void release_queue(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	unlock_srbm(adev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c +4 -0
index c718bedda0ca..301f3824de0b 100644
@@ -43,12 +43,14 @@ enum hqd_dequeue_request_type {
 
 static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 			uint32_t queue, uint32_t vmid)
+	ACQUIRE(adev->srbm_mutex)
 {
 	mutex_lock(&adev->srbm_mutex);
 	nv_grbm_select(adev, mec, pipe, queue, vmid);
 }
 
 static void unlock_srbm(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	nv_grbm_select(adev, 0, 0, 0, 0);
 	mutex_unlock(&adev->srbm_mutex);
@@ -56,6 +58,7 @@ static void unlock_srbm(struct amdgpu_device *adev)
 
 static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 				uint32_t queue_id)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t mec = (pipe_id / adev->gfx.mec.num_pipe_per_mec) + 1;
 	uint32_t pipe = (pipe_id % adev->gfx.mec.num_pipe_per_mec);
@@ -73,6 +76,7 @@ static uint64_t get_queue_mask(struct amdgpu_device *adev,
 }
 
 static void release_queue(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	unlock_srbm(adev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c +4 -0
index a4ba49cb22db..4a8bf1d18d8f 100644
@@ -41,12 +41,14 @@ enum hqd_dequeue_request_type {
 
 static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 			uint32_t queue, uint32_t vmid)
+	ACQUIRE(adev->srbm_mutex)
 {
 	mutex_lock(&adev->srbm_mutex);
 	soc21_grbm_select(adev, mec, pipe, queue, vmid);
 }
 
 static void unlock_srbm(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	soc21_grbm_select(adev, 0, 0, 0, 0);
 	mutex_unlock(&adev->srbm_mutex);
@@ -54,6 +56,7 @@ static void unlock_srbm(struct amdgpu_device *adev)
 
 static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 				uint32_t queue_id)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t mec = (pipe_id / adev->gfx.mec.num_pipe_per_mec) + 1;
 	uint32_t pipe = (pipe_id % adev->gfx.mec.num_pipe_per_mec);
@@ -71,6 +74,7 @@ static uint64_t get_queue_mask(struct amdgpu_device *adev,
 }
 
 static void release_queue(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	unlock_srbm(adev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v12.c +4 -0
index 0dfe7093bd8a..5f9caf05c57a 100644
@@ -29,12 +29,14 @@
 
 static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 			uint32_t queue, uint32_t vmid)
+	ACQUIRE(adev->srbm_mutex)
 {
 	mutex_lock(&adev->srbm_mutex);
 	soc24_grbm_select(adev, mec, pipe, queue, vmid);
 }
 
 static void unlock_srbm(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	soc24_grbm_select(adev, 0, 0, 0, 0);
 	mutex_unlock(&adev->srbm_mutex);
@@ -42,6 +44,7 @@ static void unlock_srbm(struct amdgpu_device *adev)
 
 static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 				uint32_t queue_id)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t mec = (pipe_id / adev->gfx.mec.num_pipe_per_mec) + 1;
 	uint32_t pipe = (pipe_id % adev->gfx.mec.num_pipe_per_mec);
@@ -50,6 +53,7 @@ static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 }
 
 static void release_queue(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	unlock_srbm(adev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c +4 -0
index ca4a6b82817f..68ae301f1efd 100644
@@ -47,6 +47,7 @@ enum {
 
 static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 			uint32_t queue, uint32_t vmid)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t value = PIPEID(pipe) | MEID(mec) | VMID(vmid) | QUEUEID(queue);
 
@@ -55,6 +56,7 @@ static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 }
 
 static void unlock_srbm(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	WREG32(mmSRBM_GFX_CNTL, 0);
 	mutex_unlock(&adev->srbm_mutex);
@@ -62,6 +64,7 @@ static void unlock_srbm(struct amdgpu_device *adev)
 
 static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 				uint32_t queue_id)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t mec = (pipe_id / adev->gfx.mec.num_pipe_per_mec) + 1;
 	uint32_t pipe = (pipe_id % adev->gfx.mec.num_pipe_per_mec);
@@ -70,6 +73,7 @@ static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 }
 
 static void release_queue(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	unlock_srbm(adev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c +4 -0
index 0f3e2944edd7..f041c3db8915 100644
@@ -41,6 +41,7 @@ enum hqd_dequeue_request_type {
 
 static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 			uint32_t queue, uint32_t vmid)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t value = PIPEID(pipe) | MEID(mec) | VMID(vmid) | QUEUEID(queue);
 
@@ -49,6 +50,7 @@ static void lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 }
 
 static void unlock_srbm(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	WREG32(mmSRBM_GFX_CNTL, 0);
 	mutex_unlock(&adev->srbm_mutex);
@@ -56,6 +58,7 @@ static void unlock_srbm(struct amdgpu_device *adev)
 
 static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 				uint32_t queue_id)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t mec = (pipe_id / adev->gfx.mec.num_pipe_per_mec) + 1;
 	uint32_t pipe = (pipe_id % adev->gfx.mec.num_pipe_per_mec);
@@ -64,6 +67,7 @@ static void acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 }
 
 static void release_queue(struct amdgpu_device *adev)
+	RELEASE(adev->srbm_mutex)
 {
 	unlock_srbm(adev);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c +8 -0
index 441568163e20..298bc6c51076 100644
@@ -49,12 +49,14 @@ enum hqd_dequeue_request_type {
 
 static void kgd_gfx_v9_lock_srbm(struct amdgpu_device *adev, uint32_t mec, uint32_t pipe,
 			uint32_t queue, uint32_t vmid, uint32_t inst)
+	ACQUIRE(adev->srbm_mutex)
 {
 	mutex_lock(&adev->srbm_mutex);
 	soc15_grbm_select(adev, mec, pipe, queue, vmid, GET_INST(GC, inst));
 }
 
 static void kgd_gfx_v9_unlock_srbm(struct amdgpu_device *adev, uint32_t inst)
+	RELEASE(adev->srbm_mutex)
 {
 	soc15_grbm_select(adev, 0, 0, 0, 0, GET_INST(GC, inst));
 	mutex_unlock(&adev->srbm_mutex);
@@ -62,6 +64,7 @@ static void kgd_gfx_v9_unlock_srbm(struct amdgpu_device *adev, uint32_t inst)
 
 void kgd_gfx_v9_acquire_queue(struct amdgpu_device *adev, uint32_t pipe_id,
 				uint32_t queue_id, uint32_t inst)
+	ACQUIRE(adev->srbm_mutex)
 {
 	uint32_t mec = (pipe_id / adev->gfx.mec.num_pipe_per_mec) + 1;
 	uint32_t pipe = (pipe_id % adev->gfx.mec.num_pipe_per_mec);
@@ -79,6 +82,7 @@ uint64_t kgd_gfx_v9_get_queue_mask(struct amdgpu_device *adev,
 }
 
 void kgd_gfx_v9_release_queue(struct amdgpu_device *adev, uint32_t inst)
+	RELEASE(adev->srbm_mutex)
 {
 	kgd_gfx_v9_unlock_srbm(adev, inst);
 }
@@ -925,6 +929,8 @@ void kgd_gfx_v9_set_vm_context_page_table_base(struct amdgpu_device *adev,
 }
 
 static void lock_spi_csq_mutexes(struct amdgpu_device *adev)
+	ACQUIRE(adev->srbm_mutex)
+	ACQUIRE(adev->grbm_idx_mutex)
 {
 	mutex_lock(&adev->srbm_mutex);
 	mutex_lock(&adev->grbm_idx_mutex);
@@ -932,6 +938,8 @@ static void lock_spi_csq_mutexes(struct amdgpu_device *adev)
 }
 
 static void unlock_spi_csq_mutexes(struct amdgpu_device *adev)
+	RELEASE(adev->grbm_idx_mutex)
+	RELEASE(adev->srbm_mutex)
 {
 	mutex_unlock(&adev->grbm_idx_mutex);
 	mutex_unlock(&adev->srbm_mutex);
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -0
index 5cc5f59e3018..3344cccfe2ec 100644
@@ -837,6 +837,7 @@ static int amdgpu_cs_bo_validate(void *param, struct amdgpu_bo *bo)
 
 static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
 				union drm_amdgpu_cs *cs)
+	TRY_ACQUIRE(0, p->bo_list->bo_list_mutex)
 {
 	struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
 	struct ttm_operation_ctx ctx = { true, false };
@@ -1275,6 +1276,7 @@ static void amdgpu_cs_post_dependencies(struct amdgpu_cs_parser *p)
 
 static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,
 			    union drm_amdgpu_cs *cs)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional unlock */
 {
 	struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
 	struct amdgpu_job *leader = p->gang_leader;
@@ -1408,6 +1410,7 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser)
 }
 
 int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional unlock */
 {
 	struct amdgpu_device *adev = drm_to_adev(dev);
 	struct amdgpu_cs_parser parser;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2 -0
index 49ca8c814455..6af868b801b8 100644
@@ -71,6 +71,7 @@
  */
 static int  amdgpu_debugfs_process_reg_op(bool read, struct file *f,
 		char __user *buf, size_t size, loff_t *pos)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct amdgpu_device *adev = file_inode(f)->i_private;
 	ssize_t result = 0;
@@ -228,6 +229,7 @@ static int amdgpu_debugfs_regs2_release(struct inode *inode, struct file *file)
 }
 
 static ssize_t amdgpu_debugfs_regs2_op(struct file *f, char __user *buf, u32 offset, size_t size, int write_en)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct amdgpu_debugfs_regs2_data *rd = f->private_data;
 	struct amdgpu_device *adev = rd->adev;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -0
index d100bb7a137c..da1629efb322 100644
@@ -5854,6 +5854,7 @@ static int amdgpu_device_health_check(struct list_head *device_list_handle)
 int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
 			      struct amdgpu_job *job,
 			      struct amdgpu_reset_context *reset_context)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct list_head device_list, *device_list_handle =  NULL;
 	bool job_signaled = false;
drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c +2 -0
index f0765ccde668..351d8cab8428 100644
@@ -38,6 +38,7 @@
 
 /* bit banging i2c */
 static int amdgpu_i2c_pre_xfer(struct i2c_adapter *i2c_adap)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct amdgpu_i2c_chan *i2c = i2c_get_adapdata(i2c_adap);
 	struct amdgpu_device *adev = drm_to_adev(i2c->dev);
@@ -80,6 +81,7 @@ static int amdgpu_i2c_pre_xfer(struct i2c_adapter *i2c_adap)
 }
 
 static void amdgpu_i2c_post_xfer(struct i2c_adapter *i2c_adap)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct amdgpu_i2c_chan *i2c = i2c_get_adapdata(i2c_adap);
 	struct amdgpu_device *adev = drm_to_adev(i2c->dev);
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +1 -0
index 100f04475943..31cc917f1651 100644
@@ -50,6 +50,7 @@ static void amdgpu_job_do_core_dump(struct amdgpu_device *adev,
 
 static void amdgpu_job_core_dump(struct amdgpu_device *adev,
 				 struct amdgpu_job *job)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct list_head device_list, *device_list_handle =  NULL;
 	struct amdgpu_device *tmp_adev = NULL;
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -0
index 32b27a1658e7..1e31bba6d4bd 100644
@@ -566,6 +566,7 @@ static int amdgpu_mes_queue_alloc_mqd(struct amdgpu_device *adev,
 static void amdgpu_mes_queue_init_mqd(struct amdgpu_device *adev,
 				     struct amdgpu_mes_queue *q,
 				     struct amdgpu_mes_queue_properties *p)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct amdgpu_mqd *mqd_mgr = &adev->mqds[p->queue_type];
 	struct amdgpu_mqd_prop mqd_prop = {0};
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h +2 -0
index 2df2444ee892..28db12612729 100644
@@ -521,12 +521,14 @@ int amdgpu_mes_doorbell_process_slice(struct amdgpu_device *adev);
  * to prevent deadlocks when an MMU notifier runs in reclaim-FS context.
  */
 static inline void amdgpu_mes_lock(struct amdgpu_mes *mes)
+	ACQUIRE(mes->mutex_hidden)
 {
 	mutex_lock(&mes->mutex_hidden);
 	mes->saved_flags = memalloc_noreclaim_save();
 }
 
 static inline void amdgpu_mes_unlock(struct amdgpu_mes *mes)
+	RELEASE(mes->mutex_hidden)
 {
 	memalloc_noreclaim_restore(mes->saved_flags);
 	mutex_unlock(&mes->mutex_hidden);
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +2 -0
index babe94ade247..ad2cd4d7b8bd 100644
@@ -748,6 +748,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
 }
 
 static struct psp_gfx_cmd_resp *acquire_psp_cmd_buf(struct psp_context *psp)
+	ACQUIRE(psp->mutex)
 {
 	struct psp_gfx_cmd_resp *cmd = psp->cmd;
 
@@ -759,6 +760,7 @@ static struct psp_gfx_cmd_resp *acquire_psp_cmd_buf(struct psp_context *psp)
 }
 
 static void release_psp_cmd_buf(struct psp_context *psp)
+	RELEASE(psp->mutex)
 {
 	mutex_unlock(&psp->mutex);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c +1 -0
index dabfbdf6f1ce..0ba474497e5f 100644
@@ -99,6 +99,7 @@ static int amdgpu_reset_xgmi_reset_on_init_restore_hwctxt(
 static int amdgpu_reset_xgmi_reset_on_init_perform_reset(
 	struct amdgpu_reset_control *reset_ctl,
 	struct amdgpu_reset_context *reset_context)
+	NO_THREAD_SAFETY_ANALYSIS /* locking inside a loop */
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)reset_ctl->handle;
 	struct list_head *reset_device_list = reset_context->reset_device_list;
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h +2 -0
index 2c771a753778..4d189e780659 100644
@@ -232,11 +232,13 @@ void amdgpu_umsch_fwlog_init(struct amdgpu_umsch_mm *umsch_mm);
 	((umsch)->funcs->ring_fini ? (umsch)->funcs->ring_fini((umsch)) : 0)
 
 static inline void amdgpu_umsch_mm_lock(struct amdgpu_umsch_mm *umsch)
+	ACQUIRE(umsch->mutex_hidden)
 {
 	mutex_lock(&umsch->mutex_hidden);
 }
 
 static inline void amdgpu_umsch_mm_unlock(struct amdgpu_umsch_mm *umsch)
+	RELEASE(umsch->mutex_hidden)
 {
 	mutex_unlock(&umsch->mutex_hidden);
 }
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -0
index 5c07777d3239..98b122efacbb 100644
@@ -2184,6 +2184,7 @@ void amdgpu_vm_bo_del(struct amdgpu_device *adev,
  * Check if it is possible to evict a VM.
  */
 bool amdgpu_vm_evictable(struct amdgpu_bo *bo)
+	NO_THREAD_SAFETY_ANALYSIS /* clang bug? */
 {
 	struct amdgpu_vm_bo_base *bo_base = bo->vm_bo;
 
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +3 -0
index a3e128e373bc..3966be013968 100644
@@ -644,12 +644,14 @@ static inline uint64_t amdgpu_vm_tlb_seq(struct amdgpu_vm *vm)
  * an MMU notifier runs in reclaim-FS context.
  */
 static inline void amdgpu_vm_eviction_lock(struct amdgpu_vm *vm)
+	ACQUIRE(vm->eviction_lock)
 {
 	mutex_lock(&vm->eviction_lock);
 	vm->saved_flags = memalloc_noreclaim_save();
 }
 
 static inline bool amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
+	TRY_ACQUIRE(true, vm->eviction_lock)
 {
 	if (mutex_trylock(&vm->eviction_lock)) {
 		vm->saved_flags = memalloc_noreclaim_save();
@@ -659,6 +661,7 @@ static inline bool amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
 }
 
 static inline void amdgpu_vm_eviction_unlock(struct amdgpu_vm *vm)
+	RELEASE(vm->eviction_lock)
 {
 	memalloc_noreclaim_restore(vm->saved_flags);
 	mutex_unlock(&vm->eviction_lock);
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +2 -0
index b0bf21682115..35874fd9c982 100644
@@ -494,6 +494,7 @@ static int amdgpu_vm_pt_alloc(struct amdgpu_device *adev,
 			      struct amdgpu_vm *vm,
 			      struct amdgpu_vm_pt_cursor *cursor,
 			      bool immediate)
+	REQUIRES(vm->eviction_lock)
 {
 	struct amdgpu_vm_bo_base *entry = cursor->entry;
 	struct amdgpu_bo *pt_bo;
@@ -820,6 +821,7 @@ static void amdgpu_vm_pte_fragment(struct amdgpu_vm_update_params *params,
 int amdgpu_vm_ptes_update(struct amdgpu_vm_update_params *params,
 			  uint64_t start, uint64_t end,
 			  uint64_t dst, uint64_t flags)
+	REQUIRES(params->vm->eviction_lock)
 {
 	struct amdgpu_device *adev = params->adev;
 	struct amdgpu_vm_pt_cursor cursor;
drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +1 -0
index 23b6f7a4aa4a..2e67e08f8c82 100644
@@ -216,6 +216,7 @@ int amdgpu_xcp_restore_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr)
 }
 
 int amdgpu_xcp_query_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr, u32 flags)
+	NO_THREAD_SAFETY_ANALYSIS /* conditinal locking */
 {
 	int mode;
 
drivers/gpu/drm/amd/amdgpu/jpeg_v1_0.c +2 -1
index 03b8b7cd5229..4e66723d18cd 100644
@@ -602,12 +602,13 @@ static void jpeg_v1_0_set_irq_funcs(struct amdgpu_device *adev)
 }
 
 static void jpeg_v1_0_ring_begin_use(struct amdgpu_ring *ring)
+	ACQUIRE(ring->adev->vcn.vcn1_jpeg1_workaround)
 {
 	struct	amdgpu_device *adev = ring->adev;
 	bool	set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work);
 	int		cnt = 0;
 
-	mutex_lock(&adev->vcn.vcn1_jpeg1_workaround);
+	mutex_lock(&ring->adev->vcn.vcn1_jpeg1_workaround);
 
 	if (amdgpu_fence_wait_empty(&adev->vcn.inst->ring_dec))
 		DRM_ERROR("JPEG dec: vcn dec ring may not be empty\n");
drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c +2 -0
index dd2d66090d23..8b3d4f0302a9 100644
@@ -607,6 +607,7 @@ static uint32_t smu_v11_0_i2c_write_data(struct i2c_adapter *control,
 }
 
 static void lock_bus(struct i2c_adapter *i2c, unsigned int flags)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct amdgpu_smu_i2c_bus *smu_i2c = i2c_get_adapdata(i2c);
 	struct amdgpu_device *adev = smu_i2c->adev;
@@ -625,6 +626,7 @@ static int trylock_bus(struct i2c_adapter *i2c, unsigned int flags)
 }
 
 static void unlock_bus(struct i2c_adapter *i2c, unsigned int flags)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct amdgpu_smu_i2c_bus *smu_i2c = i2c_get_adapdata(i2c);
 	struct amdgpu_device *adev = smu_i2c->adev;
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +3 -1
index 5ea96c983517..b77a19577502 100644
@@ -1867,11 +1867,12 @@ static void vcn_v1_0_idle_work_handler(struct work_struct *work)
 }
 
 static void vcn_v1_0_ring_begin_use(struct amdgpu_ring *ring)
+	ACQUIRE(ring->adev->vcn.vcn1_jpeg1_workaround)
 {
 	struct	amdgpu_device *adev = ring->adev;
 	bool set_clocks = !cancel_delayed_work_sync(&adev->vcn.idle_work);
 
-	mutex_lock(&adev->vcn.vcn1_jpeg1_workaround);
+	mutex_lock(&ring->adev->vcn.vcn1_jpeg1_workaround);
 
 	if (amdgpu_fence_wait_empty(ring->adev->jpeg.inst->ring_dec))
 		DRM_ERROR("VCN dec: jpeg dec ring may not be empty\n");
@@ -1920,6 +1921,7 @@ void vcn_v1_0_set_pg_for_begin_use(struct amdgpu_ring *ring, bool set_clocks)
 }
 
 void vcn_v1_0_ring_end_use(struct amdgpu_ring *ring)
+	RELEASE(ring->adev->vcn.vcn1_jpeg1_workaround)
 {
 	schedule_delayed_work(&ring->adev->vcn.idle_work, VCN_IDLE_TIMEOUT);
 	mutex_unlock(&ring->adev->vcn.vcn1_jpeg1_workaround);
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +4 -0
index 065d87841459..816bbaf75954 100644
@@ -68,6 +68,7 @@ static const struct class kfd_class = {
 };
 
 static inline struct kfd_process_device *kfd_lock_pdd_by_id(struct kfd_process *p, __u32 gpu_id)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	struct kfd_process_device *pdd;
 
@@ -82,6 +83,7 @@ static inline struct kfd_process_device *kfd_lock_pdd_by_id(struct kfd_process *
 }
 
 static inline void kfd_unlock_pdd(struct kfd_process_device *pdd)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the locking function */
 {
 	mutex_unlock(&pdd->process->mutex);
 }
@@ -2749,6 +2751,7 @@ static int kfd_ioctl_criu(struct file *filep, struct kfd_process *p, void *data)
 
 static int runtime_enable(struct kfd_process *p, uint64_t r_debug,
 			bool enable_ttmp_setup)
+	REQUIRES(p->mutex)
 {
 	int i = 0, ret = 0;
 
@@ -2817,6 +2820,7 @@ static int runtime_enable(struct kfd_process *p, uint64_t r_debug,
 }
 
 static int runtime_disable(struct kfd_process *p)
+	REQUIRES(p->mutex)
 {
 	int i = 0, ret;
 	bool was_enabled = p->runtime_info.runtime_state == DEBUG_RUNTIME_STATE_ENABLED;
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +5 -0
index d4593374e7a1..57357f5911b3 100644
@@ -2383,6 +2383,8 @@ static int execute_queues_cpsch(struct device_queue_manager *dqm,
 
 static int wait_on_destroy_queue(struct device_queue_manager *dqm,
 				 struct queue *q)
+	REQUIRES(dqm->lock_hidden)
+	REQUIRES(q->process->mutex)
 {
 	struct kfd_process_device *pdd = kfd_get_process_device_data(q->device,
 								q->process);
@@ -2412,6 +2414,7 @@ static int wait_on_destroy_queue(struct device_queue_manager *dqm,
 static int destroy_queue_cpsch(struct device_queue_manager *dqm,
 				struct qcm_process_device *qpd,
 				struct queue *q)
+	REQUIRES(q->process->mutex)
 {
 	int retval;
 	struct mqd_manager *mqd_mgr;
@@ -3545,6 +3548,7 @@ void set_queue_snapshot_entry(struct queue *q,
 }
 
 int debug_lock_and_unmap(struct device_queue_manager *dqm)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct device *dev = dqm->dev->adev->dev;
 	int r;
@@ -3567,6 +3571,7 @@ int debug_lock_and_unmap(struct device_queue_manager *dqm)
 }
 
 int debug_map_and_unlock(struct device_queue_manager *dqm)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional unlock */
 {
 	struct device *dev = dqm->dev->adev->dev;
 	int r;
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +2 -0
index 09ab36f8e8c6..66a75279f094 100644
@@ -344,11 +344,13 @@ get_sh_mem_bases_nybble_64(struct kfd_process_device *pdd)
  * an MMU notifier runs in reclaim-FS context.
  */
 static inline void dqm_lock(struct device_queue_manager *dqm)
+	ACQUIRE(dqm->lock_hidden)
 {
 	mutex_lock(&dqm->lock_hidden);
 	dqm->saved_flags = memalloc_noreclaim_save();
 }
 static inline void dqm_unlock(struct device_queue_manager *dqm)
+	RELEASE(dqm->lock_hidden)
 {
 	memalloc_noreclaim_restore(dqm->saved_flags);
 	mutex_unlock(&dqm->lock_hidden);
drivers/gpu/drm/amd/amdkfd/kfd_svm.h +2 -0
index bddd24f04669..63331e9ef4cf 100644
@@ -141,12 +141,14 @@ struct svm_range {
 };
 
 static inline void svm_range_lock(struct svm_range *prange)
+	ACQUIRE(prange->lock)
 {
 	mutex_lock(&prange->lock);
 	prange->saved_flags = memalloc_noreclaim_save();
 
 }
 static inline void svm_range_unlock(struct svm_range *prange)
+	RELEASE(prange->lock)
 {
 	memalloc_noreclaim_restore(prange->saved_flags);
 	mutex_unlock(&prange->lock);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
index ac3fd81fecef..e2b2ed1ec452 100644
@@ -3042,6 +3042,7 @@ static void hpd_rx_irq_work_suspend(struct amdgpu_display_manager *dm)
 }
 
 static int dm_suspend(struct amdgpu_ip_block *ip_block)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct amdgpu_device *adev = ip_block->adev;
 	struct amdgpu_display_manager *dm = &adev->dm;
@@ -3233,6 +3234,7 @@ static void dm_gpureset_commit_state(struct dc_state *dc_state,
 }
 
 static int dm_resume(struct amdgpu_ip_block *ip_block)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct amdgpu_device *adev = ip_block->adev;
 	struct drm_device *ddev = adev_to_drm(adev);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +1 -0
index e339c7a8d541..4a9851d302f3 100644
@@ -150,6 +150,7 @@ static void process_output(struct hdcp_workqueue *hdcp_work)
 }
 
 static void link_lock(struct hdcp_workqueue *work, bool lock)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int i = 0;
 
drivers/gpu/drm/ast/ast_ddc.c +2 -0
index 29cf5d157f34..43acf96ffea7 100644
@@ -70,6 +70,7 @@ static void ast_ddc_algo_bit_data_setscl(void *data, int state)
 }
 
 static int ast_ddc_algo_bit_data_pre_xfer(struct i2c_adapter *adapter)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct ast_ddc *ddc = i2c_get_adapdata(adapter);
 	struct ast_device *ast = ddc->ast;
@@ -84,6 +85,7 @@ static int ast_ddc_algo_bit_data_pre_xfer(struct i2c_adapter *adapter)
 }
 
 static void ast_ddc_algo_bit_data_post_xfer(struct i2c_adapter *adapter)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct ast_ddc *ddc = i2c_get_adapdata(adapter);
 	struct ast_device *ast = ddc->ast;
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +2 -0
index f4c3ff1fdc69..fdd05e3e36f9 100644
@@ -122,12 +122,14 @@ static struct lt9611uxc *bridge_to_lt9611uxc(struct drm_bridge *bridge)
 }
 
 static void lt9611uxc_lock(struct lt9611uxc *lt9611uxc)
+	ACQUIRE(lt9611uxc->ocm_lock)
 {
 	mutex_lock(&lt9611uxc->ocm_lock);
 	regmap_write(lt9611uxc->regmap, 0x80ee, 0x01);
 }
 
 static void lt9611uxc_unlock(struct lt9611uxc *lt9611uxc)
+	RELEASE(lt9611uxc->ocm_lock)
 {
 	regmap_write(lt9611uxc->regmap, 0x80ee, 0x00);
 	msleep(50);
drivers/gpu/drm/clients/drm_log.c +2 -0
index 379850c83e51..e4be95012851 100644
@@ -363,6 +363,7 @@ static void drm_log_write_thread(struct console *con, struct nbcon_write_context
 }
 
 static void drm_log_lock(struct console *con, unsigned long *flags)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct drm_log *dlog = console_to_drm_log(con);
 
@@ -371,6 +372,7 @@ static void drm_log_lock(struct console *con, unsigned long *flags)
 }
 
 static void drm_log_unlock(struct console *con, unsigned long flags)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct drm_log *dlog = console_to_drm_log(con);
 
drivers/gpu/drm/display/drm_dp_helper.c +3 -0
index da3c8521a7fa..5621fe8c7ac8 100644
@@ -2089,16 +2089,19 @@ static struct drm_dp_aux *i2c_to_aux(struct i2c_adapter *i2c)
 }
 
 static void lock_bus(struct i2c_adapter *i2c, unsigned int flags)
+	ACQUIRE(i2c_to_aux(i2c)->hw_mutex)
 {
 	mutex_lock(&i2c_to_aux(i2c)->hw_mutex);
 }
 
 static int trylock_bus(struct i2c_adapter *i2c, unsigned int flags)
+	TRY_ACQUIRE(1, i2c_to_aux(i2c)->hw_mutex)
 {
 	return mutex_trylock(&i2c_to_aux(i2c)->hw_mutex);
 }
 
 static void unlock_bus(struct i2c_adapter *i2c, unsigned int flags)
+	RELEASE(i2c_to_aux(i2c)->hw_mutex)
 {
 	mutex_unlock(&i2c_to_aux(i2c)->hw_mutex);
 }
drivers/gpu/drm/display/drm_dp_mst_topology.c +2 -0
index 06c91c5b7f7c..fe1527177614 100644
@@ -1666,12 +1666,14 @@ save_port_topology_ref(struct drm_dp_mst_port *port,
 
 static inline void
 topology_ref_history_lock(struct drm_dp_mst_topology_mgr *mgr)
+	ACQUIRE(mgr->topology_ref_history_lock)
 {
 	mutex_lock(&mgr->topology_ref_history_lock);
 }
 
 static inline void
 topology_ref_history_unlock(struct drm_dp_mst_topology_mgr *mgr)
+	RELEASE(mgr->topology_ref_history_lock)
 {
 	mutex_unlock(&mgr->topology_ref_history_lock);
 }
drivers/gpu/drm/drm_atomic_helper.c +3 -0
index 5186d2114a50..8f6adf608a49 100644
@@ -3374,6 +3374,7 @@ EXPORT_SYMBOL(drm_atomic_helper_disable_all);
  * and it is the atomic version of drm_helper_force_disable_all().
  */
 void drm_atomic_helper_shutdown(struct drm_device *dev)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_modeset_acquire_ctx ctx;
 	int ret;
@@ -3507,6 +3508,7 @@ EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
  * drm_atomic_helper_resume(), drm_atomic_helper_commit_duplicated_state()
  */
 struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_modeset_acquire_ctx ctx;
 	struct drm_atomic_state *state;
@@ -3600,6 +3602,7 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_duplicated_state);
  */
 int drm_atomic_helper_resume(struct drm_device *dev,
 			     struct drm_atomic_state *state)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_modeset_acquire_ctx ctx;
 	int err;
drivers/gpu/drm/drm_auth.c +2 -0
index 22aa015df387..45aee359f44d 100644
@@ -448,6 +448,7 @@ EXPORT_SYMBOL(drm_master_put);
 
 /* Used by drm_client and drm_fb_helper */
 bool drm_master_internal_acquire(struct drm_device *dev)
+	TRY_ACQUIRE(true, dev->master_mutex)
 {
 	mutex_lock(&dev->master_mutex);
 	if (dev->master) {
@@ -461,6 +462,7 @@ EXPORT_SYMBOL(drm_master_internal_acquire);
 
 /* Used by drm_client and drm_fb_helper */
 void drm_master_internal_release(struct drm_device *dev)
+	RELEASE(dev->master_mutex)
 {
 	mutex_unlock(&dev->master_mutex);
 }
drivers/gpu/drm/drm_client_modeset.c +1 -0
index aca442c25209..90ba56141fe9 100644
@@ -1214,6 +1214,7 @@ int drm_client_modeset_commit(struct drm_client_dev *client)
 EXPORT_SYMBOL(drm_client_modeset_commit);
 
 static void drm_client_modeset_dpms_legacy(struct drm_client_dev *client, int dpms_mode)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_device *dev = client->dev;
 	struct drm_connector *connector;
drivers/gpu/drm/drm_color_mgmt.c +1 -0
index 3969dc548cff..2bae9370b31f 100644
@@ -358,6 +358,7 @@ static int drm_crtc_legacy_gamma_set(struct drm_crtc *crtc,
  */
 int drm_mode_gamma_set_ioctl(struct drm_device *dev,
 			     void *data, struct drm_file *file_priv)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_mode_crtc_lut *crtc_lut = data;
 	struct drm_crtc *crtc;
drivers/gpu/drm/drm_crtc.c +1 -0
index 3488ff067c69..d124f99c61bc 100644
@@ -691,6 +691,7 @@ EXPORT_SYMBOL(drm_crtc_check_viewport);
  */
 int drm_mode_setcrtc(struct drm_device *dev, void *data,
 		     struct drm_file *file_priv)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_mode_config *config = &dev->mode_config;
 	struct drm_mode_crtc *crtc_req = data;
drivers/gpu/drm/drm_drv.c +1 -0
index 3cf440eee8a2..12aa56972493 100644
@@ -929,6 +929,7 @@ static void remove_compat_control_link(struct drm_device *dev)
  * 0 on success, negative error code on failure.
  */
 int drm_dev_register(struct drm_device *dev, unsigned long flags)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	const struct drm_driver *driver = dev->driver;
 	int ret;
drivers/gpu/drm/drm_fb_helper.c +1 -0
index fb3614a7ba44..0d5ab9432f25 100644
@@ -1808,6 +1808,7 @@ static void drm_setup_crtcs_fb(struct drm_fb_helper *fb_helper)
 /* Note: Drops fb_helper->lock before returning. */
 static int
 __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)
+	RELEASE(fb_helper->lock)
 {
 	struct drm_device *dev = fb_helper->dev;
 	struct fb_info *info;
drivers/gpu/drm/drm_file.c +4 -0
index 2289e71e2fa2..a955be3425f7 100644
@@ -355,6 +355,7 @@ int drm_open_helper(struct file *filp, struct drm_minor *minor)
  * 0 on success or negative errno value on failure.
  */
 int drm_open(struct inode *inode, struct file *filp)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drm_device *dev;
 	struct drm_minor *minor;
@@ -413,6 +414,7 @@ static void drm_lastclose(struct drm_device *dev)
  * Always succeeds and returns 0.
  */
 int drm_release(struct inode *inode, struct file *filp)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drm_file *file_priv = filp->private_data;
 	struct drm_minor *minor = file_priv->minor;
@@ -483,6 +485,7 @@ void drm_file_update_pid(struct drm_file *filp)
  * Always succeeds and returns 0.
  */
 int drm_release_noglobal(struct inode *inode, struct file *filp)
+	NO_THREAD_SAFETY_ANALYSIS /* needed because of a clang bug? */
 {
 	struct drm_file *file_priv = filp->private_data;
 	struct drm_minor *minor = file_priv->minor;
@@ -527,6 +530,7 @@ EXPORT_SYMBOL(drm_release_noglobal);
  */
 ssize_t drm_read(struct file *filp, char __user *buffer,
 		 size_t count, loff_t *offset)
+	NO_THREAD_SAFETY_ANALYSIS /* clang bug? */
 {
 	struct drm_file *file_priv = filp->private_data;
 	struct drm_device *dev = file_priv->minor->dev;
drivers/gpu/drm/drm_gem.c +3 -1
index ee811764c3df..1a9bd014ff2a 100644
@@ -383,6 +383,7 @@ int
 drm_gem_handle_create_tail(struct drm_file *file_priv,
 			   struct drm_gem_object *obj,
 			   u32 *handlep)
+	RELEASE(obj->dev->object_name_lock)
 {
 	struct drm_device *dev = obj->dev;
 	u32 handle;
@@ -404,7 +405,7 @@ drm_gem_handle_create_tail(struct drm_file *file_priv,
 	spin_unlock(&file_priv->table_lock);
 	idr_preload_end();
 
-	mutex_unlock(&dev->object_name_lock);
+	mutex_unlock(&obj->dev->object_name_lock);
 	if (ret < 0)
 		goto err_unref;
 
@@ -902,6 +903,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data,
 int
 drm_gem_open_ioctl(struct drm_device *dev, void *data,
 		   struct drm_file *file_priv)
+	NO_THREAD_SAFETY_ANALYSIS /* requires alias analysis */
 {
 	struct drm_gem_open *args = data;
 	struct drm_gem_object *obj;
drivers/gpu/drm/drm_mode_object.c +2 -0
index e943205a2394..418e25185f08 100644
@@ -435,6 +435,7 @@ int drm_mode_object_get_properties(struct drm_mode_object *obj, bool atomic,
  */
 int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
 				      struct drm_file *file_priv)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_mode_obj_get_properties *arg = data;
 	struct drm_mode_object *obj;
@@ -484,6 +485,7 @@ EXPORT_SYMBOL_FOR_TESTS_ONLY(drm_mode_obj_find_prop_id);
 static int set_property_legacy(struct drm_mode_object *obj,
 			       struct drm_property *prop,
 			       uint64_t prop_value)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_device *dev = prop->dev;
 	struct drm_mode_object *ref;
drivers/gpu/drm/drm_modeset_lock.c +2 -0
index 7694b85e75e3..f9442f9823ae 100644
@@ -141,6 +141,7 @@ static void __drm_stack_depot_init(void)
  * drm_modeset_lock_all_ctx() function and pass in the context explicitly.
  */
 void drm_modeset_lock_all(struct drm_device *dev)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drm_mode_config *config = &dev->mode_config;
 	struct drm_modeset_acquire_ctx *ctx;
@@ -195,6 +196,7 @@ EXPORT_SYMBOL(drm_modeset_lock_all);
  * directly to the drm_modeset_drop_locks() function.
  */
 void drm_modeset_unlock_all(struct drm_device *dev)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional unlocking */
 {
 	struct drm_mode_config *config = &dev->mode_config;
 	struct drm_modeset_acquire_ctx *ctx = config->acquire_ctx;
drivers/gpu/drm/drm_plane.c +1 -0
index a28b22fdd7a4..ab324a023e93 100644
@@ -1084,6 +1084,7 @@ static int setplane_internal(struct drm_plane *plane,
 			     /* src_{x,y,w,h} values are 16.16 fixed point */
 			     uint32_t src_x, uint32_t src_y,
 			     uint32_t src_w, uint32_t src_h)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_modeset_acquire_ctx ctx;
 	int ret;
drivers/gpu/drm/drm_prime.c +1 -0
index 32a8781cfd67..664b0c2c8c36 100644
@@ -295,6 +295,7 @@ EXPORT_SYMBOL(drm_gem_dmabuf_release);
 int drm_gem_prime_fd_to_handle(struct drm_device *dev,
 			       struct drm_file *file_priv, int prime_fd,
 			       uint32_t *handle)
+	NO_THREAD_SAFETY_ANALYSIS /* requires alias analysis */
 {
 	struct dma_buf *dma_buf;
 	struct drm_gem_object *obj;
drivers/gpu/drm/i915/display/intel_cdclk.c +1 -0
index c7a603589412..450d08524bc3 100644
@@ -2520,6 +2520,7 @@ static void intel_pcode_notify(struct intel_display *display,
 static void intel_set_cdclk(struct intel_display *display,
 			    const struct intel_cdclk_config *cdclk_config,
 			    enum pipe pipe, const char *context)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex calls inside a loop */
 {
 	struct drm_i915_private *dev_priv = to_i915(display->drm);
 	struct intel_encoder *encoder;
drivers/gpu/drm/i915/display/intel_display_reset.c +2 -0
index 093b386c95e8..73a3f3ade271 100644
@@ -20,6 +20,7 @@ static bool gpu_reset_clobbers_display(struct drm_i915_private *dev_priv)
 }
 
 void intel_display_reset_prepare(struct drm_i915_private *dev_priv)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drm_modeset_acquire_ctx *ctx = &dev_priv->display.restore.reset_ctx;
 	struct drm_atomic_state *state;
@@ -82,6 +83,7 @@ void intel_display_reset_prepare(struct drm_i915_private *dev_priv)
 }
 
 void intel_display_reset_finish(struct drm_i915_private *i915)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct intel_display *display = &i915->display;
 	struct drm_modeset_acquire_ctx *ctx = &display->restore.reset_ctx;
drivers/gpu/drm/i915/display/intel_gmbus.c +3 -0
index 807cf606e7a8..54fd5f1d6ce2 100644
@@ -838,6 +838,7 @@ static const struct i2c_algorithm gmbus_algorithm = {
 
 static void gmbus_lock_bus(struct i2c_adapter *adapter,
 			   unsigned int flags)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_gmbus *bus = to_intel_gmbus(adapter);
 	struct intel_display *display = bus->display;
@@ -847,6 +848,7 @@ static void gmbus_lock_bus(struct i2c_adapter *adapter,
 
 static int gmbus_trylock_bus(struct i2c_adapter *adapter,
 			     unsigned int flags)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_gmbus *bus = to_intel_gmbus(adapter);
 	struct intel_display *display = bus->display;
@@ -856,6 +858,7 @@ static int gmbus_trylock_bus(struct i2c_adapter *adapter,
 
 static void gmbus_unlock_bus(struct i2c_adapter *adapter,
 			     unsigned int flags)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_gmbus *bus = to_intel_gmbus(adapter);
 	struct intel_display *display = bus->display;
drivers/gpu/drm/i915/display/intel_pps.c +2 -0
index eb35f0249f2b..9cfa2ada532d 100644
@@ -63,6 +63,7 @@ static const char *pps_name(struct intel_dp *intel_dp)
 }
 
 intel_wakeref_t intel_pps_lock(struct intel_dp *intel_dp)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_display *display = to_intel_display(intel_dp);
 	struct drm_i915_private *dev_priv = to_i915(display->drm);
@@ -79,6 +80,7 @@ intel_wakeref_t intel_pps_lock(struct intel_dp *intel_dp)
 
 intel_wakeref_t intel_pps_unlock(struct intel_dp *intel_dp,
 				 intel_wakeref_t wakeref)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_display *display = to_intel_display(intel_dp);
 	struct drm_i915_private *dev_priv = to_i915(display->drm);
drivers/gpu/drm/i915/display/intel_psr.c +3 -0
index 0b021acb330f..dc7cfeb0a4c8 100644
@@ -2938,6 +2938,7 @@ void intel_psr_wait_for_idle_locked(const struct intel_crtc_state *new_crtc_stat
 }
 
 static bool __psr_wait_for_idle_locked(struct intel_dp *intel_dp)
+	REQUIRES(intel_dp->psr.lock)
 {
 	struct intel_display *display = to_intel_display(intel_dp);
 	enum transcoder cpu_transcoder = intel_dp->psr.transcoder;
@@ -3567,6 +3568,7 @@ bool intel_psr_link_ok(struct intel_dp *intel_dp)
  * before it to avoid vblank evasion.
  */
 void intel_psr_lock(const struct intel_crtc_state *crtc_state)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_display *display = to_intel_display(crtc_state);
 	struct intel_encoder *encoder;
@@ -3590,6 +3592,7 @@ void intel_psr_lock(const struct intel_crtc_state *crtc_state)
  * Release the PSR lock that was held during pipe update.
  */
 void intel_psr_unlock(const struct intel_crtc_state *crtc_state)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_display *display = to_intel_display(crtc_state);
 	struct intel_encoder *encoder;
drivers/gpu/drm/i915/display/intel_tc.c +4 -0
index 13811244c82b..d81e8de5acf4 100644
@@ -1773,6 +1773,7 @@ void intel_tc_port_link_cancel_reset_work(struct intel_digital_port *dig_port)
 
 static void __intel_tc_port_lock(struct intel_tc_port *tc,
 				 int required_lanes)
+	ACQUIRE(tc->lock)
 {
 	struct drm_i915_private *i915 = tc_to_i915(tc);
 
@@ -1790,6 +1791,7 @@ static void __intel_tc_port_lock(struct intel_tc_port *tc,
 }
 
 void intel_tc_port_lock(struct intel_digital_port *dig_port)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	__intel_tc_port_lock(to_tc_port(dig_port), 1);
 }
@@ -1832,6 +1834,7 @@ void intel_tc_port_suspend(struct intel_digital_port *dig_port)
 }
 
 void intel_tc_port_unlock(struct intel_digital_port *dig_port)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_tc_port *tc = to_tc_port(dig_port);
 
@@ -1852,6 +1855,7 @@ bool intel_tc_port_ref_held(struct intel_digital_port *dig_port)
 
 void intel_tc_port_get_link(struct intel_digital_port *dig_port,
 			    int required_lanes)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_tc_port *tc = to_tc_port(dig_port);
 
drivers/gpu/drm/i915/gem/i915_gem_context.h +2 -0
index e5b0f66ea1fe..61f1dcdd7050 100644
@@ -190,6 +190,7 @@ i915_gem_context_engines(struct i915_gem_context *ctx)
 static inline struct i915_gem_engines *
 i915_gem_context_lock_engines(struct i915_gem_context *ctx)
 	__acquires(&ctx->engines_mutex)
+	ACQUIRE(ctx->engines_mutex)
 {
 	mutex_lock(&ctx->engines_mutex);
 	return i915_gem_context_engines(ctx);
@@ -198,6 +199,7 @@ i915_gem_context_lock_engines(struct i915_gem_context *ctx)
 static inline void
 i915_gem_context_unlock_engines(struct i915_gem_context *ctx)
 	__releases(&ctx->engines_mutex)
+	RELEASE(ctx->engines_mutex)
 {
 	mutex_unlock(&ctx->engines_mutex);
 }
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +1 -0
index f151640c1d13..8ca9f464c87d 100644
@@ -3081,6 +3081,7 @@ static void retire_requests(struct intel_timeline *tl, struct i915_request *end)
 
 static int eb_request_add(struct i915_execbuffer *eb, struct i915_request *rq,
 			  int err, bool last_parallel)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_timeline * const tl = i915_request_timeline(rq);
 	struct i915_sched_attr attr = {};
drivers/gpu/drm/i915/gt/intel_context.h +4 -0
index 9f523999acd1..8fd387bcfbd9 100644
@@ -105,6 +105,7 @@ void intel_context_bind_parent_child(struct intel_context *parent,
  */
 static inline int intel_context_lock_pinned(struct intel_context *ce)
 	__acquires(ce->pin_mutex)
+	TRY_ACQUIRE(0, ce->pin_mutex)
 {
 	return mutex_lock_interruptible(&ce->pin_mutex);
 }
@@ -139,6 +140,7 @@ static inline void intel_context_cancel_request(struct intel_context *ce,
  */
 static inline void intel_context_unlock_pinned(struct intel_context *ce)
 	__releases(ce->pin_mutex)
+	RELEASE(ce->pin_mutex)
 {
 	mutex_unlock(&ce->pin_mutex);
 }
@@ -247,6 +249,7 @@ static inline void intel_context_put(struct intel_context *ce)
 static inline struct intel_timeline *__must_check
 intel_context_timeline_lock(struct intel_context *ce)
 	__acquires(&ce->timeline->mutex)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	struct intel_timeline *tl = ce->timeline;
 	int err;
@@ -266,6 +269,7 @@ intel_context_timeline_lock(struct intel_context *ce)
 
 static inline void intel_context_timeline_unlock(struct intel_timeline *tl)
 	__releases(&tl->mutex)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the corresponding lock function */
 {
 	mutex_unlock(&tl->mutex);
 }
drivers/gpu/drm/i915/gt/selftest_context.c +1 -0
index 5eb46700dc4e..6b0628caff9b 100644
@@ -13,6 +13,7 @@
 #include "selftests/mock_drm.h"
 
 static int request_sync(struct i915_request *rq)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_timeline *tl = i915_request_timeline(rq);
 	long timeout;
drivers/gpu/drm/i915/gt/selftest_timeline.c +1 -0
index fa36cf920bde..d8d98fe609b3 100644
@@ -856,6 +856,7 @@ static int setup_watcher(struct hwsp_watcher *w, struct intel_gt *gt,
 }
 
 static void switch_tl_lock(struct i915_request *from, struct i915_request *to)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	/* some light mutex juggling required; think co-routines */
 
drivers/gpu/drm/i915/gvt/vgpu.c +1 -0
index 63c751ca4119..14bacbcd7734 100644
@@ -434,6 +434,7 @@ int intel_gvt_create_vgpu(struct intel_vgpu *vgpu,
  */
 void intel_gvt_reset_vgpu_locked(struct intel_vgpu *vgpu, bool dmlr,
 				 intel_engine_mask_t engine_mask)
+	REQUIRES(vgpu->vgpu_lock)
 {
 	struct intel_gvt *gvt = vgpu->gvt;
 	struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler;
drivers/gpu/drm/i915/i915_request.c +1 -0
index 8f62cfa23fb7..c5d9d8767efe 100644
@@ -1843,6 +1843,7 @@ void __i915_request_queue(struct i915_request *rq,
 }
 
 void i915_request_add(struct i915_request *rq)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_timeline * const tl = i915_request_timeline(rq);
 	struct i915_sched_attr attr = {};
drivers/gpu/drm/i915/i915_vma.c +2 -1
index 776f8cc51b2f..64e08156a71c 100644
@@ -2179,7 +2179,7 @@ int i915_vma_unbind(struct i915_vma *vma)
 		/* XXX not always required: nop_clear_range */
 		wakeref = intel_runtime_pm_get(&vm->i915->runtime_pm);
 
-	err = mutex_lock_interruptible_nested(&vma->vm->mutex, !wakeref);
+	err = mutex_lock_interruptible_nested(&vm->mutex, !wakeref);
 	if (err)
 		goto out_rpm;
 
@@ -2193,6 +2193,7 @@ int i915_vma_unbind(struct i915_vma *vma)
 }
 
 int i915_vma_unbind_async(struct i915_vma *vma, bool trylock_vm)
+	NO_THREAD_SAFETY_ANALYSIS /* clang bug? */
 {
 	struct drm_i915_gem_object *obj = vma->obj;
 	struct i915_address_space *vm = vma->vm;
drivers/gpu/drm/i915/intel_sbi.c +2 -0
index 41e85ac773dc..def511389ffe 100644
@@ -58,11 +58,13 @@ static int intel_sbi_rw(struct drm_i915_private *i915, u16 reg,
 }
 
 void intel_sbi_lock(struct drm_i915_private *i915)
+	ACQUIRE(i915->sbi_lock)
 {
 	mutex_lock(&i915->sbi_lock);
 }
 
 void intel_sbi_unlock(struct drm_i915_private *i915)
+	RELEASE(i915->sbi_lock)
 {
 	mutex_unlock(&i915->sbi_lock);
 }
drivers/gpu/drm/i915/intel_wakeref.c +2 -0
index 87f246047312..595ff21b2a9f 100644
@@ -51,6 +51,7 @@ int __intel_wakeref_get_first(struct intel_wakeref *wf)
 }
 
 static void ____intel_wakeref_put_last(struct intel_wakeref *wf)
+	RELEASE(wf->mutex)
 {
 	intel_wakeref_t wakeref = NULL;
 
@@ -86,6 +87,7 @@ void __intel_wakeref_put_last(struct intel_wakeref *wf, unsigned long flags)
 }
 
 static void __intel_wakeref_put_work(struct work_struct *wrk)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct intel_wakeref *wf = container_of(wrk, typeof(*wf), work.work);
 
drivers/gpu/drm/i915/intel_wakeref.h +2 -0
index 48836ef52d40..842f8bfe32e8 100644
@@ -204,6 +204,7 @@ intel_wakeref_might_put(struct intel_wakeref *wf)
 static inline void
 intel_wakeref_lock(struct intel_wakeref *wf)
 	__acquires(wf->mutex)
+	ACQUIRE(wf->mutex)
 {
 	mutex_lock(&wf->mutex);
 }
@@ -217,6 +218,7 @@ intel_wakeref_lock(struct intel_wakeref *wf)
 static inline void
 intel_wakeref_unlock(struct intel_wakeref *wf)
 	__releases(wf->mutex)
+	RELEASE(wf->mutex)
 {
 	mutex_unlock(&wf->mutex);
 }
drivers/gpu/drm/i915/pxp/intel_pxp_cmd.c +1 -0
index 0eee51c4a772..2823f7cbee07 100644
@@ -81,6 +81,7 @@ static u32 *pxp_emit_wait(u32 *cs)
 #define WAIT_LEN 2
 
 static void pxp_request_commit(struct i915_request *rq)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct i915_sched_attr attr = { .priority = I915_PRIORITY_MAX };
 	struct intel_timeline * const tl = i915_request_timeline(rq);
drivers/gpu/drm/i915/vlv_sideband.c +2 -0
index 114ae8eb9cd5..203f4c2a3989 100644
@@ -58,6 +58,7 @@ static void __vlv_punit_put(struct drm_i915_private *i915)
 }
 
 void vlv_iosf_sb_get(struct drm_i915_private *i915, unsigned long ports)
+	ACQUIRE(i915->vlv_iosf_sb.lock)
 {
 	if (ports & BIT(VLV_IOSF_SB_PUNIT))
 		__vlv_punit_get(i915);
@@ -66,6 +67,7 @@ void vlv_iosf_sb_get(struct drm_i915_private *i915, unsigned long ports)
 }
 
 void vlv_iosf_sb_put(struct drm_i915_private *i915, unsigned long ports)
+	RELEASE(i915->vlv_iosf_sb.lock)
 {
 	mutex_unlock(&i915->vlv_iosf_sb.lock);
 
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +1 -0
index c23ee2d214de..3d4343aa7f44 100644
@@ -213,6 +213,7 @@ static inline dma_addr_t dma_hwdesc_addr(const struct ingenic_drm *priv,
 static int ingenic_drm_update_pixclk(struct notifier_block *nb,
 				     unsigned long action,
 				     void *data)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct ingenic_drm *priv = drm_nb_get_priv(nb);
 
drivers/gpu/drm/mgag200/mgag200_ddc.c +2 -0
index 6d81ea8931e8..526c15602476 100644
@@ -100,6 +100,7 @@ static int mgag200_ddc_algo_bit_data_getscl(void *data)
 }
 
 static int mgag200_ddc_algo_bit_data_pre_xfer(struct i2c_adapter *adapter)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct mgag200_ddc *ddc = i2c_get_adapdata(adapter);
 	struct mga_device *mdev = ddc->mdev;
@@ -114,6 +115,7 @@ static int mgag200_ddc_algo_bit_data_pre_xfer(struct i2c_adapter *adapter)
 }
 
 static void mgag200_ddc_algo_bit_data_post_xfer(struct i2c_adapter *adapter)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct mgag200_ddc *ddc = i2c_get_adapdata(adapter);
 	struct mga_device *mdev = ddc->mdev;
drivers/gpu/drm/msm/msm_atomic.c +2 -0
index a7a2384044ff..66f31b42b511 100644
@@ -41,6 +41,7 @@ static void vblank_put(struct msm_kms *kms, unsigned crtc_mask)
 }
 
 static void lock_crtcs(struct msm_kms *kms, unsigned int crtc_mask)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	int crtc_index;
 	struct drm_crtc *crtc;
@@ -52,6 +53,7 @@ static void lock_crtcs(struct msm_kms *kms, unsigned int crtc_mask)
 }
 
 static void unlock_crtcs(struct msm_kms *kms, unsigned int crtc_mask)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct drm_crtc *crtc;
 
drivers/gpu/drm/nouveau/dispnv50/disp.c +2 -0
index 62d72b7a8d04..5a6ec419c4e0 100644
@@ -2159,6 +2159,7 @@ nv50_disp_atomic_commit_wndw(struct drm_atomic_state *state, u32 *interlock)
 
 static void
 nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct drm_device *dev = state->dev;
 	struct drm_crtc_state *new_crtc_state, *old_crtc_state;
@@ -2757,6 +2758,7 @@ nv50_display_read_hw_or_state(struct drm_device *dev, struct nv50_disp *disp,
 /* Read back the currently programmed display state */
 static void
 nv50_display_read_hw_state(struct nouveau_drm *drm)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_device *dev = drm->dev;
 	struct drm_encoder *encoder;
drivers/gpu/drm/nouveau/nouveau_abi16.c +2 -0
index 2a0617e5fe2a..ebe0eadeba7f 100644
@@ -56,6 +56,7 @@ nouveau_abi16(struct drm_file *file_priv)
 
 struct nouveau_abi16 *
 nouveau_abi16_get(struct drm_file *file_priv)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	struct nouveau_cli *cli = nouveau_cli(file_priv);
 	mutex_lock(&cli->mutex);
@@ -67,6 +68,7 @@ nouveau_abi16_get(struct drm_file *file_priv)
 
 int
 nouveau_abi16_put(struct nouveau_abi16 *abi16, int ret)
+	NO_THREAD_SAFETY_ANALYSIS /* to match the previous function */
 {
 	struct nouveau_cli *cli = abi16->cli;
 	mutex_unlock(&cli->mutex);
drivers/gpu/drm/nouveau/nouveau_uvmm.h +2 -0
index 9d3c348581eb..0013bd3b552d 100644
@@ -86,11 +86,13 @@ int nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev, void *data,
 			       struct drm_file *file_priv);
 
 static inline void nouveau_uvmm_lock(struct nouveau_uvmm *uvmm)
+	ACQUIRE(uvmm->mutex)
 {
 	mutex_lock(&uvmm->mutex);
 }
 
 static inline void nouveau_uvmm_unlock(struct nouveau_uvmm *uvmm)
+	RELEASE(uvmm->mutex)
 {
 	mutex_unlock(&uvmm->mutex);
 }
drivers/gpu/drm/nouveau/nvkm/core/subdev.c +1 -0
index 6c20e827a069..dda2fa920fba 100644
@@ -184,6 +184,7 @@ nvkm_subdev_oneinit(struct nvkm_subdev *subdev)
 
 void
 nvkm_subdev_unref(struct nvkm_subdev *subdev)
+	NO_THREAD_SAFETY_ANALYSIS /* because of a clang bug */
 {
 	if (refcount_dec_and_mutex_lock(&subdev->use.refcount, &subdev->use.mutex)) {
 		nvkm_subdev_fini(subdev, false);
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c +2 -1
index 7d4716dcd512..5c54691d3bdb 100644
@@ -70,6 +70,7 @@ nvkm_chan_cctx_bind(struct nvkm_chan *chan, struct nvkm_engn *engn, struct nvkm_
 
 void
 nvkm_chan_cctx_put(struct nvkm_chan *chan, struct nvkm_cctx **pcctx)
+	NO_THREAD_SAFETY_ANALYSIS /* needed because of a clang bug? */
 {
 	struct nvkm_cctx *cctx = *pcctx;
 
@@ -104,7 +105,7 @@ nvkm_chan_cctx_get(struct nvkm_chan *chan, struct nvkm_engn *engn, struct nvkm_c
 	if (cctx) {
 		refcount_inc(&cctx->refs);
 		*pcctx = cctx;
-		mutex_unlock(&chan->cgrp->mutex);
+		mutex_unlock(&cgrp->mutex);
 		return 0;
 	}
 
drivers/gpu/drm/nouveau/nvkm/engine/fifo/uchan.c +1 -0
index 9e56bcc166ed..c1b109aabde5 100644
@@ -73,6 +73,7 @@ struct nvkm_uobj {
 
 static int
 nvkm_uchan_object_fini_1(struct nvkm_oproxy *oproxy, bool suspend)
+	NO_THREAD_SAFETY_ANALYSIS /* needed because of a clang bug? */
 {
 	struct nvkm_uobj *uobj = container_of(oproxy, typeof(*uobj), oproxy);
 	struct nvkm_chan *chan = uobj->chan;
drivers/gpu/drm/nouveau/nvkm/falcon/cmdq.c +3 -0
index 211ebe7afac6..448865b9b59b 100644
@@ -69,6 +69,7 @@ nvkm_falcon_cmdq_rewind(struct nvkm_falcon_cmdq *cmdq)
 
 static int
 nvkm_falcon_cmdq_open(struct nvkm_falcon_cmdq *cmdq, u32 size)
+	TRY_ACQUIRE(0, cmdq->mutex)
 {
 	struct nvkm_falcon *falcon = cmdq->qmgr->falcon;
 	bool rewind = false;
@@ -91,6 +92,7 @@ nvkm_falcon_cmdq_open(struct nvkm_falcon_cmdq *cmdq, u32 size)
 
 static void
 nvkm_falcon_cmdq_close(struct nvkm_falcon_cmdq *cmdq)
+	RELEASE(cmdq->mutex)
 {
 	nvkm_falcon_wr32(cmdq->qmgr->falcon, cmdq->head_reg, cmdq->position);
 	mutex_unlock(&cmdq->mutex);
@@ -98,6 +100,7 @@ nvkm_falcon_cmdq_close(struct nvkm_falcon_cmdq *cmdq)
 
 static int
 nvkm_falcon_cmdq_write(struct nvkm_falcon_cmdq *cmdq, struct nvfw_falcon_cmd *cmd)
+	NO_THREAD_SAFETY_ANALYSIS /* clang bug? */
 {
 	static unsigned timeout = 2000;
 	unsigned long end_jiffies = jiffies + msecs_to_jiffies(timeout);
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxch.c +2 -0
index fafc634acbf6..4d1f1c309913 100644
@@ -106,6 +106,7 @@ nvkm_i2c_aux_monitor(struct nvkm_i2c_aux *aux, bool monitor)
 
 void
 nvkm_i2c_aux_release(struct nvkm_i2c_aux *aux)
+	RELEASE(aux->mutex)
 {
 	struct nvkm_i2c_pad *pad = aux->pad;
 	AUX_TRACE(aux, "release");
@@ -115,6 +116,7 @@ nvkm_i2c_aux_release(struct nvkm_i2c_aux *aux)
 
 int
 nvkm_i2c_aux_acquire(struct nvkm_i2c_aux *aux)
+	TRY_ACQUIRE(0, aux->mutex)
 {
 	struct nvkm_i2c_pad *pad = aux->pad;
 	int ret;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.c +2 -0
index ed50cc3736b9..b3000d2beb59 100644
@@ -127,6 +127,7 @@ nvkm_i2c_bus_fini(struct nvkm_i2c_bus *bus)
 
 void
 nvkm_i2c_bus_release(struct nvkm_i2c_bus *bus)
+	RELEASE(bus->mutex)
 {
 	struct nvkm_i2c_pad *pad = bus->pad;
 	BUS_TRACE(bus, "release");
@@ -136,6 +137,7 @@ nvkm_i2c_bus_release(struct nvkm_i2c_bus *bus)
 
 int
 nvkm_i2c_bus_acquire(struct nvkm_i2c_bus *bus)
+	TRY_ACQUIRE(0, bus->mutex)
 {
 	struct nvkm_i2c_pad *pad = bus->pad;
 	int ret;
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.c +2 -0
index 2c5fcb9c504b..188d181e85af 100644
@@ -44,6 +44,7 @@ nvkm_i2c_pad_mode(struct nvkm_i2c_pad *pad, enum nvkm_i2c_pad_mode mode)
 
 void
 nvkm_i2c_pad_release(struct nvkm_i2c_pad *pad)
+	RELEASE(pad->mutex)
 {
 	PAD_TRACE(pad, "release");
 	if (pad->mode == NVKM_I2C_PAD_OFF)
@@ -53,6 +54,7 @@ nvkm_i2c_pad_release(struct nvkm_i2c_pad *pad)
 
 int
 nvkm_i2c_pad_acquire(struct nvkm_i2c_pad *pad, enum nvkm_i2c_pad_mode mode)
+	TRY_ACQUIRE(0, pad->mutex)
 {
 	PAD_TRACE(pad, "acquire");
 	mutex_lock(&pad->mutex);
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c +13 -11
index dd5b5a17ece0..612db8a0b603 100644
@@ -119,6 +119,7 @@ nv50_instobj_fast = {
 
 static void
 nv50_instobj_kmap(struct nv50_instobj *iobj, struct nvkm_vmm *vmm)
+	REQUIRES(iobj->imem->base.mutex)
 {
 	struct nv50_instmem *imem = iobj->imem;
 	struct nv50_instobj *eobj;
@@ -134,12 +135,12 @@ nv50_instobj_kmap(struct nv50_instobj *iobj, struct nvkm_vmm *vmm)
 	 * into it.  The lock has to be dropped while doing this due
 	 * to the possibility of recursion for page table allocation.
 	 */
-	mutex_unlock(&imem->base.mutex);
+	mutex_unlock(&iobj->imem->base.mutex);
 	while ((ret = nvkm_vmm_get(vmm, 12, size, &bar))) {
 		/* Evict unused mappings, and keep retrying until we either
 		 * succeed,or there's no more objects left on the LRU.
 		 */
-		mutex_lock(&imem->base.mutex);
+		mutex_lock(&iobj->imem->base.mutex);
 		eobj = list_first_entry_or_null(&imem->lru, typeof(*eobj), lru);
 		if (eobj) {
 			nvkm_debug(subdev, "evict %016llx %016llx @ %016llx\n",
@@ -152,7 +153,7 @@ nv50_instobj_kmap(struct nv50_instobj *iobj, struct nvkm_vmm *vmm)
 			emap = eobj->map;
 			eobj->map = NULL;
 		}
-		mutex_unlock(&imem->base.mutex);
+		mutex_unlock(&iobj->imem->base.mutex);
 		if (!eobj)
 			break;
 		iounmap(emap);
@@ -161,12 +162,12 @@ nv50_instobj_kmap(struct nv50_instobj *iobj, struct nvkm_vmm *vmm)
 
 	if (ret == 0)
 		ret = nvkm_memory_map(memory, 0, vmm, bar, NULL, 0);
-	mutex_lock(&imem->base.mutex);
+	mutex_lock(&iobj->imem->base.mutex);
 	if (ret || iobj->bar) {
 		/* We either failed, or another thread beat us. */
-		mutex_unlock(&imem->base.mutex);
+		mutex_unlock(&iobj->imem->base.mutex);
 		nvkm_vmm_put(vmm, &bar);
-		mutex_lock(&imem->base.mutex);
+		mutex_lock(&iobj->imem->base.mutex);
 		return;
 	}
 
@@ -190,6 +191,7 @@ nv50_instobj_map(struct nvkm_memory *memory, u64 offset, struct nvkm_vmm *vmm,
 
 static void
 nv50_instobj_release(struct nvkm_memory *memory)
+	NO_THREAD_SAFETY_ANALYSIS /* needed because of a clang bug? */
 {
 	struct nv50_instobj *iobj = nv50_instobj(memory);
 	struct nv50_instmem *imem = iobj->imem;
@@ -231,9 +233,9 @@ nv50_instobj_acquire(struct nvkm_memory *memory)
 	/* Take the lock, and re-check that another thread hasn't
 	 * already mapped the object in the meantime.
 	 */
-	mutex_lock(&imem->mutex);
+	mutex_lock(&iobj->imem->base.mutex);
 	if (refcount_inc_not_zero(&iobj->maps)) {
-		mutex_unlock(&imem->mutex);
+		mutex_unlock(&iobj->imem->base.mutex);
 		return iobj->map;
 	}
 
@@ -258,7 +260,7 @@ nv50_instobj_acquire(struct nvkm_memory *memory)
 		refcount_set(&iobj->maps, 1);
 	}
 
-	mutex_unlock(&imem->mutex);
+	mutex_unlock(&iobj->imem->base.mutex);
 	return map;
 }
 
@@ -271,7 +273,7 @@ nv50_instobj_boot(struct nvkm_memory *memory, struct nvkm_vmm *vmm)
 	/* Exclude bootstrapped objects (ie. the page tables for the
 	 * instmem BAR itself) from eviction.
 	 */
-	mutex_lock(&imem->mutex);
+	mutex_lock(&iobj->imem->base.mutex);
 	if (likely(iobj->lru.next)) {
 		list_del_init(&iobj->lru);
 		iobj->lru.next = NULL;
@@ -279,7 +281,7 @@ nv50_instobj_boot(struct nvkm_memory *memory, struct nvkm_vmm *vmm)
 
 	nv50_instobj_kmap(iobj, vmm);
 	nvkm_instmem_boot(imem);
-	mutex_unlock(&imem->mutex);
+	mutex_unlock(&iobj->imem->base.mutex);
 }
 
 static u64
drivers/gpu/drm/panthor/panthor_mmu.c +1 -0
index c39e3eb1c15d..f59ec31e6ec8 100644
@@ -813,6 +813,7 @@ int panthor_vm_active(struct panthor_vm *vm)
  * and other AS updates).
  */
 void panthor_vm_idle(struct panthor_vm *vm)
+	NO_THREAD_SAFETY_ANALYSIS /* clang bug? */
 {
 	struct panthor_device *ptdev = vm->ptdev;
 
drivers/gpu/drm/qxl/qxl_cmd.c +1 -0
index d6ea01f3797b..afcbaa317965 100644
@@ -576,6 +576,7 @@ void qxl_surface_evict(struct qxl_device *qdev, struct qxl_bo *surf, bool do_upd
 }
 
 static int qxl_reap_surf(struct qxl_device *qdev, struct qxl_bo *surf, bool stall)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	long ret;
 
drivers/gpu/drm/qxl/qxl_display.c +2 -0
index bc24af08dfcd..e2ff1e5c8433 100644
@@ -165,6 +165,7 @@ static void qxl_update_offset_props(struct qxl_device *qdev)
 }
 
 void qxl_display_read_client_monitors_config(struct qxl_device *qdev)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	struct drm_device *dev = &qdev->ddev;
 	struct drm_modeset_acquire_ctx ctx;
@@ -408,6 +409,7 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
 					 unsigned int flags, unsigned int color,
 					 struct drm_clip_rect *clips,
 					 unsigned int num_clips)
+	NO_THREAD_SAFETY_ANALYSIS /* DRM_MODESET_LOCK */
 {
 	/* TODO: vmwgfx where this was cribbed from had locking. Why? */
 	struct qxl_device *qdev = to_qxl(fb->dev);
drivers/gpu/drm/radeon/radeon_i2c.c +2 -0
index 1f16619ed06e..55bc511d748b 100644
@@ -83,6 +83,7 @@ bool radeon_ddc_probe(struct radeon_connector *radeon_connector, bool use_aux)
 /* bit banging i2c */
 
 static int pre_xfer(struct i2c_adapter *i2c_adap)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct radeon_i2c_chan *i2c = i2c_get_adapdata(i2c_adap);
 	struct radeon_device *rdev = i2c->dev->dev_private;
@@ -153,6 +154,7 @@ static int pre_xfer(struct i2c_adapter *i2c_adap)
 }
 
 static void post_xfer(struct i2c_adapter *i2c_adap)
+	NO_THREAD_SAFETY_ANALYSIS /* mutex not a member of an argument */
 {
 	struct radeon_i2c_chan *i2c = i2c_get_adapdata(i2c_adap);
 	struct radeon_device *rdev = i2c->dev->dev_private;
drivers/gpu/drm/radeon/radeon_ring.c +3 -0
index 581ae20c46e4..e9642b6644af 100644
@@ -143,6 +143,7 @@ int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsi
  * Returns 0 on success, error on failure.
  */
 int radeon_ring_lock(struct radeon_device *rdev, struct radeon_ring *ring, unsigned ndw)
+	TRY_ACQUIRE(0, rdev->ring_lock)
 {
 	int r;
 
@@ -199,6 +200,7 @@ void radeon_ring_commit(struct radeon_device *rdev, struct radeon_ring *ring,
  */
 void radeon_ring_unlock_commit(struct radeon_device *rdev, struct radeon_ring *ring,
 			       bool hdp_flush)
+	RELEASE(rdev->ring_lock)
 {
 	radeon_ring_commit(rdev, ring, hdp_flush);
 	mutex_unlock(&rdev->ring_lock);
@@ -225,6 +227,7 @@ void radeon_ring_undo(struct radeon_ring *ring)
  * Call radeon_ring_undo() then unlock the ring (all asics).
  */
 void radeon_ring_unlock_undo(struct radeon_device *rdev, struct radeon_ring *ring)
+	RELEASE(rdev->ring_lock)
 {
 	radeon_ring_undo(ring);
 	mutex_unlock(&rdev->ring_lock);
drivers/gpu/drm/rockchip/cdn-dp-core.c +1 -0
index b17de83b988b..e422013de3a8 100644
@@ -906,6 +906,7 @@ static int cdn_dp_audio_codec_init(struct cdn_dp_device *dp,
 }
 
 static int cdn_dp_request_firmware(struct cdn_dp_device *dp)
+	REQUIRES(dp->lock)
 {
 	int ret;
 	unsigned long timeout = jiffies + msecs_to_jiffies(CDN_FW_TIMEOUT_MS);
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +2 -0
index 17a98845fd31..6cd71da23798 100644
@@ -283,11 +283,13 @@ static struct vop2_win *to_vop2_win(struct drm_plane *p)
 }
 
 static void vop2_lock(struct vop2 *vop2)
+	ACQUIRE(vop2->vop2_lock)
 {
 	mutex_lock(&vop2->vop2_lock);
 }
 
 static void vop2_unlock(struct vop2 *vop2)
+	RELEASE(vop2->vop2_lock)
 {
 	mutex_unlock(&vop2->vop2_lock);
 }
drivers/gpu/drm/tegra/hdmi.c +2 -0
index e705f8590c13..92968ae352c1 100644
@@ -372,12 +372,14 @@ static const struct tmds_config tegra124_tmds_config[] = {
 };
 
 static void tegra_hdmi_audio_lock(struct tegra_hdmi *hdmi)
+	ACQUIRE(hdmi->audio_lock)
 {
 	mutex_lock(&hdmi->audio_lock);
 	disable_irq(hdmi->irq);
 }
 
 static void tegra_hdmi_audio_unlock(struct tegra_hdmi *hdmi)
+	RELEASE(hdmi->audio_lock)
 {
 	enable_irq(hdmi->irq);
 	mutex_unlock(&hdmi->audio_lock);
drivers/gpu/drm/ttm/tests/ttm_bo_test.c +1 -0
index f8f20d2f6174..1c74babea1e7 100644
@@ -137,6 +137,7 @@ static void ttm_bo_reserve_double_resv(struct kunit *test)
  * propagates that error.
  */
 static void ttm_bo_reserve_deadlock(struct kunit *test)
+	NO_THREAD_SAFETY_ANALYSIS /* intentional lock/unlock mismatch */
 {
 	struct ttm_buffer_object *bo1, *bo2;
 	struct ww_acquire_ctx ctx1, ctx2;
drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c +6 -1
index dd4ca6a9c690..5569e7e9d82b 100644
@@ -276,6 +276,7 @@ static int vmw_fifo_wait(struct vmw_private *dev_priv,
  */
 static void *vmw_local_fifo_reserve(struct vmw_private *dev_priv,
 				    uint32_t bytes)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	struct vmw_fifo_state *fifo_state = dev_priv->fifo;
 	u32  *fifo_mem = dev_priv->fifo_mem;
@@ -425,6 +426,8 @@ static void vmw_fifo_slow_copy(struct vmw_fifo_state *fifo_state,
 }
 
 static void vmw_local_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes)
+	RELEASE(dev_priv->fifo->fifo_mutex)
+	RELEASE(dev_priv->fifo->fifo_mutex)
 {
 	struct vmw_fifo_state *fifo_state = dev_priv->fifo;
 	uint32_t next_cmd = vmw_fifo_mem_read(dev_priv, SVGA_FIFO_NEXT_CMD);
@@ -466,10 +469,11 @@ static void vmw_local_fifo_commit(struct vmw_private *dev_priv, uint32_t bytes)
 	mb();
 	up_write(&fifo_state->rwsem);
 	vmw_fifo_ping_host(dev_priv, SVGA_SYNC_GENERIC);
-	mutex_unlock(&fifo_state->fifo_mutex);
+	mutex_unlock(&dev_priv->fifo->fifo_mutex);
 }
 
 void vmw_cmd_commit(struct vmw_private *dev_priv, uint32_t bytes)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (dev_priv->cman)
 		vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, false);
@@ -485,6 +489,7 @@ void vmw_cmd_commit(struct vmw_private *dev_priv, uint32_t bytes)
  * @bytes: Number of bytes to commit.
  */
 void vmw_cmd_commit_flush(struct vmw_private *dev_priv, uint32_t bytes)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	if (dev_priv->cman)
 		vmw_cmdbuf_commit(dev_priv->cman, bytes, NULL, true);
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +5 -0
index 94e8982f5616..9382884053c4 100644
@@ -204,6 +204,7 @@ static int vmw_cmdbuf_preempt(struct vmw_cmdbuf_man *man, u32 context);
  * @interruptible: Whether to wait interruptible when locking.
  */
 static int vmw_cmdbuf_cur_lock(struct vmw_cmdbuf_man *man, bool interruptible)
+	TRY_ACQUIRE(0, &man->cur_mutex)
 {
 	if (interruptible) {
 		if (mutex_lock_interruptible(&man->cur_mutex))
@@ -221,6 +222,7 @@ static int vmw_cmdbuf_cur_lock(struct vmw_cmdbuf_man *man, bool interruptible)
  * @man: The range manager.
  */
 static void vmw_cmdbuf_cur_unlock(struct vmw_cmdbuf_man *man)
+	RELEASE(&man->cur_mutex)
 {
 	mutex_unlock(&man->cur_mutex);
 }
@@ -999,6 +1001,7 @@ static void *vmw_cmdbuf_reserve_cur(struct vmw_cmdbuf_man *man,
 				    size_t size,
 				    int ctx_id,
 				    bool interruptible)
+	NO_THREAD_SAFETY_ANALYSIS /* returns a pointer */
 {
 	struct vmw_cmdbuf_header *cur;
 	void *ret;
@@ -1043,6 +1046,7 @@ static void *vmw_cmdbuf_reserve_cur(struct vmw_cmdbuf_man *man,
  */
 static void vmw_cmdbuf_commit_cur(struct vmw_cmdbuf_man *man,
 				  size_t size, bool flush)
+	RELEASE(man->cur_mutex)
 {
 	struct vmw_cmdbuf_header *cur = man->cur;
 
@@ -1100,6 +1104,7 @@ void *vmw_cmdbuf_reserve(struct vmw_cmdbuf_man *man, size_t size,
  */
 void vmw_cmdbuf_commit(struct vmw_cmdbuf_man *man, size_t size,
 		       struct vmw_cmdbuf_header *header, bool flush)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional unlock */
 {
 	if (!header) {
 		vmw_cmdbuf_commit_cur(man, size, flush);
drivers/gpu/drm/vmwgfx/vmwgfx_validation.c +3 -0
index e7625b3f71e0..12be07c3ef6f 100644
@@ -692,6 +692,7 @@ void vmw_validation_unref_lists(struct vmw_validation_context *ctx)
 int vmw_validation_prepare(struct vmw_validation_context *ctx,
 			   struct mutex *mutex,
 			   bool intr)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	int ret = 0;
 
@@ -743,6 +744,7 @@ int vmw_validation_prepare(struct vmw_validation_context *ctx,
  * The caller still needs to unref resources after a call to this function.
  */
 void vmw_validation_revert(struct vmw_validation_context *ctx)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional unlock */
 {
 	vmw_validation_bo_backoff(ctx);
 	vmw_validation_res_unreserve(ctx, true);
@@ -762,6 +764,7 @@ void vmw_validation_revert(struct vmw_validation_context *ctx)
  */
 void vmw_validation_done(struct vmw_validation_context *ctx,
 			 struct vmw_fence_obj *fence)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional unlock */
 {
 	vmw_validation_bo_fence(ctx, fence);
 	vmw_validation_res_unreserve(ctx, false);
drivers/gpu/drm/xe/xe_migrate.c +1 -0
index 278bc96cf593..e022018e8f0d 100644
@@ -1308,6 +1308,7 @@ static struct dma_fence *
 __xe_migrate_update_pgtables(struct xe_migrate *m,
 			     struct xe_migrate_pt_update *pt_update,
 			     struct xe_vm_pgtable_update_ops *pt_update_ops)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	const struct xe_migrate_pt_update_ops *ops = pt_update->ops;
 	struct xe_tile *tile = m->tile;
drivers/gpu/drm/xe/xe_pcode.c +1 -0
index 9333ce776a6e..62ae48080bb5 100644
@@ -268,6 +268,7 @@ int xe_pcode_init_min_freq_table(struct xe_tile *tile, u32 min_gt_freq,
  * Returns 0 on success, and -error number on failure.
  */
 int xe_pcode_ready(struct xe_device *xe, bool locked)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	u32 status, request = DGFX_GET_INIT_STATUS;
 	struct xe_tile *tile = xe_device_get_root_tile(xe);
drivers/gpu/host1x/bus.c +2 -0
index 8e09d6d328d2..ac1f61b022ac 100644
@@ -884,6 +884,7 @@ EXPORT_SYMBOL(host1x_client_resume);
 struct host1x_bo_mapping *host1x_bo_pin(struct device *dev, struct host1x_bo *bo,
 					enum dma_data_direction dir,
 					struct host1x_bo_cache *cache)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct host1x_bo_mapping *mapping;
 
@@ -943,6 +944,7 @@ static void __host1x_bo_unpin(struct kref *ref)
 }
 
 void host1x_bo_unpin(struct host1x_bo_mapping *mapping)
+	NO_THREAD_SAFETY_ANALYSIS /* conditional locking */
 {
 	struct host1x_bo_cache *cache = mapping->cache;
 
drivers/gpu/host1x/cdma.c +6 -0
index 407ed9b9cf64..3b491105acd1 100644
@@ -184,6 +184,7 @@ static u32 host1x_pushbuffer_space(struct push_buffer *pb)
  */
 unsigned int host1x_cdma_wait_locked(struct host1x_cdma *cdma,
 				     enum cdma_event event)
+	REQUIRES(cdma->lock)
 {
 	for (;;) {
 		struct push_buffer *pb = &cdma->push_buffer;
@@ -235,6 +236,7 @@ unsigned int host1x_cdma_wait_locked(struct host1x_cdma *cdma,
 static int host1x_cdma_wait_pushbuffer_space(struct host1x *host1x,
 					     struct host1x_cdma *cdma,
 					     unsigned int needed)
+	REQUIRES(cdma->lock)
 {
 	while (true) {
 		struct push_buffer *pb = &cdma->push_buffer;
@@ -546,6 +548,7 @@ int host1x_cdma_deinit(struct host1x_cdma *cdma)
  * Begin a cdma submit
  */
 int host1x_cdma_begin(struct host1x_cdma *cdma, struct host1x_job *job)
+	TRY_ACQUIRE(0, cdma->lock)
 {
 	struct host1x *host1x = cdma_to_host1x(cdma);
 
@@ -590,6 +593,7 @@ int host1x_cdma_begin(struct host1x_cdma *cdma, struct host1x_job *job)
  * Blocks as necessary if the push buffer is full.
  */
 void host1x_cdma_push(struct host1x_cdma *cdma, u32 op1, u32 op2)
+	REQUIRES(cdma->lock)
 {
 	struct host1x *host1x = cdma_to_host1x(cdma);
 	struct push_buffer *pb = &cdma->push_buffer;
@@ -621,6 +625,7 @@ void host1x_cdma_push(struct host1x_cdma *cdma, u32 op1, u32 op2)
  */
 void host1x_cdma_push_wide(struct host1x_cdma *cdma, u32 op1, u32 op2,
 			   u32 op3, u32 op4)
+	REQUIRES(cdma->lock)
 {
 	struct host1x_channel *channel = cdma_to_channel(cdma);
 	struct host1x *host1x = cdma_to_host1x(cdma);
@@ -664,6 +669,7 @@ void host1x_cdma_push_wide(struct host1x_cdma *cdma, u32 op1, u32 op2,
  */
 void host1x_cdma_end(struct host1x_cdma *cdma,
 		     struct host1x_job *job)
+	RELEASE(cdma->lock)
 {
 	struct host1x *host1x = cdma_to_host1x(cdma);
 	bool idle = list_empty(&cdma->sync_queue);
drivers/gpu/host1x/context.c +1 -0
index a6f6779662a3..5fca1b3c3672 100644
@@ -165,6 +165,7 @@ void host1x_memory_context_get(struct host1x_memory_context *cd)
 EXPORT_SYMBOL_GPL(host1x_memory_context_get);
 
 void host1x_memory_context_put(struct host1x_memory_context *cd)
+	NO_THREAD_SAFETY_ANALYSIS /* clang bug? */
 {
 	struct host1x_memory_context_list *cdl = &cd->host->context_list;
 
drivers/gpu/host1x/mipi.c +2 -0
index e51b43dd15a3..253271a49c58 100644
@@ -294,6 +294,7 @@ int tegra_mipi_disable(struct tegra_mipi_device *dev)
 EXPORT_SYMBOL(tegra_mipi_disable);
 
 int tegra_mipi_finish_calibration(struct tegra_mipi_device *device)
+	RELEASE(device->mipi->lock)
 {
 	struct tegra_mipi *mipi = device->mipi;
 	void __iomem *status_reg = mipi->regs + (MIPI_CAL_STATUS << 2);
@@ -312,6 +313,7 @@ int tegra_mipi_finish_calibration(struct tegra_mipi_device *device)
 EXPORT_SYMBOL(tegra_mipi_finish_calibration);
 
 int tegra_mipi_start_calibration(struct tegra_mipi_device *device)
+	TRY_ACQUIRE(0, device->mipi->lock)
 {
 	const struct tegra_mipi_soc *soc = device->mipi->soc;
 	unsigned int i;
drivers/hid/hid-wiimote.h +3 -0
index 9c12f63f6dd2..066948f6ef91 100644
@@ -319,11 +319,13 @@ static inline void wiimote_cmd_abort(struct wiimote_data *wdata)
 }
 
 static inline int wiimote_cmd_acquire(struct wiimote_data *wdata)
+	TRY_ACQUIRE(0, wdata->state.sync)
 {
 	return mutex_lock_interruptible(&wdata->state.sync) ? -ERESTARTSYS : 0;
 }
 
 static inline void wiimote_cmd_acquire_noint(struct wiimote_data *wdata)
+	ACQUIRE(wdata->state.sync)
 {
 	mutex_lock(&wdata->state.sync);
 }
@@ -338,6 +340,7 @@ static inline void wiimote_cmd_set(struct wiimote_data *wdata, int cmd,
 }
 
 static inline void wiimote_cmd_release(struct wiimote_data *wdata)
+	RELEASE(wdata->state.sync)
 {
 	mutex_unlock(&wdata->state.sync);
 }
drivers/hv/channel.c +2 -0
index fb8cd8469328..f84627d9c07b 100644
@@ -229,6 +229,7 @@ static int send_modifychannel_without_ack(struct vmbus_channel *channel, u32 tar
 }
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

drivers/hwmon/abituguru.c +2 -0
index ba8c68ae4595..7949fccf4c2c 100644

Lines of this file are not shown. View the raw message.

drivers/hwmon/abituguru3.c +2 -0
index b70330dc2198..033a5a28b391 100644

Lines of this file are not shown. View the raw message.

drivers/hwmon/it87.c +2 -0
index 8e3935089fca..281f0aef160d 100644

Lines of this file are not shown. View the raw message.

drivers/hwmon/lm78.c +1 -0
index 8b53bb312069..3ede64872c38 100644

Lines of this file are not shown. View the raw message.

drivers/hwmon/nct7904.c +2 -0
index f1e6eda949ba..33105fee353b 100644

Lines of this file are not shown. View the raw message.

drivers/hwmon/pmbus/pmbus_core.c +1 -0
index 787683e83db6..873952c8bc88 100644

Lines of this file are not shown. View the raw message.

drivers/hwmon/w83781d.c +1 -0
index 076200ed2ec9..4488c9928bab 100644

Lines of this file are not shown. View the raw message.

drivers/hwtracing/intel_th/msu.c +1 -0
index 66123d684ac9..62ff3e269b6e 100644

Lines of this file are not shown. View the raw message.

drivers/hwtracing/stm/policy.c +2 -0
index 42103c3a177f..84aa24b524e7 100644

Lines of this file are not shown. View the raw message.

drivers/i2c/busses/i2c-amd-mp2-pci.c +2 -0
index 143165300949..31f96f31a211 100644

Lines of this file are not shown. View the raw message.

drivers/i2c/busses/i2c-xiic.c +1 -0
index dc1e46d834dc..801b89004437 100644

Lines of this file are not shown. View the raw message.

drivers/i2c/i2c-atr.c +3 -0
index 8fe9ddff8e96..7049b713b6a6 100644

Lines of this file are not shown. View the raw message.

drivers/iio/accel/kionix-kx022a.c +3 -0
index 5aeb3b951ac5..aaeb080e8ea1 100644

Lines of this file are not shown. View the raw message.

drivers/iio/adc/meson_saradc.c +2 -0
index 997def4a4d2f..83880f251199 100644

Lines of this file are not shown. View the raw message.

drivers/iio/buffer/industrialio-buffer-dma.c +2 -0
index 7ea784304ffb..36220093595c 100644

Lines of this file are not shown. View the raw message.

drivers/iio/industrialio-core.c +4 -0
index a2117ad1337d..422a73f74a6b 100644

Lines of this file are not shown. View the raw message.

drivers/iio/light/opt3001.c +1 -0
index 65b295877b41..c75ef93ef5ba 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/core/cma.c +5 -0
index 91db10515d74..913cb9a99b22 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/core/security.c +1 -0
index 3512c2e54efc..f8e3240555e5 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/core/umem_odp.c +1 -0
index e9fa22d31c23..bd7af14e4570 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/hw/hns/hns_roce_hem.c +2 -0
index 605562122ecc..2d8eed3c8fc5 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/hw/mlx4/main.c +2 -0
index dd35e03402ab..b22e5907507e 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/hw/mlx5/mr.c +1 -0
index bb02b6adbf2c..45f9183dc4b0 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/hw/mlx5/odp.c +1 -0
index f1e23583e6c0..582a0450350f 100644

Lines of this file are not shown. View the raw message.

drivers/infiniband/hw/mlx5/umr.c +2 -0
index 887fd6fa3ba9..ee7bcb147c83 100644

Lines of this file are not shown. View the raw message.

drivers/input/input.c +3 -0
index c9e3ac64bcd0..36f1a6f2f372 100644

Lines of this file are not shown. View the raw message.

drivers/input/joystick/pxrc.c +2 -0
index 52d9eab667b7..4ec4cb9ef87e 100644

Lines of this file are not shown. View the raw message.

drivers/input/keyboard/adp5588-keys.c +2 -0
index dc734974ce06..4f05e0d2e9e0 100644

Lines of this file are not shown. View the raw message.

drivers/input/misc/ati_remote2.c +2 -0
index e84649af801d..f4d045d92746 100644

Lines of this file are not shown. View the raw message.

drivers/input/misc/cm109.c +2 -0
index 0cfe5d4a573c..5084e6747612 100644

Lines of this file are not shown. View the raw message.

drivers/input/mouse/psmouse-base.c +1 -0
index a2c9f7144864..9d29f2f83161 100644

Lines of this file are not shown. View the raw message.

drivers/input/mouse/synaptics_usb.c +2 -0
index 75e45f3ae675..9b748e54286e 100644

Lines of this file are not shown. View the raw message.

drivers/input/serio/i8042.c +2 -0
index cab5a4c5baf5..24cb643f0bdf 100644

Lines of this file are not shown. View the raw message.

drivers/input/serio/libps2.c +2 -0
index c22ea532276e..3a92bef2ba3b 100644

Lines of this file are not shown. View the raw message.

drivers/iommu/iommufd/device.c +2 -0
index dfd0898fb6c1..da5325a60508 100644

Lines of this file are not shown. View the raw message.

drivers/iommu/iommufd/hw_pagetable.c +1 -0
index 598be26a14e2..71d1f5984166 100644

Lines of this file are not shown. View the raw message.

drivers/md/bcache/alloc.c +2 -0
index 8998e61efa40..bd2d18deeaee 100644

Lines of this file are not shown. View the raw message.

drivers/md/bcache/btree.c +1 -0
index ed40d8600656..d434539a71f0 100644

Lines of this file are not shown. View the raw message.

drivers/md/bcache/super.c +2 -0
index e42f1400cea9..7f7e72ac8827 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-bufio.c +2 -0
index aab8240429b0..1d1794fbe957 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-crypt.c +1 -0
index 02a2919f4e5a..9c6addf42bb8 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-vdo/indexer/index-session.c +1 -0
index aee0914d604a..d689ea1a097c 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-vdo/indexer/volume-index.c +3 -0
index 12f954a0c532..c0ec47645510 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-vdo/indexer/volume.c +1 -0
index 655453bb276b..be2344de7595 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-writecache.c +6 -0
index 7ce8847b3404..b1634602cfb1 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm-zoned-metadata.c +6 -0
index deff22ecccbb..7233461dd6aa 100644

Lines of this file are not shown. View the raw message.

drivers/md/dm.c +5 -0
index 4d1e42891d24..25b79dfe93ba 100644

Lines of this file are not shown. View the raw message.

drivers/md/md-cluster.c +10 -2
index 6595f89becdb..651c66388e96 100644

Lines of this file are not shown. View the raw message.

drivers/md/md.c +8 -0
index 30b3dbbce2d2..29179f257312 100644

Lines of this file are not shown. View the raw message.

drivers/md/md.h +8 -1
index def808064ad8..11b5542ec4d2 100644

Lines of this file are not shown. View the raw message.

drivers/media/cec/core/cec-adap.c +5 -0
index ba6828ef540e..dfc5e6057a03 100644

Lines of this file are not shown. View the raw message.

drivers/media/common/videobuf2/videobuf2-core.c +2 -0
index 2df566f409b6..6f71eabfaca1 100644

Lines of this file are not shown. View the raw message.

drivers/media/common/videobuf2/videobuf2-v4l2.c +7 -0
index 9201d854dbcc..fd9bf6cfd3ab 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-core/dvb_frontend.c +1 -0
index a05aa271a1ba..ddd59c547e28 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-core/dvb_vb2.c +2 -0
index 29edaaff7a5c..123d358c493f 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/dib9000.c +1 -0
index e71b3670ba1e..3bfdaf1c100b 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/stv090x.c +2 -0
index f273efa330cf..e8187c13776f 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/stv0910.c +1 -0
index 069dec75129c..645488bf0dd7 100644

Lines of this file are not shown. View the raw message.

drivers/media/dvb-frontends/ts2020.c +2 -0
index e25add6cc38e..3f727056d8a4 100644

Lines of this file are not shown. View the raw message.

drivers/media/mc/mc-device.c +1 -0
index c0dd4ae57227..ec714d12c849 100644

Lines of this file are not shown. View the raw message.

drivers/media/mc/mc-entity.c +1 -0
index 045590905582..8c50b6e9860f 100644

Lines of this file are not shown. View the raw message.

drivers/media/pci/cx18/cx18-alsa.h +2 -0
index 6d8685fe3283..8fee48127cd8 100644

Lines of this file are not shown. View the raw message.

drivers/media/pci/ddbridge/ddbridge-core.c +1 -0
index 40e6c873c36d..fa3fa0e050fe 100644

Lines of this file are not shown. View the raw message.

drivers/media/pci/ivtv/ivtv-alsa.h +2 -0
index d9f685b1c57e..aacb08829a42 100644

Lines of this file are not shown. View the raw message.

drivers/media/pci/ivtv/ivtv-fileops.c +2 -0
index cfa28d035586..7f6e76419f9a 100644

Lines of this file are not shown. View the raw message.

drivers/media/pci/ivtv/ivtv-ioctl.c +3 -0
index 7947dcd615e8..93ea32adc997 100644

Lines of this file are not shown. View the raw message.

drivers/media/pci/ivtv/ivtv-yuv.c +3 -0
index 2d9274537725..8230c179085b 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/amphion/vpu_v4l2.c +3 -0
index 45707931bc4f..98404b04f0c4 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/chips-media/coda/coda-jpeg.c +1 -0
index 5746892658b1..b8cbacf29363 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c +2 -0
index 98838217b97d..8bd955ffd2d8 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_pm.c +2 -0
index aefd3e9e3061..85eaf8be4180 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c +2 -0
index a01dc25a7699..9bdf0f8a460b 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/nvidia/tegra-vde/h264.c +5 -0
index 0e56a4331b0d..8a0eee735b0a 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/nvidia/tegra-vde/vde.c +2 -0
index 3232392c60e2..a236166e8bb7 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/samsung/exynos4-is/media-dev.h +2 -0
index a50e58ab7ef7..b40d3f6bee5e 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +2 -0
index 5f80931f056d..d99c77dc9679 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/st/sti/hva/hva-hw.c +1 -0
index fcb18fb52fdd..816b5af35d63 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/ti/omap3isp/ispvideo.c +2 -0
index 5c9aa80023fd..dfe35d4ad2bf 100644

Lines of this file are not shown. View the raw message.

drivers/media/test-drivers/vivid/vivid-kthread-cap.c +1 -0
index 669bd96da4c7..0c7be90e4486 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/dvb-usb-v2/mxl111sf.c +2 -0
index cd5861a30b6f..06339728a593 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/dvb-usb/cxusb-analog.c +1 -0
index 8253046cd6e6..8b36068795f3 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/dvb-usb/cxusb.c +1 -0
index 23f7931ccd95..ee6ae5c22348 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/go7007/go7007-i2c.c +3 -0
index f6ce28a4a768..ceb4f378e973 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/finepix.c +1 -0
index bc6133b525e3..2ad7d9d91151 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/jl2005bcd.c +1 -0
index a408fcc3a060..51c3338884e6 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/sn9c20x.c +1 -0
index da916127a896..2a9853092191 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/sonixj.c +1 -0
index 2e1bd2df8304..92c1ab1397b2 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/sq905.c +2 -0
index 32504ebcfd4d..af659fbf4072 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/sq905c.c +1 -0
index 6ca947aef298..bceddf488c62 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/vicam.c +1 -0
index d98343fd33fe..ccd3fbbb46ff 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/gspca/zc3xx.c +1 -0
index 5bcbf0d40147..4b963339eff7 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/hdpvr/hdpvr-video.c +1 -0
index fd7d2a9d0449..3b5fc6e55daf 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/pvrusb2/pvrusb2-context.c +2 -0
index 73c95ba2328a..e348aceb20e6 100644

Lines of this file are not shown. View the raw message.

drivers/media/usb/uvc/uvc_ctrl.c +1 -0
index 043dceb77754..07617b9f22c1 100644

Lines of this file are not shown. View the raw message.

drivers/media/v4l2-core/v4l2-event.c +1 -0
index 3898ff7edddb..239b9ccef1ef 100644

Lines of this file are not shown. View the raw message.

drivers/media/v4l2-core/v4l2-ioctl.c +1 -0
index 0304daa8471d..49bc238bff89 100644

Lines of this file are not shown. View the raw message.

drivers/media/v4l2-core/v4l2-mem2mem.c +1 -0
index eb22d6172462..97616eabfa16 100644

Lines of this file are not shown. View the raw message.

drivers/media/v4l2-core/v4l2-subdev.c +1 -0
index cde1774c9098..e48fdb07b133 100644

Lines of this file are not shown. View the raw message.

drivers/message/fusion/mptctl.c +8 -3
index 77fa55df70d0..3cec6a388dc0 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/88pm860x-core.c +2 -0
index 8e68b64bd7f8..2f1a6f6ccbc9 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/atc260x-core.c +2 -0
index 6b6d5f1b9d76..b94f664cc7e4 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/kempld-core.c +2 -0
index c5bfb6440a93..ddfbb18f7a2c 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/lp8788-irq.c +2 -0
index 39006297f3d2..530851ce5f3d 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/max8925-core.c +2 -0
index 105d79b91493..568f19b954ad 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/max8997-irq.c +2 -0
index 93a3b1698d9c..ebd6a0f23c47 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/max8998-irq.c +2 -0
index 83b6f510bc05..a2beabb9d5cf 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/mc13xxx-core.c +2 -0
index 920797b806ce..0a62264ee645 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/mt6358-irq.c +2 -0
index 49830b526ee8..e55f5021df12 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/mt6397-irq.c +2 -0
index 1310665200ed..a6cb40d12484 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/rc5t583-irq.c +2 -0
index 97f52b671520..e6ceeebab642 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/stmfx.c +2 -0
index f391c2ccaa72..29893d4240c6 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/stmpe.c +2 -0
index 9c3cf58457a7..7d7c916e2234 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/tps65217.c +2 -0
index 029ecc32f078..56f095a36883 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/tps6586x.c +2 -0
index 82714899efb2..8b61f9737a10 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/twl4030-irq.c +2 -0
index 87496c1cb8bc..5492af7418f7 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/wm831x-irq.c +2 -0
index f1f58e3149ae..b4a535df2d78 100644

Lines of this file are not shown. View the raw message.

drivers/mfd/wm8350-irq.c +2 -0
index 3709ba3088c0..cd7ac13aacb1 100644

Lines of this file are not shown. View the raw message.

drivers/misc/cardreader/rtsx_usb.c +2 -0
index e0174da5e9fc..db464375bc5f 100644

Lines of this file are not shown. View the raw message.

drivers/misc/mei/client.c +7 -0
index be011cef12e5..ee4fd92a65c1 100644

Lines of this file are not shown. View the raw message.

drivers/misc/mei/hbm.c +1 -0
index 026b1f686c16..5b2f07406dc7 100644

Lines of this file are not shown. View the raw message.

drivers/misc/mei/hw-me.c +9 -0
index d11a0740b47c..1e1ad534862c 100644

Lines of this file are not shown. View the raw message.

drivers/misc/mei/hw-txe.c +4 -0
index 5d0f68b95c29..3a43b41c214b 100644

Lines of this file are not shown. View the raw message.

drivers/misc/mei/main.c +1 -0
index 1f5aaf16e300..bff07f3166b0 100644

Lines of this file are not shown. View the raw message.

drivers/misc/ntsync.c +2 -0
index 055395cde42b..b5772f4eb66f 100644

Lines of this file are not shown. View the raw message.

drivers/misc/sgi-gru/grufault.c +3 -0
index 3557d78ee47a..1ddaa6e29765 100644

Lines of this file are not shown. View the raw message.

drivers/misc/sgi-gru/grumain.c +1 -0
index 3036c15f3689..e30ebc1fba15 100644

Lines of this file are not shown. View the raw message.

drivers/misc/vmw_vmci/vmci_queue_pair.c +2 -0
index 73d71c4ec139..7f29f76142fa 100644

Lines of this file are not shown. View the raw message.

drivers/mmc/host/vub300.c +2 -0
index fd67c0682b38..d7aeb08ac82e 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/chips/cfi_cmdset_0001.c +4 -0
index c10693ba265b..344a2f5e2194 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/chips/cfi_cmdset_0002.c +6 -0
index 7c91429a670b..ebdf7a98b74b 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/lpddr/lpddr_cmds.c +4 -0
index 14e36ae71958..fddf37415a6c 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/ecc-mtk.c +2 -0
index c75bb8b80cc1..4cc57bc50f30 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/ecc-mxic.c +2 -0
index 56b56f726b99..325e7157dd0e 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/raw/atmel/pmecc.c +2 -0
index 3c7dee1be21d..cdbac3965a54 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/nand/raw/nand_base.c +4 -0
index 53e16d39af4b..01b8d2342363 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/spi-nor/controllers/hisi-sfc.c +2 -0
index db948da2c4c5..95312947f226 100644

Lines of this file are not shown. View the raw message.

drivers/mtd/spi-nor/core.c +6 -0
index 19eb98bd6821..b4a83d730a4b 100644

Lines of this file are not shown. View the raw message.

drivers/net/can/softing/softing_main.c +1 -0
index 278ee8722770..d0d73cd3bda9 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/microchip/ksz_common.c +2 -0
index 89f0796894af..87bc7200915d 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/microchip/ksz_common.h +2 -0
index af17a9c030d4..c1ed90649a46 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/microchip/ksz_ptp.c +2 -0
index 22fb9ef4645c..c54ba809f84b 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/mt7530-mdio.c +2 -0
index 51df42ccdbe6..26174927160f 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/mt7530.c +2 -0
index 1c83af805209..c35bb3f9b34d 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/mv88e6xxx/chip.c +3 -0
index 68d1e891752b..964cd966b3b2 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/mv88e6xxx/chip.h +2 -0
index 86bf113c9bfa..0bf49514adc9 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/mv88e6xxx/global2.c +2 -0
index b2b5f6ba438f..cbc8c85e45f9 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/mv88e6xxx/pcs-6352.c +2 -0
index 143fe21d1834..0608f388cd43 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/mv88e6xxx/phy.c +2 -0
index 8bb88b3d900d..1be6fbaf09e8 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/qca/ar9331.c +2 -0
index e9f2c67bc15f..98c9f30af6ca 100644

Lines of this file are not shown. View the raw message.

drivers/net/dsa/realtek/rtl83xx.c +2 -0
index 2b9bd4462714..92a0d8ef2ada 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +2 -0
index 268399dfcf22..b40079345487 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +2 -0
index a8e07e51418f..7b2c94ca56ed 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +2 -0
index 12198fc3ab22..a05ad1f19a84 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +2 -0
index 8946a931e87e..300c8a7fdbcd 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c +2 -0
index d2fd2d04ed47..dfcdee91693f 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/broadcom/tg3.c +1 -0
index 1c94bf1db718..4a1c9dacf4dc 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/davicom/dm9000.c +1 -0
index b87eaf0c250c..914a18a38082 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/davicom/dm9051.c +2 -0
index 59ea48d4c9de..150c3f5e6d72 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/emulex/benet/be_cmds.c +2 -0
index 61adcebeef01..a1c571634b6e 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +2 -0
index 29886a8ba73f..95b794a048c0 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/hisilicon/hns3/hnae3.c +2 -0
index b25fb400f476..24a1cc961bee 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +1 -0
index 3f17b3073e50..2b25e1d0f9d2 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/e1000e/82571.c +3 -0
index 969f855a79ee..792f9516b5af 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/e1000e/ich8lan.c +2 -0
index 2f9655cf5dd9..5fad4138efca 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/iavf/iavf_main.c +1 -0
index 852e5b62f0a5..70ffb4a70b4a 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/ice/ice_common.c +1 -0
index 7a2a2e8da8fa..a1b16affc239 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/ice/ice_ddp.c +2 -0
index 03988be03729..112322437de2 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/ice/ice_ethtool.c +1 -0
index f241493a6ac8..8bf1cfe4dafc 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/ice/ice_main.c +1 -0
index c3a0fb97c5ee..0faf8e7de688 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/ice/ice_vf_lib.c +1 -0
index c7c0c2f50c26..6199c014bd6b 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/intel/idpf/idpf.h +2 -0
index 66544faab710..30507e95eeef 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +3 -0
index 613655fcd34f..65b0463ead33 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +1 -0
index 1b765045aa63..88de16a09c3a 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/marvell/octeontx2/nic/rep.c +1 -0
index 04e08e06f30f..c487f46be0e8 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/marvell/prestera/prestera_counter.c +4 -0
index 4cd53a2dae46..57a3f2d9513f 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/marvell/prestera/prestera_pci.c +2 -0
index 35857dc19542..d892ab44d1ed 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx4/cmd.c +2 -0
index 7f20813456e2..7bed674675e3 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx4/port.c +5 -0
index 4e43f4a7d246..fdefa2ed82b2 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en/mod_hdr.c +1 -0
index cf60f0a3ff23..1c46b264926e 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +2 -0
index 25d751eba99b..2f9bf6512119 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c +1 -0
index a4263137fef5..a2f451ab7f4e 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c +1 -0
index 0c97c5899904..62f92307a209 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c +1 -0
index 8afcec0c5d3c..4890b25be461 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +3 -0
index e7e01f3298ef..8e7b6f43b673 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -0
index 9ba99609999f..ef0d8e259a3b 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +2 -0
index 8b7c843446e1..206756f14998 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/main.c +2 -0
index ec956c4bcebd..abd92b179884 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c +2 -0
index 3dbd4efa21a2..8164182be354 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_types.h +6 -0
index 7618c6147f86..a4298523c38c 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/micrel/ks8851_spi.c +2 -0
index 3062cc0f9199..59ddb851402e 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/microchip/encx24j600-regmap.c +2 -0
index 26b00e66d912..627302448b21 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/microchip/vcap/vcap_api.c +4 -0
index 2687765abe52..a68cdbbf6abe 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cppcore.c +2 -0
index 669f9f8fb507..d791ed542ec2 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/qlogic/qed/qed_ll2.c +1 -0
index ab5ef254a748..8686715d62c4 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/qlogic/qed/qed_vf.c +3 -1
index 0e265ed1f501..b57737f740d5 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/qlogic/qede/qede_main.c +7 -0
index 99df00c30b8c..7a50b3011c14 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/sfc/ef10_sriov.c +1 -0
index 9aae0d8b713f..c179142bee1c 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/sfc/efx_common.c +5 -0
index c88ec3e24836..88719d34dc31 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/sfc/falcon/efx.c +2 -0
index b07f7e4e2877..001341e9eb4b 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/sfc/mcdi_filters.c +1 -0
index 6ef96292909a..dc4124609522 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/sfc/siena/efx_common.c +3 -0
index a0966f879664..006277dff8a2 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/xilinx/xilinx_axienet.h +2 -0
index a3f4f3e42587..c0b2e92b548f 100644

Lines of this file are not shown. View the raw message.

drivers/net/macsec.c +1 -0
index 1bc1e5993f56..3662ee5f9b5c 100644

Lines of this file are not shown. View the raw message.

drivers/net/mctp/mctp-i3c.c +2 -0
index 360eb6490483..4c3f54b0724e 100644

Lines of this file are not shown. View the raw message.

drivers/net/phy/dp83640.c +2 -0
index 85e231451093..74926c82dbd0 100644

Lines of this file are not shown. View the raw message.

drivers/net/phy/phy-core.c +3 -0
index 6bf3ec985f3d..522c5f541793 100644

Lines of this file are not shown. View the raw message.

drivers/net/phy/phy_device.c +1 -0
index 46713d27412b..9c0f243946c6 100644

Lines of this file are not shown. View the raw message.

drivers/net/phy/sfp-bus.c +1 -0
index f13c00b5b449..44edda4264ce 100644

Lines of this file are not shown. View the raw message.

drivers/net/pse-pd/pse_core.c +1 -1
index 4f2a54afc4d0..2bd7cdbfd81f 100644

Lines of this file are not shown. View the raw message.

drivers/net/team/team_core.c +2 -0
index dc7cbd6a9798..e1f57b42043a 100644

Lines of this file are not shown. View the raw message.

drivers/net/tun.c +1 -0
index 28624cca91f8..3cd6895c372d 100644

Lines of this file are not shown. View the raw message.

drivers/net/usb/hso.c +2 -0
index 1aeb36119d3f..0a2f74c4196d 100644

Lines of this file are not shown. View the raw message.

drivers/net/usb/lan78xx.c +2 -0
index a91bf9c7e31d..d6ae59e9130f 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/ath/ath6kl/sdio.c +1 -0
index 9ab091044706..7f4b46e70e82 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/ath/ath9k/hif_usb.c +1 -0
index fe9abe8cd268..ed78d921f6b1 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/ath/wil6210/main.c +1 -0
index 94e61dbe94f8..2effccfa66f8 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/ath/wil6210/p2p.c +2 -0
index f26bf046d889..f064e8b3144b 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/broadcom/b43/main.c +1 -0
index 25b4ef9d3c9a..f0082730e867 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/broadcom/b43legacy/main.c +1 -0
index 2370a2e6a2e3..0dfcf78de907 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c +2 -0
index 41eafcda77f7..0b9e60152390 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/intel/iwlwifi/dvm/lib.c +1 -0
index 1dc974e2c511..0d05fc53a356 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/intel/iwlwifi/mvm/d3.c +3 -0
index 129b6bdf9ef9..1523170a2a7a 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/intel/iwlwifi/mvm/ops.c +3 -0
index 984f407f7027..81b352f6c493 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +2 -0
index 9216c43a35c4..6bd40535a7c8 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/intersil/p54/p54pci.c +1 -0
index 6588f5477762..f62a3b02909f 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/intersil/p54/p54usb.c +1 -0
index a1c056612a83..66aa5077bc36 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/marvell/mwl8k.c +2 -0
index bab9ef37a1ab..f7bbbc697a0e 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/mediatek/mt76/mt7615/testmode.c +1 -0
index 03f5af84424b..47632edac73a 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/mediatek/mt76/mt76_connac.h +2 -0
index 455979476d11..84f5a6cae670 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/mediatek/mt76/mt7915/main.c +1 -0
index 3aa31c5cefa6..b869b445f534 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/mediatek/mt76/mt7915/testmode.c +5 -0
index d534fff5c952..f5f06dfbd70f 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/microchip/wilc1000/wlan.c +2 -0
index 9d80adc45d6b..e96dee3b1b11 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/quantenna/qtnfmac/bus.h +2 -0
index 7f8646e77ee0..e0b84952c0c0 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/realtek/rtw88/main.c +1 -0
index 0cee0fd8c0ef..6bbcdd21bf47 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/realtek/rtw89/core.c +1 -0
index 85f739f1173d..5b6649137c67 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/realtek/rtw89/mac80211.c +2 -0
index b3669e0074df..09a2fc36f12f 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/realtek/rtw89/wow.c +4 -0
index 01754d031bb4..a1f94ff20734 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/realtek/rtw89/wow.h +1 -1
index f91991e8f2e3..3f87a2ffd1ed 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rsi/rsi_91x_hal.c +1 -0
index 2cebe562a1f4..fd7ab68e5d95 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/st/cw1200/pm.c +2 -0
index a20ab577a364..cb24177a51ad 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/ti/wl12xx/main.c +1 -0
index ffbf54776330..47786790f5ae 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/ti/wlcore/main.c +4 -0
index 8fb58a5d911c..248804a3a149 100644

Lines of this file are not shown. View the raw message.

drivers/net/wireless/zydas/zd1211rw/zd_usb.c +2 -0
index 9ae10f65f2af..340ab10df4f0 100644

Lines of this file are not shown. View the raw message.

drivers/nvdimm/bus.c +1 -0
index 0ccf4a9e523a..0e126a5cc13a 100644

Lines of this file are not shown. View the raw message.

drivers/nvdimm/core.c +2 -0
index eaa796629c27..0ee4a4820d55 100644

Lines of this file are not shown. View the raw message.

drivers/nvdimm/namespace_devs.c +1 -0
index 55cfbf1e0a95..12436ed4a80c 100644

Lines of this file are not shown. View the raw message.

drivers/nvme/host/core.c +2 -0
index 40046770f1bf..651c6355f938 100644

Lines of this file are not shown. View the raw message.

drivers/nvme/host/pci.c +1 -0
index 278bed4e35bb..24953882a7fb 100644

Lines of this file are not shown. View the raw message.

drivers/nvmem/sc27xx-efuse.c +2 -0
index 4e2ffefac96c..79eb3059c3ed 100644

Lines of this file are not shown. View the raw message.

drivers/nvmem/sprd-efuse.c +2 -0
index 1a7e4e5d8b86..90f58f378460 100644

Lines of this file are not shown. View the raw message.

drivers/of/dynamic.c +4 -0
index 0aba760f7577..80e528829af2 100644

Lines of this file are not shown. View the raw message.

drivers/of/overlay.c +2 -0
index 434f6dd6a86c..dfbbe62b97f6 100644

Lines of this file are not shown. View the raw message.

drivers/opp/core.c +2 -0
index 73e9a3b2f29b..efcc65159939 100644

Lines of this file are not shown. View the raw message.

drivers/pci/pci.c +10 -0
index 869d204a70a3..8b56c7e962cf 100644

Lines of this file are not shown. View the raw message.

drivers/pci/pcie/bwctrl.c +1 -0
index 0a5e7efbce2c..fe6d9862d8d7 100644

Lines of this file are not shown. View the raw message.

drivers/pci/probe.c +2 -0
index b6536ed599c3..c43e16e074aa 100644

Lines of this file are not shown. View the raw message.

drivers/pci/switch/switchtec.c +1 -0
index b14dfab04d84..27a68b7c3890 100644

Lines of this file are not shown. View the raw message.

drivers/pcmcia/rsrc_nonstatic.c +1 -0
index bf9d070a4496..e3b29115b4f6 100644

Lines of this file are not shown. View the raw message.

drivers/perf/arm-cci.c +1 -0
index 1cc3214d6b6d..6e6b8f02e68d 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-aw9523.c +2 -0
index 9bf53de20be8..b4ed8ba45f4f 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-cy8c95x0.c +2 -0
index 0d6c2027d4c1..bcb38bff5cae 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-mcp23s08.c +2 -0
index b96e6368a956..3121776531e6 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-stmfx.c +2 -0
index aae01120dc52..62a4af0897b4 100644

Lines of this file are not shown. View the raw message.

drivers/pinctrl/pinctrl-sx150x.c +2 -0
index 98262b8ce43a..a96555814128 100644

Lines of this file are not shown. View the raw message.

drivers/platform/chrome/cros_ec_lpc_mec.c +2 -0
index a56584171168..db30a10c1e3a 100644

Lines of this file are not shown. View the raw message.

drivers/platform/cznic/turris-omnia-mcu-gpio.c +2 -0
index 5f35f7c5d5d7..c7c4a89fb7d9 100644

Lines of this file are not shown. View the raw message.

drivers/platform/x86/intel/crystal_cove_charger.c +2 -0
index e4299cfa2205..b3ce0ce35e8b 100644

Lines of this file are not shown. View the raw message.

drivers/pmdomain/core.c +4 -0
index 6c94137865c9..1f3d60db63d4 100644

Lines of this file are not shown. View the raw message.

drivers/pmdomain/rockchip/pm-domains.c +2 -0
index cb0f93800138..0ea40df640dd 100644

Lines of this file are not shown. View the raw message.

drivers/pnp/isapnp/core.c +2 -0
index 261bf85b0200..99c392141255 100644

Lines of this file are not shown. View the raw message.

drivers/power/supply/da9150-fg.c +2 -0
index 652c1f213af1..5f282557e695 100644

Lines of this file are not shown. View the raw message.

drivers/power/supply/power_supply_core.c +1 -0
index d0bb52a7a036..a95c5a7718b8 100644

Lines of this file are not shown. View the raw message.

drivers/pwm/core.c +8 -0
index ccd54c089bab..47a4e78081e7 100644

Lines of this file are not shown. View the raw message.

drivers/regulator/core.c +2 -0
index 89578b91c468..09f1072fddb1 100644

Lines of this file are not shown. View the raw message.

drivers/remoteproc/mtk_scp_ipi.c +2 -0
index c068227e251e..f24b409d0128 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/aacraid/commctrl.c +1 -0
index 68240d6f27ab..c932d17e33eb 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/fnic/fnic_scsi.c +1 -0
index 7133b254cbe4..4b397af20fb2 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/libfc/fc_disc.c +5 -1
index 60d621ad0024..d5d8f0740cd5 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/libiscsi.c +1 -0
index 2b1bf990a9dc..71f1f4bb1d65 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/megaraid/megaraid_sas.h +2 -1
index 088cc40ae866..cccec5cce928 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/megaraid/megaraid_sas_base.c +16 -4
index d85f990aec88..1031e04a2092 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/megaraid/megaraid_sas_fusion.c +2 -0
index 1eec23da28e2..2a715978683b 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/scsi_transport_iscsi.c +1 -0
index 9c347c64c315..09d262f735dc 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/sg.c +1 -0
index effb7e768165..338a9a6acfd9 100644

Lines of this file are not shown. View the raw message.

drivers/scsi/smartpqi/smartpqi_init.c +18 -0
index 0da7be40c925..3589907b9bdc 100644

Lines of this file are not shown. View the raw message.

drivers/siox/siox-core.c +2 -0
index f98f5a27e659..6264baa79735 100644

Lines of this file are not shown. View the raw message.

drivers/soc/qcom/qcom_pd_mapper.c +1 -0
index 154ca5beb471..1dc805d31a44 100644

Lines of this file are not shown. View the raw message.

drivers/soc/tegra/pmc.c +1 -0
index a08c377933c5..6b41161ca6bb 100644

Lines of this file are not shown. View the raw message.

drivers/soundwire/stream.c +3 -0
index e9df503332bb..442d7eee968d 100644

Lines of this file are not shown. View the raw message.

drivers/spi/spi-mem.c +2 -0
index a9f0f47f4759..635ea7eb50e7 100644

Lines of this file are not shown. View the raw message.

drivers/spi/spi.c +3 -0
index a7a4647717d4..fc65a43b40c8 100644

Lines of this file are not shown. View the raw message.

drivers/ssb/main.c +2 -0
index aa6165e3db4a..39cfeca88f8d 100644

Lines of this file are not shown. View the raw message.

drivers/staging/greybus/light.c +2 -0
index e509fdc715db..1c8757c9b665 100644

Lines of this file are not shown. View the raw message.

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +1 -0
index 8d5795db4f39..1ba7bbc2a3e9 100644

Lines of this file are not shown. View the raw message.

drivers/target/iscsi/iscsi_target_tpg.c +1 -0
index bf06cfdfb012..e689f85564ec 100644

Lines of this file are not shown. View the raw message.

drivers/target/target_core_device.c +1 -0
index cc2da086f96e..fdf42ca84c49 100644

Lines of this file are not shown. View the raw message.

drivers/tee/amdtee/core.c +1 -0
index e487231d25dc..264e5a9502c7 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/mediatek/auxadc_thermal.c +2 -0
index 9ee2e7283435..a8669f6a44e4 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/tegra/soctherm.c +2 -0
index 2c5ddf0db40c..95649a4e4afa 100644

Lines of this file are not shown. View the raw message.

drivers/thermal/thermal_debugfs.c +4 -0
index c800504c3cfe..335ca79275c0 100644

Lines of this file are not shown. View the raw message.

drivers/tty/n_tty.c +1 -0
index 5e9ca4376d68..3650b8e07563 100644

Lines of this file are not shown. View the raw message.

drivers/tty/serial/sc16is7xx.c +2 -0
index 7b51cdc274fd..683f198573e2 100644

Lines of this file are not shown. View the raw message.

drivers/tty/tty_buffer.c +2 -0
index 79f0ff94ce00..6c4a214b9cc7 100644

Lines of this file are not shown. View the raw message.

drivers/tty/tty_io.c +2 -0
index 6f152d483123..96b230e03027 100644

Lines of this file are not shown. View the raw message.

drivers/tty/tty_mutex.c +5 -0
index 784e46a0a3b1..b784a95b4c7d 100644

Lines of this file are not shown. View the raw message.

drivers/ufs/core/ufshcd.c +4 -0
index cd404ade48dc..4b0f13169239 100644

Lines of this file are not shown. View the raw message.

drivers/usb/class/cdc-wdm.c +3 -0
index 0f77547438d3..edd65ea39b9a 100644

Lines of this file are not shown. View the raw message.

drivers/usb/class/usblp.c +2 -1
index c197e81e0307..6e8f506e9047 100644

Lines of this file are not shown. View the raw message.

drivers/usb/class/usbtmc.c +3 -0
index 34e46ef308ab..cf3f0a42733c 100644

Lines of this file are not shown. View the raw message.

drivers/usb/core/devio.c +7 -0
index f6ce6e26e0d4..219463cdc653 100644

Lines of this file are not shown. View the raw message.

drivers/usb/core/hcd-pci.c +2 -0
index 56b534f59907..2ffaef3811fa 100644

Lines of this file are not shown. View the raw message.

drivers/usb/core/hub.c +7 -0
index c3f839637cb5..c2a81837f17e 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/configfs.c +6 -0
index fba2a56dae97..09601dcfd2de 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/function/f_fs.c +9 -5
index 2dea9e42a0f8..7d1ec569ab99 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/function/u_fs.h +2 -0
index 4b3365f23fd7..4092b1d2ecf6 100644

Lines of this file are not shown. View the raw message.

drivers/usb/gadget/legacy/inode.c +1 -0
index c4c9ad6d8596..077063f4e0a3 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/mos7720.c +2 -0
index e59bfa7c8030..bb61072f8238 100644

Lines of this file are not shown. View the raw message.

drivers/usb/serial/usb-serial.c +3 -0
index 7266558d823a..26594fe793d9 100644

Lines of this file are not shown. View the raw message.

drivers/usb/storage/transport.c +1 -0
index 52b85acaf756..eb920b83663a 100644

Lines of this file are not shown. View the raw message.

drivers/usb/storage/usb.c +2 -0
index d36f3b6992bb..26b6da805312 100644

Lines of this file are not shown. View the raw message.

drivers/usb/typec/tcpm/tcpm.c +16 -0
index 47be450d2be3..eda6fcdafc0a 100644

Lines of this file are not shown. View the raw message.

drivers/usb/usbip/stub_main.c +1 -0
index 79110a69d697..34849b0673b4 100644

Lines of this file are not shown. View the raw message.

drivers/vdpa/vdpa_sim/vdpa_sim_blk.c +2 -0
index b137f3679343..05586de07cfb 100644

Lines of this file are not shown. View the raw message.

drivers/vfio/group.c +1 -0
index 49559605177e..1a7838cc28e2 100644

Lines of this file are not shown. View the raw message.

drivers/vfio/pci/mlx5/cmd.h +2 -1
index df421dc6de04..d67dbdf9d033 100644

Lines of this file are not shown. View the raw message.

drivers/vfio/pci/virtio/migrate.c +1 -0
index ba92bb4e9af9..f4a2ca215f41 100644

Lines of this file are not shown. View the raw message.

drivers/vfio/vfio_iommu_type1.c +1 -0
index 50ebc9593c9d..23251cf33371 100644

Lines of this file are not shown. View the raw message.

drivers/vhost/vhost.c +3 -0
index 9ac25d08f473..e06055ed53a2 100644

Lines of this file are not shown. View the raw message.

drivers/video/fbdev/core/fb_procfs.c +2 -0
index 59641142f8aa..a134b54a8b7a 100644

Lines of this file are not shown. View the raw message.

drivers/video/fbdev/smscufx.c +1 -0
index 5f0dd01fd834..8bc3cbf5a558 100644

Lines of this file are not shown. View the raw message.

drivers/video/fbdev/udlfb.c +1 -0
index acadf0eb450c..d7bf8092fc91 100644

Lines of this file are not shown. View the raw message.

drivers/virt/vboxguest/vboxguest_linux.c +2 -0
index 8c92ea5b7305..3b458239a9a6 100644

Lines of this file are not shown. View the raw message.

drivers/virtio/virtio_mem.c +5 -0
index 8a294b9cbcf6..46ba9a376783 100644

Lines of this file are not shown. View the raw message.

drivers/w1/slaves/w1_therm.c +9 -0
index c85e80c7e130..c6153bc57b9c 100644

Lines of this file are not shown. View the raw message.

drivers/w1/w1.c +3 -0
index 29f200bbab41..d5a5ebc237ed 100644

Lines of this file are not shown. View the raw message.

drivers/w1/w1_netlink.c +1 -0
index 691978cddab7..12e00577124b 100644

Lines of this file are not shown. View the raw message.

drivers/xen/balloon.c +2 -0
index 163f7f1d70f1..8ceb5cfb0db1 100644

Lines of this file are not shown. View the raw message.

drivers/xen/xen-pciback/passthrough.c +1 -0
index 66e9b814cc86..1b0f98a5d47a 100644

Lines of this file are not shown. View the raw message.

drivers/xen/xen-pciback/vpci.c +1 -0
index cc7450f2b2a9..1b8b9894601b 100644

Lines of this file are not shown. View the raw message.

drivers/xen/xenbus/xenbus_comms.c +1 -0
index e5fda0256feb..39bd06f7e104 100644

Lines of this file are not shown. View the raw message.

drivers/xen/xenbus/xenbus_xs.c +4 -0
index d32c726f7a12..00c1b71069c3 100644

Lines of this file are not shown. View the raw message.

fs/affs/affs.h +6 -0
index e8c2c4535cb3..d560619c233b 100644

Lines of this file are not shown. View the raw message.

fs/afs/validation.c +1 -0
index f7ff7a5b1b99..94b494408fb4 100644

Lines of this file are not shown. View the raw message.

fs/autofs/waitq.c +3 -0
index 33dd4660d82f..a254192b3c0d 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/alloc_foreground.c +4 -0
index 6df41c331a52..d25aed94ad1f 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/alloc_foreground.h +1 -0
index f25481a0d1a0..7b7802a632f9 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/btree_locking.c +1 -0
index 10b805a60f52..c84824243822 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/btree_write_buffer.c +4 -0
index b56c4987b8c9..67a6a8097c5b 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/debug.c +2 -0
index 55333e82d1fe..478f9a3dab2d 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/ec.c +3 -0
index d2a5e76e6479..5f404cc718a6 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/fs-ioctl.c +1 -0
index 15725b4ce393..4f20d2bd38e7 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/fs.c +4 -0
index 90ade8f648d9..6593955c578c 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/io_write.c +3 -0
index dd508d93e9fc..3a4edae7eba1 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/journal.c +2 -0
index cb2c3722f674..5c0c6bda6c57 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/quota.c +2 -0
index 8b857fc33244..cdcea4526fbe 100644

Lines of this file are not shown. View the raw message.

fs/bcachefs/seqmutex.h +4 -0
index c4b3d8d3f414..aa0638d0d306 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/block-group.c +2 -0
index c0a8f7d92acc..efaaf59e1811 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/delayed-ref.c +4 -0
index 98c5b61dabe8..9e2c504ad7ab 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/delayed-ref.h +1 -0
index a35067cebb97..cf19f7f68581 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/extent-tree.c +1 -0
index 3014a1a23efd..002ece8d1d71 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/free-space-cache.c +1 -0
index d42b6f882f57..8beb3685a172 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/ioctl.c +2 -0
index 6c18bad53cd3..405e005da13d 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/qgroup.c +1 -0
index b90fabe302e6..8ba62891de5c 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/scrub.c +2 -0
index 531312efee8d..c8cd19fe1d46 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/tests/delayed-refs-tests.c +1 -0
index 6558508c2ddf..ca76806a818a 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/tree-log.c +2 -0
index 955d1677e865..94e733e62ac2 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/volumes.c +4 -0
index 0a0776489055..0c7a8e6d2837 100644

Lines of this file are not shown. View the raw message.

fs/btrfs/zoned.h +4 -0
index 9672bf4c3335..7f048469f1be 100644

Lines of this file are not shown. View the raw message.

fs/ceph/caps.c +4 -0
index a8d8b56cf9d2..53772f293001 100644

Lines of this file are not shown. View the raw message.

fs/ceph/mds_client.c +1 -0
index 54b3421501e9..257b13a1aeb3 100644

Lines of this file are not shown. View the raw message.

fs/coda/upcall.c +1 -0
index cd6a3721f6f6..362024e61491 100644

Lines of this file are not shown. View the raw message.

fs/dcache.c +1 -0
index 9cc0d47da321..77e3383095be 100644

Lines of this file are not shown. View the raw message.

fs/dlm/recoverd.c +2 -0
index 12272a8f6d75..e701595e40c8 100644

Lines of this file are not shown. View the raw message.

fs/ecryptfs/main.c +1 -0
index 8dd1d7189c3b..8a6789978f93 100644

Lines of this file are not shown. View the raw message.

fs/ecryptfs/messaging.c +1 -0
index 6318f3500e5c..45acf865fd52 100644

Lines of this file are not shown. View the raw message.

fs/erofs/zdata.c +3 -0
index 29f8963bb523..d2db179e4e28 100644

Lines of this file are not shown. View the raw message.

fs/eventpoll.c +3 -0
index 7c0980db77b3..f475671475e5 100644

Lines of this file are not shown. View the raw message.

fs/exec.c +4 -0
index 506cd411f4ac..441c0ae2cc02 100644

Lines of this file are not shown. View the raw message.

fs/ext4/fast_commit.c +1 -0
index da4263a14a20..e49478643218 100644

Lines of this file are not shown. View the raw message.

fs/ext4/mballoc.c +2 -0
index b25a27c86696..b3ae56e46586 100644

Lines of this file are not shown. View the raw message.

fs/f2fs/data.c +1 -0
index de4da6d9cd93..eb896c9dea09 100644

Lines of this file are not shown. View the raw message.

fs/fat/fatent.c +2 -0
index 1db348f8f887..21baa8497370 100644

Lines of this file are not shown. View the raw message.

fs/fat/inode.c +2 -0
index 3852bb66358c..7fa7f2b51ec9 100644

Lines of this file are not shown. View the raw message.

fs/file.c +2 -0
index d868cdb95d1e..631067b95467 100644

Lines of this file are not shown. View the raw message.

fs/fuse/inode.c +2 -0
index e9db2cb8c150..6e8ef72b0727 100644

Lines of this file are not shown. View the raw message.

fs/gfs2/rgrp.c +2 -0
index b14e54b38ee8..4f4d3584e67a 100644

Lines of this file are not shown. View the raw message.

fs/gfs2/util.c +1 -0
index 13be8d1d228b..1b3c2896442e 100644

Lines of this file are not shown. View the raw message.

fs/hfs/bfind.c +2 -0
index ef9498a6e88a..162ea3a68138 100644

Lines of this file are not shown. View the raw message.

fs/hfsplus/bfind.c +2 -0
index 901e83d65d20..53d108b6328a 100644

Lines of this file are not shown. View the raw message.

fs/hfsplus/extents.c +2 -0
index a6d61685ae79..bd7c6ca0e739 100644

Lines of this file are not shown. View the raw message.

fs/hpfs/hpfs_fn.h +2 -0
index 237c1c23e855..26427e681c24 100644

Lines of this file are not shown. View the raw message.

fs/jbd2/checkpoint.c +2 -0
index b3971e91e8eb..2ae513397500 100644

Lines of this file are not shown. View the raw message.

fs/jbd2/commit.c +1 -0
index e8e80761ac73..e4b0599b3acb 100644

Lines of this file are not shown. View the raw message.

fs/jbd2/journal.c +5 -0
index d8084b31b361..026ddf873c13 100644

Lines of this file are not shown. View the raw message.

fs/jbd2/transaction.c +2 -0
index 66513c18ca29..37e00e637e22 100644

Lines of this file are not shown. View the raw message.

fs/jffs2/dir.c +4 -0
index 2b2938970da3..f44b8e85c0d9 100644

Lines of this file are not shown. View the raw message.

fs/jffs2/fs.c +1 -0
index d175cccb7c55..6d832fe7f73f 100644

Lines of this file are not shown. View the raw message.

fs/jffs2/gc.c +1 -0
index 1b833bbffcf5..8e1909d7c292 100644

Lines of this file are not shown. View the raw message.

fs/jffs2/nodemgmt.c +2 -0
index 3fb9f9807b66..bd945e7a069e 100644

Lines of this file are not shown. View the raw message.

fs/jffs2/write.c +2 -0
index cda9a361368e..a69f371fe0d4 100644

Lines of this file are not shown. View the raw message.

fs/jfs/namei.c +1 -0
index fc8ede43afde..a6e76fcb31ed 100644

Lines of this file are not shown. View the raw message.

fs/kernfs/file.c +9 -0
index 0eb320617d7b..c7747366e5d2 100644

Lines of this file are not shown. View the raw message.

fs/lockd/host.c +1 -0
index 5e6877c37f73..fc5d51810075 100644

Lines of this file are not shown. View the raw message.

fs/lockd/svclock.c +1 -0
index c1315df4b350..aa1e8926c952 100644

Lines of this file are not shown. View the raw message.

fs/namei.c +4 -0
index 3ab9440c5b93..8bd2a45a9206 100644

Lines of this file are not shown. View the raw message.

fs/netfs/write_issue.c +2 -0
index 69727411683e..ac50e4caad14 100644

Lines of this file are not shown. View the raw message.

fs/nfsd/nfs4layouts.c +2 -0
index fbfddd3c4c94..a42a0f26b83a 100644

Lines of this file are not shown. View the raw message.

fs/nfsd/nfs4proc.c +2 -0
index f6e06c779d09..9029afd63409 100644

Lines of this file are not shown. View the raw message.

fs/nfsd/nfs4state.c +11 -0
index b7a0cfd05401..1e4613c3aede 100644

Lines of this file are not shown. View the raw message.

fs/ntfs3/frecord.c +3 -1
index 5df6a0b5add9..0e9a2c921606 100644

Lines of this file are not shown. View the raw message.

fs/ntfs3/inode.c +1 -0
index a1e11228dafd..abd416d13528 100644

Lines of this file are not shown. View the raw message.

fs/ntfs3/namei.c +2 -0
index abf7e81584a9..09c71147c1bd 100644

Lines of this file are not shown. View the raw message.

fs/ntfs3/ntfs_fs.h +4 -0
index 382820464dee..e31ac95c31aa 100644

Lines of this file are not shown. View the raw message.

fs/ntfs3/record.c +1 -0
index 714c7ecedca8..8333c5cc8923 100644

Lines of this file are not shown. View the raw message.

fs/ntfs3/xattr.c +2 -0
index e0055dcf8fe3..a66d0222ede1 100644

Lines of this file are not shown. View the raw message.

fs/ocfs2/cluster/nodemanager.c +2 -0
index 2f61d39e4e50..2e5ceb6742b8 100644

Lines of this file are not shown. View the raw message.

fs/ocfs2/dlmglue.c +2 -0
index 92a6149da9c1..3b9082ee8eab 100644

Lines of this file are not shown. View the raw message.

fs/ocfs2/inode.c +2 -0
index 12e5d1f73325..f6f538875f5f 100644

Lines of this file are not shown. View the raw message.

fs/ocfs2/refcounttree.c +2 -0
index 8f732742b26e..fa79196ed861 100644

Lines of this file are not shown. View the raw message.

fs/orangefs/orangefs-debugfs.c +2 -0
index f52073022fae..a41f7eeee582 100644

Lines of this file are not shown. View the raw message.

fs/orangefs/waitqueue.c +1 -0
index beafc33d57be..388ef2c7135d 100644

Lines of this file are not shown. View the raw message.

fs/overlayfs/overlayfs.h +3 -0
index 0021e2025020..9cdf189aeb0a 100644

Lines of this file are not shown. View the raw message.

fs/pipe.c +2 -0
index 94b59045ab44..44dd3b0a4d6e 100644

Lines of this file are not shown. View the raw message.

fs/proc/proc_tty.c +2 -0
index 5c6a5ceab2f1..3732064beb2e 100644

Lines of this file are not shown. View the raw message.

fs/pstore/zone.c +1 -0
index ceb5639a0629..7cba01dfbd3a 100644

Lines of this file are not shown. View the raw message.

fs/smb/client/cifsglob.h +2 -0
index a68434ad744a..af5e01c7f606 100644

Lines of this file are not shown. View the raw message.

fs/smb/client/connect.c +2 -1
index f917de020dd5..96bcd841e554 100644

Lines of this file are not shown. View the raw message.

fs/smb/client/fs_context.h +2 -0
index 881bfc08667e..0f315e213bd6 100644

Lines of this file are not shown. View the raw message.

fs/smb/client/smbdirect.c +2 -0
index b0b7254661e9..bab01426472d 100644

Lines of this file are not shown. View the raw message.

fs/smb/client/smbdirect.h +1 -1
index c08e3665150d..f9644c59800c 100644

Lines of this file are not shown. View the raw message.

fs/smb/server/connection.h +4 -2
index b379ae4fdcdf..4145a43602cb 100644

Lines of this file are not shown. View the raw message.

fs/super.c +6 -0
index 5a7db4a556e3..11db4053825c 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/compress.c +2 -0
index 0b48cbab8a3d..a6e6230e513a 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/dir.c +4 -0
index fda82f3e16e8..ddddb996d565 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/file.c +6 -0
index 5130123005e4..a9d9807f5311 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/journal.c +3 -0
index 36ba79fbd2ff..cd300897c90d 100644

Lines of this file are not shown. View the raw message.

fs/ubifs/misc.h +2 -0
index 615878e884ba..464470a17b87 100644

Lines of this file are not shown. View the raw message.

fs/xfs/scrub/dirtree.c +2 -0
index 3a9cdf8738b6..f66b5f692152 100644

Lines of this file are not shown. View the raw message.

fs/xfs/scrub/dirtree_repair.c +3 -0
index 5c04e70ba951..007a4cada880 100644

Lines of this file are not shown. View the raw message.

fs/xfs/scrub/quota.c +1 -0
index 58d6d4ed2853..542742b2a7fb 100644

Lines of this file are not shown. View the raw message.

fs/xfs/scrub/quota_repair.c +3 -0
index 8f4c8d41f308..3e501740af01 100644

Lines of this file are not shown. View the raw message.

fs/xfs/scrub/quotacheck_repair.c +3 -0
index dd8554c755b5..ac73ad8f03c8 100644

Lines of this file are not shown. View the raw message.

fs/xfs/scrub/rmap_repair.c +1 -0
index f5f73078ffe2..6aaaf15f40df 100644

Lines of this file are not shown. View the raw message.

fs/xfs/scrub/rtrmap_repair.c +1 -0
index f2fdd7a9fc24..7f112516dc6e 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dquot.c +7 -0
index edbc521870a1..bdec1c207161 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dquot.h +8 -2
index 61217adf5ba5..0156dfc1a955 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_dquot_item.c +2 -0
index 271b195ebb93..9039825a0dda 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_qm.c +3 -0
index e1ba5af6250f..c3b6c1aa98f1 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_qm_syscalls.c +1 -0
index 0c78f30fa4a3..a7402599b442 100644

Lines of this file are not shown. View the raw message.

fs/xfs/xfs_trans_dquot.c +3 -0
index 765456bf3428..0a18b22ef303 100644

Lines of this file are not shown. View the raw message.

include/linux/blkdev.h +8 -3
index 248416ecd01c..0d011270e642 100644

Lines of this file are not shown. View the raw message.

include/linux/cgroup.h +2 -0
index f8ef47f8a634..470f96e8996a 100644

Lines of this file are not shown. View the raw message.

include/linux/fb.h +2 -0
index 5ba187e08cf7..07178e3d3722 100644

Lines of this file are not shown. View the raw message.

include/linux/fpga/fpga-bridge.h +1 -1
index 94c4edd047e5..38b43f61e438 100644

Lines of this file are not shown. View the raw message.

include/linux/fpga/fpga-mgr.h +2 -2
index 0d4fe068f3d8..7eb764d4ffed 100644

Lines of this file are not shown. View the raw message.

include/linux/fsnotify_backend.h +2 -0
index 0d24a21a8e60..53faf37d2e31 100644

Lines of this file are not shown. View the raw message.

include/linux/gameport.h +1 -0
index 86d62fdafd7a..13aa672d9ea7 100644

Lines of this file are not shown. View the raw message.

include/linux/memory_hotplug.h +2 -0
index eaac5ae8c05c..22d32f1e69d6 100644

Lines of this file are not shown. View the raw message.

include/linux/mfd/si476x-core.h +2 -0
index dd95c37ca134..f0ba5b365ce0 100644

Lines of this file are not shown. View the raw message.

include/linux/netdevice.h +2 -0
index 2a59034a5fa2..ae9278326d75 100644

Lines of this file are not shown. View the raw message.

include/linux/phy.h +2 -0
index 19f076a71f94..10ee6af78230 100644

Lines of this file are not shown. View the raw message.

include/linux/usb.h +2 -1
index cfa8005e24f9..9717b546f3a4 100644

Lines of this file are not shown. View the raw message.

include/media/v4l2-ctrls.h +2 -0
index 59679a42b3e7..6bd0f81f8264 100644

Lines of this file are not shown. View the raw message.

include/media/v4l2-subdev.h +5 -0
index 2f2200875b03..dd9804db27fb 100644

Lines of this file are not shown. View the raw message.

include/net/bluetooth/l2cap.h +2 -0
index d9c767cf773d..60f9feb2bea6 100644

Lines of this file are not shown. View the raw message.

include/net/cfg80211.h +2 -0
index 363d7dd2255a..290133e521d9 100644

Lines of this file are not shown. View the raw message.

include/sound/emu10k1.h +10 -2
index 38db50b280eb..5b5095096c6d 100644

Lines of this file are not shown. View the raw message.

include/sound/i2c.h +2 -0
index 6f0162ae9d68..855e3d8d0906 100644

Lines of this file are not shown. View the raw message.

include/sound/soc-card.h +3 -0
index ecc02e955279..12b28e179da2 100644

Lines of this file are not shown. View the raw message.

include/sound/soc.h +14 -0
index fcdb5adfcd5e..6739fddaf407 100644

Lines of this file are not shown. View the raw message.

io_uring/cancel.c +1 -0
index 484193567839..2f8390315958 100644

Lines of this file are not shown. View the raw message.

io_uring/fdinfo.c +1 -0
index f60d0a9d505e..01c881634c43 100644

Lines of this file are not shown. View the raw message.

io_uring/io_uring.c +5 -0
index ceacf6230e34..0bf2363de74b 100644

Lines of this file are not shown. View the raw message.

io_uring/io_uring.h +2 -0
index ab619e63ef39..40bd341907d3 100644

Lines of this file are not shown. View the raw message.

io_uring/msg_ring.c +3 -0
index 7e6f68e911f1..2f7575fd39bf 100644

Lines of this file are not shown. View the raw message.

io_uring/register.c +6 -0
index 9a4d2fbce4ae..6f1f0786d370 100644

Lines of this file are not shown. View the raw message.

io_uring/rsrc.c +3 -0
index af39b69eb4fd..c7d2b2301741 100644

Lines of this file are not shown. View the raw message.

io_uring/sqpoll.c +3 -0
index d037cc68e9d3..80e8bcb355b9 100644

Lines of this file are not shown. View the raw message.

io_uring/tctx.c +1 -0
index adc6e42c14df..4bb6bd7bdb9f 100644

Lines of this file are not shown. View the raw message.

kernel/acct.c +3 -0
index 31222e8cd534..7cadc7705afa 100644

Lines of this file are not shown. View the raw message.

kernel/audit.c +2 -0
index 5f5bf85bcc90..d89496adba89 100644

Lines of this file are not shown. View the raw message.

kernel/audit_tree.c +2 -0
index f2f38903b2fe..83ef4a849dd0 100644

Lines of this file are not shown. View the raw message.

kernel/audit_watch.c +1 -0
index 7f358740e958..1a55d9160bc4 100644

Lines of this file are not shown. View the raw message.

kernel/bpf/btf.c +1 -0
index 9de6acddd479..3f96cc1efd8c 100644

Lines of this file are not shown. View the raw message.

kernel/bpf/cgroup_iter.c +2 -0
index f04a468cf6a7..96d9fc0ceed6 100644

Lines of this file are not shown. View the raw message.

kernel/bpf/verifier.c +1 -0
index 9971c03adfd5..08e611cb10df 100644

Lines of this file are not shown. View the raw message.

kernel/cgroup/cgroup-v1.c +4 -0
index e28d5f0d20ed..7d92de469667 100644

Lines of this file are not shown. View the raw message.

kernel/cgroup/cgroup.c +18 -0
index d9061bd55436..33f39b2ab34e 100644

Lines of this file are not shown. View the raw message.

kernel/cgroup/cpuset.c +2 -0
index 0f910c828973..89f7e396b7c4 100644

Lines of this file are not shown. View the raw message.

kernel/cpu.c +2 -0
index 07455d25329c..8c4b372e5d8e 100644

Lines of this file are not shown. View the raw message.

kernel/events/callchain.c +1 -0
index 8a47e52a454f..1478ea88fe74 100644

Lines of this file are not shown. View the raw message.

kernel/events/core.c +9 -0
index bcb09e011e9e..32cc2a748813 100644

Lines of this file are not shown. View the raw message.

kernel/events/hw_breakpoint.c +2 -0
index bc4a61029b6d..1a0b8b472a4e 100644

Lines of this file are not shown. View the raw message.

kernel/fail_function.c +2 -0
index d971a0189319..3a8376647730 100644

Lines of this file are not shown. View the raw message.

kernel/futex/core.c +3 -0
index ebdd76b4ecbb..628d26f206c5 100644

Lines of this file are not shown. View the raw message.

kernel/irq/autoprobe.c +3 -0
index ae60cae24e9a..c447722388d2 100644

Lines of this file are not shown. View the raw message.

kernel/irq/irqdesc.c +2 -0
index 287830739783..95c46b0abb50 100644

Lines of this file are not shown. View the raw message.

kernel/irq/msi.c +2 -0
index 396a067a8a56..9012ff076b71 100644

Lines of this file are not shown. View the raw message.

kernel/jump_label.c +2 -0
index 93a822d3c468..79bc65bf4b73 100644

Lines of this file are not shown. View the raw message.

kernel/kprobes.c +3 -0
index 88aeac84e4c0..5ae4a8e253d9 100644

Lines of this file are not shown. View the raw message.

kernel/locking/locktorture.c +4 -0
index cc33470f4de9..1f200c0f65db 100644

Lines of this file are not shown. View the raw message.

kernel/module/main.c +1 -0
index 1fb9ad289a6f..8dc5c4797a2f 100644

Lines of this file are not shown. View the raw message.

kernel/module/procfs.c +2 -0
index 0a4841e88adb..baa6a4262188 100644

Lines of this file are not shown. View the raw message.

kernel/params.c +2 -0
index 0074d29c9b80..1afe9417f93e 100644

Lines of this file are not shown. View the raw message.

kernel/power/autosleep.c +2 -0
index 865df641b97c..8a787643cd4c 100644

Lines of this file are not shown. View the raw message.

kernel/power/main.c +2 -0
index 6254814d4817..2f83cf14ff49 100644

Lines of this file are not shown. View the raw message.

kernel/printk/printk.c +2 -0
index 07668433644b..db78210f5c76 100644

Lines of this file are not shown. View the raw message.

kernel/rcu/srcutree.c +3 -1
index b83c74c4dcc0..dbac7c6ae04c 100644

Lines of this file are not shown. View the raw message.

kernel/rcu/tree_exp.h +1 -0
index 77efed89c79e..3cda44bc0236 100644

Lines of this file are not shown. View the raw message.

kernel/sched/core.c +1 -0
index 165c90ba64ea..a3a430ff8173 100644

Lines of this file are not shown. View the raw message.

kernel/seccomp.c +1 -0
index 84c9b42f11ef..ab14b2cb9428 100644

Lines of this file are not shown. View the raw message.

kernel/static_call_inline.c +2 -0
index bb7d066a7c39..a09f0c394b6e 100644

Lines of this file are not shown. View the raw message.

kernel/torture.c +2 -0
index dede150aef01..f189f6edca03 100644

Lines of this file are not shown. View the raw message.

kernel/trace/ftrace.c +7 -0
index 728ecda6e8d4..87b2116a2d18 100644

Lines of this file are not shown. View the raw message.

kernel/trace/ring_buffer.c +2 -0
index b8e0ae15ca5b..f9089aa17844 100644

Lines of this file are not shown. View the raw message.

kernel/trace/rv/rv.c +3 -0
index 8657fc8806e7..d52ee98240ea 100644

Lines of this file are not shown. View the raw message.

kernel/trace/rv/rv_reactors.c +2 -0
index 7b49cbe388d4..7caed32dbb72 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace.c +12 -0
index 1496a5ac33ae..e41c4b34e77b 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_dynevent.c +2 -0
index a322e4f249a5..12f7251d5be4 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_events.c +10 -0
index 4cb275316e51..0a8caf906210 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_events_trigger.c +2 -0
index d45448947094..be8a81db3382 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_events_user.c +1 -0
index 97325fbd6283..bf70d3ef6a34 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_hwlat.c +2 -0
index b65353ec2837..059d60e0574f 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_osnoise.c +2 -0
index f3a2722ee4c0..bf9eda568ad5 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_printk.c +8 -0
index 29f6e95439b6..03360d1d90f4 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_recursion_record.c +2 -0
index a520b11afb0d..fb7dcb6e3f6e 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_stat.c +2 -0
index b3b5586f104d..22c026d00c78 100644

Lines of this file are not shown. View the raw message.

kernel/trace/trace_uprobe.c +2 -0
index ccc762fbb69c..d0db6c858e88 100644

Lines of this file are not shown. View the raw message.

kernel/workqueue.c +2 -0
index 3c2c45313c88..f308d79725ce 100644

Lines of this file are not shown. View the raw message.

lib/Makefile +2 -0
index d5cfc7afbbb8..397062672e0d 100644

Lines of this file are not shown. View the raw message.

lib/dynamic_debug.c +2 -0
index 5a007952f7f2..168d59ef68b3 100644

Lines of this file are not shown. View the raw message.

lib/error-inject.c +2 -0
index 887acd9a6ea6..de2d36c9a6ee 100644

Lines of this file are not shown. View the raw message.

lib/kunit/platform.c +1 -0
index 0b518de26065..fcf7ef34107c 100644

Lines of this file are not shown. View the raw message.

lib/once.c +2 -0
index 2c306f0e891e..cc7f5a497bf8 100644

Lines of this file are not shown. View the raw message.

mm/damon/sysfs.c +3 -0
index deeab04d3b46..a89032518a75 100644

Lines of this file are not shown. View the raw message.

mm/hugetlb.c +4 -0
index 65068671e460..2e659e5736fd 100644

Lines of this file are not shown. View the raw message.

mm/kmemleak.c +2 -0
index 9f81f4f30fca..a54a91832301 100644

Lines of this file are not shown. View the raw message.

mm/ksm.c +1 -0
index 8be2b144fefd..2aba983d1b7c 100644

Lines of this file are not shown. View the raw message.

mm/oom_kill.c +1 -0
index 1cf121ad7085..1e49b99709f3 100644

Lines of this file are not shown. View the raw message.

mm/page_alloc.c +4 -0
index 579789600a3c..56078ea8916c 100644

Lines of this file are not shown. View the raw message.

mm/percpu.c +1 -0
index ac61e3fc5f15..223831b52801 100644

Lines of this file are not shown. View the raw message.

mm/slab_common.c +2 -0
index 4030907b6b7d..580a367d9f37 100644

Lines of this file are not shown. View the raw message.

mm/swap_slots.c +2 -0
index 9c7c171df7ba..96135222f81a 100644

Lines of this file are not shown. View the raw message.

mm/swapfile.c +2 -0
index ba19430dd4ea..3e7857df7819 100644

Lines of this file are not shown. View the raw message.

mm/vma.c +2 -0
index af1d549b179c..75d1bc1e0f88 100644

Lines of this file are not shown. View the raw message.

mm/zswap.c +2 -0
index 6504174fbc6a..8887c3c98397 100644

Lines of this file are not shown. View the raw message.

net/atm/resources.c +2 -0
index 995d29e7fb13..50f199e7ffec 100644

Lines of this file are not shown. View the raw message.

net/bluetooth/l2cap_core.c +9 -0
index 27b4c4a2ba1f..5a523ea20e05 100644

Lines of this file are not shown. View the raw message.

net/bluetooth/l2cap_sock.c +2 -0
index 46ea0bee2259..c2b5064c9547 100644

Lines of this file are not shown. View the raw message.

net/bluetooth/rfcomm/sock.c +1 -0
index 913402806fa0..26e069997934 100644

Lines of this file are not shown. View the raw message.

net/bridge/netfilter/ebtables.c +5 -0
index 3e67d4aff419..772aae14d977 100644

Lines of this file are not shown. View the raw message.

net/caif/caif_socket.c +2 -0
index 039dfbd367c9..b83dbc9c1d19 100644

Lines of this file are not shown. View the raw message.

net/can/j1939/main.c +2 -0
index 7e8a20f2fc42..4f649050c0eb 100644

Lines of this file are not shown. View the raw message.

net/ceph/messenger.c +3 -0
index d1b5705dc0c6..c173ae8d1f58 100644

Lines of this file are not shown. View the raw message.

net/ceph/messenger_v1.c +2 -0
index 0cb61c76b9b8..cdfb19a39df2 100644

Lines of this file are not shown. View the raw message.

net/ceph/messenger_v2.c +14 -0
index bd608ffa0627..9c1b1d7ce74e 100644

Lines of this file are not shown. View the raw message.

net/core/dev.c +4 -0
index c0021cbd28fc..1bad0eed5fb0 100644

Lines of this file are not shown. View the raw message.

net/core/drop_monitor.c +2 -0
index 6efd4cccc9dd..0947be1c2763 100644

Lines of this file are not shown. View the raw message.

net/core/netdev-genl.c +5 -0
index 715f85c6b62e..77034e48b0d4 100644

Lines of this file are not shown. View the raw message.

net/core/pktgen.c +1 -0
index 82b6a2c3c141..0414c95335c8 100644

Lines of this file are not shown. View the raw message.

net/core/rtnetlink.c +12 -0
index 1f4d4b5570ab..633c210066a7 100644

Lines of this file are not shown. View the raw message.

net/core/sock.c +2 -0
index eae2ae70a2e0..db0de206134e 100644

Lines of this file are not shown. View the raw message.

net/devlink/core.c +3 -0
index f49cd83f1955..ac20168317cb 100644

Lines of this file are not shown. View the raw message.

net/devlink/devl_internal.h +2 -0
index 14eaad9cfe35..3470bbb4e850 100644

Lines of this file are not shown. View the raw message.

net/ethtool/ioctl.c +1 -0
index 34bee42e1247..be53962fe4ae 100644

Lines of this file are not shown. View the raw message.

net/ipv6/mcast.c +1 -0
index 9dfdb40988b0..2336fef5e096 100644

Lines of this file are not shown. View the raw message.

net/mac802154/cfg.c +2 -0
index ef7f23af043f..1070209ca29b 100644

Lines of this file are not shown. View the raw message.

net/mac802154/mib.c +2 -0
index 81666e1d779d..ba2e974a4747 100644

Lines of this file are not shown. View the raw message.

net/netfilter/ipset/ip_set_core.c +2 -0
index cc20e6d56807..47b01fd794a5 100644

Lines of this file are not shown. View the raw message.

net/netfilter/ipvs/ip_vs_app.c +2 -0
index fdacbc3c15be..220a9479e807 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nf_log.c +2 -0
index 6dd0de33eebd..c2166058eef8 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nf_tables_api.c +5 -0
index a34de9c17cf1..f7587dfc9bc2 100644

Lines of this file are not shown. View the raw message.

net/netfilter/nfnetlink.c +2 -0
index e598a2a252b0..d1fc9338a08f 100644

Lines of this file are not shown. View the raw message.

net/netfilter/x_tables.c +8 -0
index 709840612f0d..220e6d929172 100644

Lines of this file are not shown. View the raw message.

net/netfilter/xt_hashlimit.c +1 -0
index fa02aab56724..4d48cc462f07 100644

Lines of this file are not shown. View the raw message.

net/netlink/af_netlink.c +2 -0
index 85311226183a..3edc8a261bf9 100644

Lines of this file are not shown. View the raw message.

net/netlink/genetlink.c +7 -0
index 104732d34543..746c0faaafd3 100644

Lines of this file are not shown. View the raw message.

net/openvswitch/datapath.c +2 -0
index 225f6048867f..dfa184cf347b 100644

Lines of this file are not shown. View the raw message.

net/phonet/socket.c +2 -0
index 5ce0b3ee5def..c85fc6b32412 100644

Lines of this file are not shown. View the raw message.

net/qrtr/af_qrtr.c +1 -0
index 00c51cf693f3..7669f5a0829d 100644

Lines of this file are not shown. View the raw message.

net/rds/ib_cm.c +1 -0
index 26b069e1999d..8f641339383b 100644

Lines of this file are not shown. View the raw message.

net/rds/rdma_transport.c +1 -0
index b15cf316b23a..06fe949e3bb0 100644

Lines of this file are not shown. View the raw message.

net/rds/tcp_listen.c +1 -0
index d89bd8d0c354..e2a77b73d524 100644

Lines of this file are not shown. View the raw message.

net/rxrpc/af_rxrpc.c +1 -0
index 86873399f7d5..359461e83c19 100644

Lines of this file are not shown. View the raw message.

net/rxrpc/call_object.c +1 -0
index 5a543c3f6fb0..f7f6fdcf70eb 100644

Lines of this file are not shown. View the raw message.

net/rxrpc/sendmsg.c +3 -0
index 216d9db6b9ac..fab096feb270 100644

Lines of this file are not shown. View the raw message.

net/sched/act_api.c +1 -0
index 839790043256..a4677be2e717 100644

Lines of this file are not shown. View the raw message.

net/sched/cls_api.c +1 -0
index 8e47e5355be6..24d9146a6eed 100644

Lines of this file are not shown. View the raw message.

net/shaper/shaper.c +2 -0
index 7101a48bce54..1420cb6a6700 100644

Lines of this file are not shown. View the raw message.

net/smc/af_smc.c +1 -0
index ca6984541edb..7946c3f564a2 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/rpc_pipe.c +2 -0
index eadc00410ebc..4cb846f4d3ae 100644

Lines of this file are not shown. View the raw message.

net/sunrpc/svc_xprt.c +2 -0
index ae25405d8bd2..ec07bf77b20e 100644

Lines of this file are not shown. View the raw message.

net/unix/af_unix.c +1 -0
index 34945de1fb1f..a66fc1d182e9 100644

Lines of this file are not shown. View the raw message.

net/unix/unix_bpf.c +1 -0
index bca2d86ba97d..c4dc195029f0 100644

Lines of this file are not shown. View the raw message.

net/wireless/nl80211.c +9 -0
index d7d3da0f6833..96fa14a7de53 100644

Lines of this file are not shown. View the raw message.

samples/vfio-mdev/mtty.c +1 -0
index 59eefe2fed10..b59e91fc20c7 100644

Lines of this file are not shown. View the raw message.

security/apparmor/apparmorfs.c +3 -0
index c07d150685d7..857daa85bb85 100644

Lines of this file are not shown. View the raw message.

security/integrity/ima/ima_main.c +1 -0
index 9f9897a7c217..2f86b16b5fc8 100644

Lines of this file are not shown. View the raw message.

security/keys/keyring.c +3 -0
index f331725d5a37..115a878d2126 100644

Lines of this file are not shown. View the raw message.

security/tomoyo/gc.c +3 -0
index 026e29ea3796..518ff4a91f5d 100644

Lines of this file are not shown. View the raw message.

sound/core/compress_offload.c +3 -0
index 840bb9cfe789..02b89894874f 100644

Lines of this file are not shown. View the raw message.

sound/core/oss/pcm_oss.c +9 -0
index 4683b9139c56..55e6dbdcc7e7 100644

Lines of this file are not shown. View the raw message.

sound/core/pcm_native.c +8 -0
index 6c2b6a62d9d2..793e5cb74d9a 100644

Lines of this file are not shown. View the raw message.

sound/core/seq/oss/seq_oss.c +1 -0
index 77c1214acd90..e1f30acb00f5 100644

Lines of this file are not shown. View the raw message.

sound/core/seq/seq_clientmgr.c +2 -0
index 073b56dc2225..eb392eff3543 100644

Lines of this file are not shown. View the raw message.

sound/core/seq/seq_memory.c +1 -0
index 20155e3e87c6..f748c2de9313 100644

Lines of this file are not shown. View the raw message.

sound/core/sound.c +1 -0
index 6531a67f13b3..01d9699eb7bc 100644

Lines of this file are not shown. View the raw message.

sound/isa/gus/gus_mem.c +3 -0
index 054058779db6..7bb60fe6bf93 100644

Lines of this file are not shown. View the raw message.

sound/pci/ac97/ac97_codec.c +2 -0
index 6e710dce5c60..acad9004b7b7 100644

Lines of this file are not shown. View the raw message.

sound/pci/hda/hda_intel.c +1 -0
index 7d7f9aac50a9..a5e0da162dcf 100644

Lines of this file are not shown. View the raw message.

sound/pci/hda/patch_realtek.c +2 -0
index 8192be394d0d..7fd8fa5a9222 100644

Lines of this file are not shown. View the raw message.

sound/pci/hda/tas2781_hda_i2c.c +1 -0
index 0e42b87dadb8..4dd9aa0867de 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/ak4xxx.c +2 -0
index cad33a2f26bc..20936f4cbae6 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/delta.c +4 -0
index 08adf4dd1303..60e667c285ab 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/ews.c +6 -0
index 8bb86b3c894e..08f5a3853f05 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/hoontech.c +1 -0
index 46daeea8dc66..76637ad016ed 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/ice1712.h +2 -0
index cd02710d8271..bc93f521ce25 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/prodigy192.c +2 -0
index a12dafbf53ab..2fcfd8c42ad9 100644

Lines of this file are not shown. View the raw message.

sound/pci/ice1712/revo.c +4 -0
index bcf114152dfd..6b6b5fc524a5 100644

Lines of this file are not shown. View the raw message.

sound/pci/pcxhr/pcxhr_core.c +1 -0
index 23f253effb4f..b25622146ae7 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/rt5677.c +2 -0
index 0e70a3ab42b5..197d38973fe5 100644

Lines of this file are not shown. View the raw message.

sound/soc/codecs/wcd-mbhc-v2.c +6 -1
index d589a212b768..f16a20ef2215 100644

Lines of this file are not shown. View the raw message.

sound/soc/soc-dapm.c +9 -0
index b5116b700d73..8b5e02e5df4b 100644

Lines of this file are not shown. View the raw message.

sound/soc/soc-pcm.c +25 -0
index 88b3ad5a2552..d8ec4e8e05aa 100644

Lines of this file are not shown. View the raw message.

sound/soc/sof/intel/hda-mlink.c +2 -0
index fe627bcb0531..6c157af2f940 100644

Lines of this file are not shown. View the raw message.

sound/soc/sof/ipc3-control.c +1 -0
index 2b1befad6d5c..d8094682607c 100644

Lines of this file are not shown. View the raw message.

sound/soc/sof/ipc4-control.c +1 -0
index 576f407cd456..89d21f4d197b 100644

Lines of this file are not shown. View the raw message.

sound/synth/emux/soundfont.c +2 -0
index b38a4e231790..66330f96b97b 100644

Lines of this file are not shown. View the raw message.

virt/kvm/kvm_main.c +3 -0
index faf10671eed2..a59c1e02f89d 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

author maintainer
#54 lore raw

RFC PATCH 33/33 kbuild: clang: Unconditionally enable thread-safety checking

In reply to Bart Van Assche

Enable thread-safety checks for arm64 and x86. Do not enable it for other architectures yet - this will be done later. Disable thread-safety checking for staging drivers. Fixing thread-safety bugs in staging drivers will have to be done when these drivers come out of staging.

Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Bill Wendling <[email protected]>
Cc Justin Stitt <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/Makefile | 2 ++
 scripts/Makefile.clang   | 3 +++
 2 files changed, 5 insertions(+)
drivers/staging/Makefile +2 -0
index e681e403509c..4eafda5b95eb 100644
@@ -1,6 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0
 # Makefile for staging directory
 
+KBUILD_CFLAGS += -Wno-thread-safety
+
 obj-y				+= media/
 obj-$(CONFIG_RTL8723BS)		+= rtl8723bs/
 obj-$(CONFIG_OCTEON_ETHERNET)	+= octeon/
scripts/Makefile.clang +3 -0
index 2435efae67f5..d27688bddd95 100644
@@ -36,5 +36,8 @@ CLANG_FLAGS	+= -Werror=unknown-warning-option
 CLANG_FLAGS	+= -Werror=ignored-optimization-argument
 CLANG_FLAGS	+= -Werror=option-ignored
 CLANG_FLAGS	+= -Werror=unused-command-line-argument
+
+CLANG_FLAGS	+= -Wthread-safety
+
 KBUILD_CPPFLAGS	+= $(CLANG_FLAGS)
 export CLANG_FLAGS
#55 lore raw
In reply to Bart Van Assche
Quoted 34 lines · Bart Van Assche

Hi Peter,

As you may know the Clang compiler can perform certain thread-safety checks at compile time. This includes checking whether locking calls in a function match the function attributes and also whether annotated structure members are protected by the synchronization objects declared with GUARDED_BY(). As one can see this patch series includes a significant number of fixes for locking bugs. All these locking bugs have been discovered by the Clang thread-safety checker. I think this shows that it is useful to enable compile-time thread-safety checks.

The Clang thread-safety infrastructure is not new. Some user space code in the kernel tree already uses it. See also the header file tools/perf/util/mutex.h. There are other projects that started using this infrastructure a while ago, e.g. Qemu. The header file include/qemu/clang-tsa.h was added more than two years ago to the Qemu project.

This patch series has been posted as an RFC because at this stage my goal is to gather feedback about the following:
- Whether or not to enable compile-time thread-safety checking in the Linux kernel.
- The names of the macros in header file include/linux/thread_safety.h. The proposed names come from the Clang documentation (ACQUIRE(), RELEASE(), REQUIRES(), ...). In the Qemu header file for thread-safety support these macros have a prefix (TSA_ = Thread-Safety Analysis).
- The changes made in header file include/linux/cleanup.h that support annotating constructor functions with function attributes.
- Whether or not to split the two treewide patches in this series into one patch per kernel driver.
- How to merge this patch series. The second last patch in this series modifies 888 source files. If it is split into one patch per driver, this patch series will become too large to be posted as a single patch series.

Quoted 8 lines

Annotating struct mutex is a first step. Once struct mutex is annotated, driver contributors and/or maintainers can annotate structure members with GUARDED_BY() where this is considered useful.

There are more synchronization objects that can be annotated with thread-safety attributes, e.g. spinlocks. This patch series only annotates struct mutex because annotating other synchronization objects too would have made this patch series too large.

Thanks Bart, for posting your approach.
I will also discuss my approach, as it will give everyone a clearer picture of the design space here.

Bart and I have concurrently been working on this feature, and only in recent days learned we both have been working on bringing -Wthread-safety (aka. Clang's ThreadSafety Analysis [1], aka. Capability analysis) to the Linux kernel. I have heard there have been prior attempts, but only recently did Clang make -Wthread-safety properly work with C code [2].

[1] https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
[2] https://github.com/llvm/llvm-project/issues/20777

However, we also realized there are 2 ways to bring this feature to the kernel:

1. Tree-wide all-or-nothing approach (this RFC). Adding support for more "capabilities" - initially primarily synchronization primitives - becomes incredibly hard after the first capability (currently "mutex" only). This approach comes with all the known caveats of adding a new tree-wide static analysis to the kernel.

In fact, what it really is, is yet another dialect of C with a "capability system", with its own constraints. I dislike Clang's naming and the notion this is about "thread safety only" - it's not. It's a simple capability system, that can do much more.

In that vein, because we can't change the programming language (even if from one C dialect to another) of the kernel overnight, a different approach might cause less friction.

2. A selective, incremental, and much less intrusive approach. Maintainers of subsystems opt in their modules or directories into "capability analysis" (via Makefile directive "CAPABILITY_ANALYSIS_foo.o := y" or "CAPABILITY_ANALYSIS := y"). Most (eventually all) synchronization primitives and more capabilities (including ones that could track "irq disabled", "preemption" disabled, etc.) could be supported.

A prototype of approach #2 can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git/log/?h=cap-analysis
Here's the RFC:
https://lore.kernel.org/all/[email protected]/T/#u

Combining approach #1 and #2 may somehow be possible, but it is currently eluding me. Clearly, based on the bugs that Bart found, some way to do tree-wide analysis is very useful!
One idea was to have "capability-selective tree-wide analysis" (such as mutex only) be controllable via a Kconfig option - the implementation of that (without excessive ifdefs sprinkled everywhere), however, most likely requires compiler support.

Depending on the feedback that results from these RFCs, I think we will be able to plan better which direction things should go.

Thanks,
-- Marco

author maintainer
#56 lore raw
Quoted 10 lines · Marco Elver

Combining approach #1 and #2 may somehow be possible, but it is currently eluding me. Clearly, based on the bugs that Bart found, some way to do tree-wide analysis is very useful!
One idea was to have "capability-selective tree-wide analysis" (such as mutex only) be controllable via a Kconfig option - the implementation of that (without excessive ifdefs sprinkled everywhere), however, most likely requires compiler support.

Depending on the feedback that results from these RFCs, I think we will be able to plan better which direction things should go.

Thank you Marco for having explained clearly and in detail what the possible paths are for enabling thread-safety support in the Linux kernel. I agree that there are at least two possible approaches (maybe there are even more possible approaches?). I'm interested in enabling the Clang compiler flag -Wthread-safety across the entire kernel. Hence the choice to start with annotating struct mutex only and to make the necessary changes across the entire kernel tree.

I'm looking forward to the feedback from others about what their opinion is about how to enable thread-safety checking in the Linux kernel.

Thanks,

Bart.

maintainer
#57 lore raw
Quoted 2 lines · Bart Van Assche

I'm looking forward to the feedback from others about what their opinion is about how to enable thread-safety checking in the Linux kernel.

So Bart's patches are rather SHOUTING A LOT:-(, which I find really jarring to look at.

Also, however much I despise the sparse thing, that is something we already have some of, so we might as well adapt that.

But I should probably go read up on the whole clang feature first.

I've seen both have a __guarded_by() variant for structure members, can you stack those?

Eg. perf has locking where a structure has both a raw_spinlock_t and a mutex and modification requires holding both, but holding either is sufficient for reading.

#58 lore raw
Quoted 11 lines · Peter Zijlstra
Quoted 2 lines · Bart Van Assche

I'm looking forward to the feedback from others about what their opinion is about how to enable thread-safety checking in the Linux kernel.

So Bart's patches are rather SHOUTING A LOT:-(, which I find really jarring to look at.

Also, however much I despise the sparse thing, that is something we already have some of, so we might as well adapt that.

Quoted 8 lines

But I should probably go read up on the whole clang feature first.

I've seen both have a __guarded_by() variant for structure members, can you stack those?

Eg. perf has locking where a structure has both a raw_spinlock_t and a mutex and modification requires holding both, but holding either is sufficient for reading.

Yes, you can add multiple guarded_by. But it's just going to enforce that you need to hold both locks before you access the member. If you want the rules to be more complex, the best way to express that is with some helpers. E.g. something like this (tested on top my series)

lib/test_capability-analysis.c +50 -0
@@ -479,3 +479,53 @@ static void __used test_local_lock_guard(void)
 	{ guard(local_lock_irqsave)(&test_local_lock_data.lock); this_cpu_add(test_local_lock_data.counter, 1); }
 	{ guard(local_lock_nested_bh)(&test_local_lock_data.lock); this_cpu_add(test_local_lock_data.counter, 1); }
 }
+
+struct some_data {
+	spinlock_t lock;
+	struct mutex mtx;
+	int counter __var_guarded_by(&lock) __var_guarded_by(&mtx);
+};
+
+static void some_data_read_lock_via_lock(struct some_data *d)
+	__acquires(&d->lock) __acquires_shared(&d->mtx)
+{
+	spin_lock(&d->lock);
+	__acquire_shared(&d->mtx);
+}
+
+static void some_data_read_unlock_via_lock(struct some_data *d)
+	__releases(&d->lock) __releases_shared(&d->mtx)
+{
+	__release_shared(&d->mtx);
+	spin_unlock(&d->lock);
+}
+
+static void some_data_read_lock_via_mtx(struct some_data *d)
+	__acquires(&d->mtx) __acquires_shared(&d->lock)
+{
+	mutex_lock(&d->mtx);
+	__acquire_shared(&d->lock);
+}
+
+static void some_data_read_unlock_via_mtx(struct some_data *d)
+	__releases(&d->mtx) __releases_shared(&d->lock)
+{
+	__release_shared(&d->lock);
+	mutex_unlock(&d->mtx);
+}
+
+static void __used foo_1(struct some_data *d)
+{
+	some_data_read_lock_via_lock(d);
+	(void)d->counter;
+	// d->counter++;  // error, because mtx only held shared
+	some_data_read_unlock_via_lock(d);
+}
+
+static void __used foo_2(struct some_data *d)
+{
+	some_data_read_lock_via_mtx(d);
+	(void)d->counter;
+	// d->counter++;  // error, because lock only held shared
+	some_data_read_unlock_via_mtx(d);
+}
maintainer
#59 lore raw
Quoted 4 lines · Marco Elver

Yes, you can add multiple guarded_by. But it's just going to enforce that you need to hold both locks before you access the member. If you want the rules to be more complex, the best way to express that is with some helpers. E.g. something like this (tested on top my series)

Oh gawd, this is going to be a pain, isn't it :/

#60 lore raw
Quoted 9 lines · Peter Zijlstra
Quoted 4 lines · Marco Elver

Yes, you can add multiple guarded_by. But it's just going to enforce that you need to hold both locks before you access the member. If you want the rules to be more complex, the best way to express that is with some helpers. E.g. something like this (tested on top my series)

Oh gawd, this is going to be a pain, isn't it :/

For complex locking patterns, yes. :-/

Which is why I'm proposing it to be opt-in but relatively complete (most primitives supported), so that either we have time to work out how to deal with more complex patterns, or just leave some things opted-out.

author maintainer
#61 lore raw
In reply to Peter Zijlstra
Quoted 7 lines · Peter Zijlstra
Quoted 4 lines · Marco Elver

Yes, you can add multiple guarded_by. But it's just going to enforce that you need to hold both locks before you access the member. If you want the rules to be more complex, the best way to express that is with some helpers. E.g. something like this (tested on top my series)

Oh gawd, this is going to be a pain, isn't it :/

The Clang thread-safety annotations are used widely so behavior of existing attributes must be preserved. I propose to introduce new thread-safety attributes when useful to annotate kernel code. As an example, the Clang try_acquire_capability function attribute does not support functions that return pointers although this is a common pattern in the Linux kernel. I think that introducing a new function attribute to support functions that return pointers is a better solution than trying to annotate such functions with any of the existing Clang thread-safety attributes.

Thanks,

Bart.

#62 lore raw
Quoted 8 lines · Bart Van Assche
Quoted 6 lines · Peter Zijlstra
Quoted 4 lines · Marco Elver

Yes, you can add multiple guarded_by. But it's just going to enforce that you need to hold both locks before you access the member. If you want the rules to be more complex, the best way to express that is with some helpers. E.g. something like this (tested on top my series)

Quoted 5 lines
Quoted 1 line

Oh gawd, this is going to be a pain, isn't it :/

The Clang thread-safety annotations are used widely so behavior of existing attributes must be preserved. I propose to introduce new thread-safety attributes when useful to annotate kernel code.

Agreed - we can't change the existing semantics, but if absolutely necessary we could think about extensions (which I already started for something else: https://github.com/llvm/llvm-project/pull/123063)

Quoted 7 lines

As an
example, the Clang try_acquire_capability function attribute does not support functions that return pointers although this is a common pattern in the Linux kernel. I think that introducing a new function attribute to support functions that return pointers is a better solution than trying to annotate such functions with any of the existing Clang thread-safety attributes.

try_acquire_capability / __cond_acquires(cond, capability) is happy with pointer-returning functions when using int-literals for "cond" i.e. 0 or 1 (Clang's documentation says it only wants bool, but that's wrong). I just tested this on a pointer-returning function, and it works.

author maintainer
#63 lore raw
Quoted 9 lines · Marco Elver
Quoted 7 lines · Bart Van Assche

As an
example, the Clang try_acquire_capability function attribute does not support functions that return pointers although this is a common pattern in the Linux kernel. I think that introducing a new function attribute to support functions that return pointers is a better solution than trying to annotate such functions with any of the existing Clang thread-safety attributes.

Quoted 5 lines

try_acquire_capability / __cond_acquires(cond, capability) is happy with pointer-returning functions when using int-literals for "cond" i.e. 0 or 1 (Clang's documentation says it only wants bool, but that's wrong). I just tested this on a pointer-returning function, and it works.

The first argument of the try_acquire_capability function annotation must be the value that indicates that the capability has been acquired. I'm not aware of any function in the Linux kernel that returns a pointer and where returning a NULL pointer indicates success. Additionally, return ERR_PTR() is used widely. Neither pattern can be annotated with try_acquire_capability today. This is why I wrote that we need a new function attribute for functions that return a pointer.

Thanks,

Bart.

#64 lore raw
Quoted 17 lines · Bart Van Assche
Quoted 9 lines · Marco Elver
Quoted 7 lines · Bart Van Assche

As an
example, the Clang try_acquire_capability function attribute does not support functions that return pointers although this is a common pattern in the Linux kernel. I think that introducing a new function attribute to support functions that return pointers is a better solution than trying to annotate such functions with any of the existing Clang thread-safety attributes.

Quoted 5 lines

try_acquire_capability / __cond_acquires(cond, capability) is happy with pointer-returning functions when using int-literals for "cond" i.e. 0 or 1 (Clang's documentation says it only wants bool, but that's wrong). I just tested this on a pointer-returning function, and it works.

Quoted 7 lines

The first argument of the try_acquire_capability function annotation must be the value that indicates that the capability has been acquired. I'm not aware of any function in the Linux kernel that returns a pointer and where returning a NULL pointer indicates success. Additionally, return ERR_PTR() is used widely. Neither pattern can be annotated with try_acquire_capability today. This is why I wrote that we need a new function attribute for functions that return a pointer.

The static analysis doesn't care about the precise value. If a non-null pointer indicates successful acquisition, then using the literal "1" works. ERR_PTR() is a problem given that non-null may indicate error and success. Type-safety of ERR_PTR() is debatable, and by that fact alone it's unclear to me how to teach that to the static analysis, because it doesn't operate on concrete values, but an abstract state. In this case, it just cares if the branch was taken or not based on the value of a try_acquire_capability-annotated function, and the hint on try_acquire_capability tells it which branch is the one that will have the capability acquired. Code is around here:
https://github.com/llvm/llvm-project/blob/5a0075adbb623c8661862b9af1272b8f430d9e5c/clang/lib/Analysis/ThreadSafety.cpp#L1381

#65 lore raw
In reply to Marco Elver
Quoted 10 lines · Marco Elver

Combining approach #1 and #2 may somehow be possible, but it is currently eluding me. Clearly, based on the bugs that Bart found, some way to do tree-wide analysis is very useful!
One idea was to have "capability-selective tree-wide analysis" (such as mutex only) be controllable via a Kconfig option - the implementation of that (without excessive ifdefs sprinkled everywhere), however, most likely requires compiler support.

Depending on the feedback that results from these RFCs, I think we will be able to plan better which direction things should go.

Opt-in just means some code will never get it. So I think we'll need to eventually force all the useful capabilities everywhere.

Doing that step by step by opt-in/opt-out for early adopters sounds fine.