linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
@ 2024-10-04  9:41 Sakari Ailus
  2024-10-04  9:41 ` [PATCH 43/51] thunderbolt: " Sakari Ailus
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Sakari Ailus @ 2024-10-04  9:41 UTC (permalink / raw)
  To: dri-devel, linux-kernel, linux-bluetooth, linux-clk, linux-crypto,
	dmaengine, linux-gpio, amd-gfx, nouveau, linux-stm32,
	linux-arm-kernel, linux-i2c, linux-i3c, linux-iio, linux-input,
	patches, iommu, imx, linux-mediatek, linux-media, linux-mmc,
	linux-mtd, netdev, linux-wireless, linux-pci, linux-phy,
	linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi
  Cc: laurent.pinchart, rafael, Andy Shevchenko

Hello everyone,

This set will switch the users of pm_runtime_put_autosuspend() to
__pm_runtime_put_autosuspend() while the former will soon be re-purposed
to include a call to pm_runtime_mark_last_busy(). The two are almost
always used together, apart from bugs which are likely common. Going
forward, most new users should be using pm_runtime_put_autosuspend().

Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
and pm_runtime_mark_last_busy().

The diff in these patches have been generated using the following
Coccinelle script (besides a manual change in
drivers/iio/magnetometer/af8133j.c):

----------8<-------------------
@@
expression E1;

@@

- pm_runtime_put_autosuspend(E1)
+ __pm_runtime_put_autosuspend(E1)
----------8<-------------------

These patches are on top of today's linux-next (i.e. next-20241004).

Sakari Ailus (51):
  accel/ivpu: Switch to __pm_runtime_put_autosuspend()
  bluetooth: Switch to __pm_runtime_put_autosuspend()
  bus: sunxi-rsb: Switch to __pm_runtime_put_autosuspend()
  hwrng: Switch to __pm_runtime_put_autosuspend()
  clk: Switch to __pm_runtime_put_autosuspend()
  crypto: Switch to __pm_runtime_put_autosuspend()
  dmaengine: Switch to __pm_runtime_put_autosuspend()
  gpio: Switch to __pm_runtime_put_autosuspend()
  drm/amd: Switch to __pm_runtime_put_autosuspend()
  drm/nouveau: Switch to __pm_runtime_put_autosuspend()
  drm/radeon: Switch to __pm_runtime_put_autosuspend()
  drm/panfrost: Switch to __pm_runtime_put_autosuspend()
  drivers: drm: Switch to __pm_runtime_put_autosuspend()
  HSI: omap_ssi_port: Switch to __pm_runtime_put_autosuspend()
  stm class: Switch to __pm_runtime_put_autosuspend()
  i2c: Switch to __pm_runtime_put_autosuspend()
  i3c: master: svc: Switch to __pm_runtime_put_autosuspend()
  i3c: dw: Switch to __pm_runtime_put_autosuspend()
  iio: Switch to __pm_runtime_put_autosuspend()
  Input: omap4-keypad: Switch to __pm_runtime_put_autosuspend()
  Input: cs40l50: Switch to __pm_runtime_put_autosuspend()
  iommu/arm-smmu: Switch to __pm_runtime_put_autosuspend()
  irqchip/imx-irqsteer: Switch to __pm_runtime_put_autosuspend()
  mailbox: mtk-cmdq-mailbox: Switch to __pm_runtime_put_autosuspend()
  media: Switch to __pm_runtime_put_autosuspend()
  mfd: Switch to __pm_runtime_put_autosuspend()
  mei: Switch to __pm_runtime_put_autosuspend()
  mmc: Switch to __pm_runtime_put_autosuspend()
  mtd: rawnand: gpmi: Switch to __pm_runtime_put_autosuspend()
  net: Switch to __pm_runtime_put_autosuspend()
  nfc: trf7970a: Switch to __pm_runtime_put_autosuspend()
  PCI/portdrv: Switch to __pm_runtime_put_autosuspend()
  phy: motorola: phy-mapphone-mdm6600: Switch to
    __pm_runtime_put_autosuspend()
  phy: ti: phy-twl4030-usb: Switch to __pm_runtime_put_autosuspend()
  power: Switch to __pm_runtime_put_autosuspend()
  pwm: img: Switch to __pm_runtime_put_autosuspend()
  regulator: stm32-vrefbuf: Switch to __pm_runtime_put_autosuspend()
  remoteproc: omap: Switch to __pm_runtime_put_autosuspend()
  slimbus: Switch to __pm_runtime_put_autosuspend()
  soundwire: Switch to __pm_runtime_put_autosuspend()
  spi: Switch to __pm_runtime_put_autosuspend()
  staging: Switch to __pm_runtime_put_autosuspend()
  thunderbolt: Switch to __pm_runtime_put_autosuspend()
  serial: Switch to __pm_runtime_put_autosuspend()
  usb: Switch to __pm_runtime_put_autosuspend()
  w1: omap-hdq: Switch to __pm_runtime_put_autosuspend()
  staging: greybus: Switch to __pm_runtime_put_autosuspend()
  ALSA: hda: Switch to __pm_runtime_put_autosuspend()
  ASoC: Switch to __pm_runtime_put_autosuspend()
  ALSA: intel_hdmi: Switch to __pm_runtime_put_autosuspend()
  soc: apple: mailbox: Switch to __pm_runtime_put_autosuspend()

 drivers/accel/ivpu/ivpu_drv.c                 |   2 +-
 drivers/accel/ivpu/ivpu_pm.c                  |   8 +-
 drivers/bluetooth/btmtksdio.c                 |   2 +-
 drivers/bluetooth/hci_bcm.c                   |   6 +-
 drivers/bluetooth/hci_h5.c                    |   4 +-
 drivers/bluetooth/hci_intel.c                 |   6 +-
 drivers/bus/sunxi-rsb.c                       |   4 +-
 drivers/char/hw_random/cctrng.c               |   2 +-
 drivers/char/hw_random/omap3-rom-rng.c        |   2 +-
 drivers/clk/imx/clk-imx8qxp-lpcg.c            |   2 +-
 drivers/clk/imx/clk-scu.c                     |   2 +-
 drivers/clk/qcom/lpassaudiocc-sc7280.c        |   4 +-
 drivers/clk/qcom/lpasscorecc-sc7180.c         |   4 +-
 drivers/crypto/ccree/cc_pm.c                  |   2 +-
 drivers/crypto/hisilicon/qm.c                 |   2 +-
 drivers/crypto/omap-aes-gcm.c                 |   2 +-
 drivers/crypto/omap-aes.c                     |   2 +-
 drivers/crypto/omap-des.c                     |   2 +-
 drivers/crypto/omap-sham.c                    |   2 +-
 drivers/crypto/rockchip/rk3288_crypto_ahash.c |   2 +-
 .../crypto/rockchip/rk3288_crypto_skcipher.c  |   2 +-
 drivers/crypto/stm32/stm32-crc32.c            |   4 +-
 drivers/crypto/stm32/stm32-cryp.c             |   2 +-
 drivers/crypto/stm32/stm32-hash.c             |   2 +-
 drivers/dma/at_xdmac.c                        |  24 +--
 drivers/dma/pl330.c                           |  14 +-
 drivers/dma/qcom/bam_dma.c                    |  10 +-
 drivers/dma/qcom/hidma.c                      |  18 +-
 drivers/dma/qcom/hidma_dbg.c                  |   2 +-
 drivers/dma/qcom/hidma_mgmt.c                 |   4 +-
 drivers/dma/ste_dma40.c                       |  16 +-
 drivers/dma/ti/cppi41.c                       |  10 +-
 drivers/dma/xilinx/zynqmp_dma.c               |   2 +-
 drivers/gpio/gpio-arizona.c                   |  10 +-
 drivers/gpio/gpio-mxc.c                       |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c      |   2 +-
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |  16 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   | 120 ++++++------
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c       |   4 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       |   2 +-
 .../gpu/drm/amd/amdgpu/amdgpu_securedisplay.c |   4 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c      |   4 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   2 +-
 drivers/gpu/drm/amd/pm/amdgpu_pm.c            | 178 +++++++++---------
 .../drm/bridge/analogix/analogix_dp_core.c    |   2 +-
 drivers/gpu/drm/bridge/analogix/anx7625.c     |   4 +-
 drivers/gpu/drm/bridge/parade-ps8640.c        |   4 +-
 drivers/gpu/drm/bridge/ti-sn65dsi86.c         |  14 +-
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c         |  12 +-
 drivers/gpu/drm/exynos/exynos_drm_fimc.c      |   4 +-
 drivers/gpu/drm/exynos/exynos_drm_g2d.c       |   4 +-
 drivers/gpu/drm/exynos/exynos_drm_gsc.c       |   6 +-
 drivers/gpu/drm/exynos/exynos_drm_rotator.c   |   2 +-
 drivers/gpu/drm/exynos/exynos_drm_scaler.c    |   2 +-
 drivers/gpu/drm/i915/intel_runtime_pm.c       |   4 +-
 drivers/gpu/drm/imx/dcss/dcss-crtc.c          |   2 +-
 drivers/gpu/drm/lima/lima_sched.c             |   2 +-
 drivers/gpu/drm/msm/adreno/adreno_device.c    |   2 +-
 drivers/gpu/drm/msm/adreno/adreno_gpu.c       |   2 +-
 drivers/gpu/drm/msm/msm_gpu.c                 |   2 +-
 drivers/gpu/drm/msm/msm_iommu.c               |   4 +-
 drivers/gpu/drm/msm/msm_submitqueue.c         |   2 +-
 drivers/gpu/drm/nouveau/dispnv50/disp.c       |  10 +-
 drivers/gpu/drm/nouveau/nouveau_connector.c   |   4 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c     |   8 +-
 drivers/gpu/drm/nouveau/nouveau_display.c     |   4 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c         |  10 +-
 drivers/gpu/drm/nouveau/nouveau_gem.c         |  10 +-
 drivers/gpu/drm/panel/panel-edp.c             |   8 +-
 .../gpu/drm/panel/panel-samsung-atna33xc20.c  |   6 +-
 drivers/gpu/drm/panel/panel-simple.c          |   6 +-
 drivers/gpu/drm/panfrost/panfrost_job.c       |   4 +-
 drivers/gpu/drm/panfrost/panfrost_mmu.c       |   4 +-
 drivers/gpu/drm/panfrost/panfrost_perfcnt.c   |   4 +-
 drivers/gpu/drm/panthor/panthor_device.c      |   2 +-
 drivers/gpu/drm/panthor/panthor_sched.c       |   6 +-
 drivers/gpu/drm/radeon/radeon_acpi.c          |   2 +-
 drivers/gpu/drm/radeon/radeon_connectors.c    |  20 +-
 drivers/gpu/drm/radeon/radeon_display.c       |   6 +-
 drivers/gpu/drm/radeon/radeon_drv.c           |   4 +-
 drivers/gpu/drm/radeon/radeon_fbdev.c         |   4 +-
 drivers/gpu/drm/radeon/radeon_kms.c           |  10 +-
 drivers/gpu/drm/tegra/submit.c                |   2 +-
 drivers/gpu/drm/tidss/tidss_drv.c             |   2 +-
 drivers/gpu/drm/vc4/vc4_v3d.c                 |   2 +-
 drivers/hsi/controllers/omap_ssi_port.c       |  42 ++---
 drivers/hwtracing/stm/core.c                  |   8 +-
 drivers/i2c/busses/i2c-amd-mp2-pci.c          |   2 +-
 drivers/i2c/busses/i2c-amd-mp2.h              |   2 +-
 drivers/i2c/busses/i2c-at91-master.c          |   2 +-
 drivers/i2c/busses/i2c-cadence.c              |   2 +-
 drivers/i2c/busses/i2c-davinci.c              |   4 +-
 drivers/i2c/busses/i2c-designware-master.c    |   2 +-
 drivers/i2c/busses/i2c-designware-pcidrv.c    |   2 +-
 drivers/i2c/busses/i2c-hix5hd2.c              |   2 +-
 drivers/i2c/busses/i2c-i801.c                 |   4 +-
 drivers/i2c/busses/i2c-img-scb.c              |   6 +-
 drivers/i2c/busses/i2c-imx-lpi2c.c            |   6 +-
 drivers/i2c/busses/i2c-imx.c                  |   4 +-
 drivers/i2c/busses/i2c-mv64xxx.c              |   2 +-
 drivers/i2c/busses/i2c-nvidia-gpu.c           |   4 +-
 drivers/i2c/busses/i2c-omap.c                 |   6 +-
 drivers/i2c/busses/i2c-qcom-cci.c             |   2 +-
 drivers/i2c/busses/i2c-qcom-geni.c            |   2 +-
 drivers/i2c/busses/i2c-qup.c                  |   4 +-
 drivers/i2c/busses/i2c-riic.c                 |   4 +-
 drivers/i2c/busses/i2c-rzv2m.c                |   2 +-
 drivers/i2c/busses/i2c-sprd.c                 |   4 +-
 drivers/i2c/busses/i2c-stm32f7.c              |  10 +-
 drivers/i2c/busses/i2c-xiic.c                 |   2 +-
 drivers/i3c/master/dw-i3c-master.c            |  16 +-
 drivers/i3c/master/svc-i3c-master.c           |  16 +-
 drivers/iio/accel/bmc150-accel-core.c         |   2 +-
 drivers/iio/accel/bmi088-accel-core.c         |   6 +-
 drivers/iio/accel/fxls8962af-core.c           |   2 +-
 drivers/iio/accel/kxcjk-1013.c                |   2 +-
 drivers/iio/accel/kxsd9.c                     |   6 +-
 drivers/iio/accel/mma8452.c                   |   2 +-
 drivers/iio/accel/mma9551_core.c              |   2 +-
 drivers/iio/accel/msa311.c                    |  12 +-
 drivers/iio/adc/ab8500-gpadc.c                |   2 +-
 drivers/iio/adc/at91-sama5d2_adc.c            |  20 +-
 drivers/iio/adc/rcar-gyroadc.c                |   2 +-
 drivers/iio/adc/stm32-adc-core.c              |   2 +-
 drivers/iio/adc/stm32-adc.c                   |  12 +-
 drivers/iio/adc/sun4i-gpadc-iio.c             |   4 +-
 drivers/iio/adc/ti-ads1015.c                  |   2 +-
 drivers/iio/adc/ti-ads1100.c                  |   2 +-
 drivers/iio/adc/ti-ads1119.c                  |   4 +-
 drivers/iio/chemical/atlas-sensor.c           |   4 +-
 .../common/hid-sensors/hid-sensor-trigger.c   |   2 +-
 drivers/iio/dac/stm32-dac.c                   |   6 +-
 drivers/iio/gyro/bmg160_core.c                |   2 +-
 drivers/iio/gyro/fxas21002c_core.c            |   2 +-
 drivers/iio/gyro/mpu3050-core.c               |   6 +-
 drivers/iio/gyro/mpu3050-i2c.c                |   2 +-
 .../iio/imu/inv_icm42600/inv_icm42600_accel.c |  10 +-
 .../imu/inv_icm42600/inv_icm42600_buffer.c    |   2 +-
 .../iio/imu/inv_icm42600/inv_icm42600_gyro.c  |  10 +-
 .../iio/imu/inv_icm42600/inv_icm42600_temp.c  |   2 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    |  14 +-
 drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |   4 +-
 drivers/iio/imu/kmx61.c                       |   2 +-
 drivers/iio/light/apds9306.c                  |   6 +-
 drivers/iio/light/apds9960.c                  |   4 +-
 drivers/iio/light/bh1780.c                    |   2 +-
 drivers/iio/light/gp2ap002.c                  |   4 +-
 drivers/iio/light/isl29028.c                  |   2 +-
 drivers/iio/light/ltrf216a.c                  |   2 +-
 drivers/iio/light/pa12203001.c                |   2 +-
 drivers/iio/light/rpr0521.c                   |   2 +-
 drivers/iio/light/tsl2583.c                   |   2 +-
 drivers/iio/light/tsl2591.c                   |   4 +-
 drivers/iio/light/us5182d.c                   |   2 +-
 drivers/iio/light/vcnl4000.c                  |   2 +-
 drivers/iio/light/vcnl4035.c                  |   2 +-
 drivers/iio/magnetometer/af8133j.c            |   4 +-
 drivers/iio/magnetometer/ak8974.c             |   4 +-
 drivers/iio/magnetometer/ak8975.c             |   2 +-
 drivers/iio/magnetometer/bmc150_magn.c        |   2 +-
 drivers/iio/magnetometer/tmag5273.c           |   4 +-
 drivers/iio/magnetometer/yamaha-yas530.c      |   4 +-
 drivers/iio/pressure/bmp280-core.c            |  10 +-
 drivers/iio/pressure/icp10100.c               |   2 +-
 drivers/iio/pressure/mpl115.c                 |   4 +-
 drivers/iio/pressure/zpa2326.c                |   4 +-
 .../iio/proximity/pulsedlight-lidar-lite-v2.c |   2 +-
 drivers/iio/proximity/srf04.c                 |   2 +-
 drivers/iio/temperature/mlx90614.c            |   4 +-
 drivers/iio/temperature/mlx90632.c            |   4 +-
 drivers/iio/temperature/mlx90635.c            |   4 +-
 drivers/input/keyboard/omap4-keypad.c         |   8 +-
 drivers/input/misc/cs40l50-vibra.c            |   8 +-
 drivers/iommu/arm/arm-smmu/arm-smmu.c         |   2 +-
 drivers/irqchip/irq-imx-irqsteer.c            |   2 +-
 drivers/mailbox/mtk-cmdq-mailbox.c            |  10 +-
 drivers/media/i2c/alvium-csi2.c               |   2 +-
 drivers/media/i2c/ccs/ccs-core.c              |  10 +-
 drivers/media/i2c/dw9719.c                    |   2 +-
 drivers/media/i2c/gc0308.c                    |   6 +-
 drivers/media/i2c/gc2145.c                    |   8 +-
 drivers/media/i2c/imx283.c                    |   6 +-
 drivers/media/i2c/imx290.c                    |   6 +-
 drivers/media/i2c/imx296.c                    |   4 +-
 drivers/media/i2c/imx415.c                    |   4 +-
 drivers/media/i2c/mt9m114.c                   |  12 +-
 drivers/media/i2c/ov2680.c                    |   2 +-
 drivers/media/i2c/ov4689.c                    |   6 +-
 drivers/media/i2c/ov5640.c                    |   8 +-
 drivers/media/i2c/ov5645.c                    |   6 +-
 drivers/media/i2c/ov5693.c                    |   2 +-
 drivers/media/i2c/ov64a40.c                   |   8 +-
 drivers/media/i2c/ov7251.c                    |   2 +-
 drivers/media/i2c/ov8858.c                    |   4 +-
 drivers/media/i2c/thp7312.c                   |   8 +-
 drivers/media/i2c/video-i2c.c                 |   8 +-
 .../media/platform/nvidia/tegra-vde/h264.c    |   4 +-
 drivers/media/platform/qcom/venus/vdec.c      |   4 +-
 drivers/media/platform/qcom/venus/venc.c      |   4 +-
 .../platform/raspberrypi/pisp_be/pisp_be.c    |   4 +-
 .../media/platform/st/sti/delta/delta-v4l2.c  |   4 +-
 drivers/media/platform/st/sti/hva/hva-hw.c    |   8 +-
 .../media/platform/verisilicon/hantro_drv.c   |   2 +-
 drivers/media/rc/gpio-ir-recv.c               |   2 +-
 drivers/mfd/arizona-irq.c                     |   2 +-
 drivers/mfd/cs40l50-core.c                    |   2 +-
 drivers/mfd/cs42l43.c                         |   2 +-
 drivers/misc/mei/client.c                     |  14 +-
 drivers/mmc/core/core.c                       |   4 +-
 drivers/mmc/host/atmel-mci.c                  |   4 +-
 drivers/mmc/host/dw_mmc-rockchip.c            |   2 +-
 drivers/mmc/host/dw_mmc.c                     |   2 +-
 drivers/mmc/host/mmci.c                       |   2 +-
 drivers/mmc/host/omap_hsmmc.c                 |   6 +-
 drivers/mmc/host/sdhci-msm.c                  |   2 +-
 drivers/mmc/host/sdhci-of-at91.c              |   2 +-
 drivers/mmc/host/sdhci-omap.c                 |   4 +-
 drivers/mmc/host/sdhci-pci-core.c             |   2 +-
 drivers/mmc/host/sdhci-pxav3.c                |   6 +-
 drivers/mmc/host/sdhci-sprd.c                 |   2 +-
 drivers/mmc/host/sdhci-xenon.c                |   2 +-
 drivers/mmc/host/sdhci_am654.c                |   2 +-
 drivers/mmc/host/tmio_mmc_core.c              |   2 +-
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c    |  10 +-
 drivers/net/ethernet/cadence/macb_main.c      |  10 +-
 drivers/net/ethernet/freescale/fec_main.c     |  16 +-
 drivers/net/ethernet/renesas/ravb_main.c      |   8 +-
 drivers/net/ethernet/ti/davinci_mdio.c        |  14 +-
 drivers/net/ipa/ipa_interrupt.c               |   2 +-
 drivers/net/ipa/ipa_main.c                    |   2 +-
 drivers/net/ipa/ipa_modem.c                   |   8 +-
 drivers/net/ipa/ipa_smp2p.c                   |   4 +-
 drivers/net/ipa/ipa_uc.c                      |   4 +-
 drivers/net/wireless/ath/wil6210/pm.c         |   2 +-
 drivers/net/wireless/ti/wl18xx/debugfs.c      |   6 +-
 drivers/net/wireless/ti/wlcore/cmd.c          |   2 +-
 drivers/net/wireless/ti/wlcore/debugfs.c      |  22 +--
 drivers/net/wireless/ti/wlcore/main.c         |  72 +++----
 drivers/net/wireless/ti/wlcore/scan.c         |   2 +-
 drivers/net/wireless/ti/wlcore/sysfs.c        |   2 +-
 drivers/net/wireless/ti/wlcore/testmode.c     |   4 +-
 drivers/net/wireless/ti/wlcore/tx.c           |   2 +-
 drivers/net/wireless/ti/wlcore/vendor_cmd.c   |   6 +-
 drivers/net/wwan/qcom_bam_dmux.c              |   4 +-
 drivers/net/wwan/t7xx/t7xx_hif_cldma.c        |   6 +-
 drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c    |   6 +-
 drivers/net/wwan/t7xx/t7xx_hif_dpmaif_tx.c    |   4 +-
 drivers/nfc/trf7970a.c                        |   2 +-
 drivers/pci/pcie/portdrv.c                    |   2 +-
 drivers/phy/motorola/phy-mapphone-mdm6600.c   |   4 +-
 drivers/phy/ti/phy-twl4030-usb.c              |   8 +-
 drivers/power/supply/bq24190_charger.c        |  28 +--
 drivers/power/supply/twl4030_charger.c        |   2 +-
 drivers/pwm/pwm-img.c                         |   4 +-
 drivers/regulator/stm32-vrefbuf.c             |  12 +-
 drivers/remoteproc/omap_remoteproc.c          |   6 +-
 drivers/slimbus/core.c                        |   2 +-
 drivers/slimbus/messaging.c                   |   4 +-
 drivers/soc/apple/mailbox.c                   |   2 +-
 drivers/soundwire/bus.c                       |   2 +-
 drivers/soundwire/cadence_master.c            |   2 +-
 drivers/soundwire/qcom.c                      |   6 +-
 drivers/spi/atmel-quadspi.c                   |  10 +-
 drivers/spi/spi-cadence-quadspi.c             |   4 +-
 drivers/spi/spi-cadence.c                     |   2 +-
 drivers/spi/spi-dw-pci.c                      |   2 +-
 drivers/spi/spi-fsl-espi.c                    |   4 +-
 drivers/spi/spi-fsl-lpspi.c                   |   4 +-
 drivers/spi/spi-imx.c                         |   6 +-
 drivers/spi/spi-mtk-nor.c                     |   2 +-
 drivers/spi/spi-omap2-mcspi.c                 |   6 +-
 drivers/spi/spi-pxa2xx-pci.c                  |   2 +-
 drivers/spi/spi-s3c64xx.c                     |   6 +-
 drivers/spi/spi-sprd.c                        |   2 +-
 drivers/spi/spi-stm32-qspi.c                  |  14 +-
 drivers/spi/spi-stm32.c                       |   4 +-
 drivers/spi/spi-ti-qspi.c                     |   4 +-
 drivers/spi/spi-zynqmp-gqspi.c                |   2 +-
 drivers/spi/spi.c                             |   6 +-
 drivers/staging/greybus/gbphy.h               |   2 +-
 drivers/staging/media/rkvdec/rkvdec.c         |   2 +-
 drivers/thunderbolt/debugfs.c                 |  22 +--
 drivers/thunderbolt/domain.c                  |   4 +-
 drivers/thunderbolt/icm.c                     |  14 +-
 drivers/thunderbolt/nhi.c                     |   2 +-
 drivers/thunderbolt/retimer.c                 |   4 +-
 drivers/thunderbolt/switch.c                  |   6 +-
 drivers/thunderbolt/tb.c                      |  18 +-
 drivers/thunderbolt/usb4_port.c               |   4 +-
 drivers/tty/serial/8250/8250_omap.c           |  18 +-
 drivers/tty/serial/8250/8250_port.c           |   4 +-
 drivers/tty/serial/fsl_lpuart.c               |   2 +-
 drivers/tty/serial/serial_core.c              |   2 +-
 drivers/tty/serial/uartlite.c                 |   4 +-
 drivers/tty/serial/xilinx_uartps.c            |   2 +-
 drivers/usb/cdns3/cdns3-gadget.c              |   2 +-
 drivers/usb/cdns3/cdnsp-gadget.c              |   2 +-
 drivers/usb/chipidea/core.c                   |   2 +-
 drivers/usb/chipidea/otg_fsm.c                |   2 +-
 drivers/usb/dwc3/core.c                       |   2 +-
 drivers/usb/dwc3/dwc3-am62.c                  |   2 +-
 drivers/usb/dwc3/dwc3-imx8mp.c                |   2 +-
 drivers/usb/gadget/udc/cdns2/cdns2-gadget.c   |   2 +-
 drivers/usb/host/xhci-mtk.c                   |   2 +-
 drivers/usb/misc/apple-mfi-fastcharge.c       |   2 +-
 drivers/usb/mtu3/mtu3_plat.c                  |   2 +-
 drivers/usb/musb/musb_core.c                  |  10 +-
 drivers/usb/musb/musb_debugfs.c               |  10 +-
 drivers/usb/musb/musb_dsps.c                  |   2 +-
 drivers/usb/musb/musb_gadget.c                |   8 +-
 drivers/usb/musb/omap2430.c                   |   2 +-
 drivers/w1/masters/omap_hdq.c                 |  10 +-
 include/linux/greybus/bundle.h                |   2 +-
 sound/hda/hdac_device.c                       |   2 +-
 sound/pci/hda/cs35l41_hda.c                   |   8 +-
 sound/pci/hda/cs35l56_hda.c                   |   2 +-
 sound/pci/hda/hda_intel.c                     |   2 +-
 sound/pci/hda/tas2781_hda_i2c.c               |   6 +-
 sound/soc/atmel/mchp-spdifrx.c                |  12 +-
 sound/soc/codecs/arizona-jack.c               |  12 +-
 sound/soc/codecs/arizona.c                    |   2 +-
 sound/soc/codecs/cs35l41.c                    |   4 +-
 sound/soc/codecs/cs35l45.c                    |   2 +-
 sound/soc/codecs/cs35l56-sdw.c                |   4 +-
 sound/soc/codecs/cs35l56-shared.c             |   2 +-
 sound/soc/codecs/cs35l56.c                    |   2 +-
 sound/soc/codecs/cs42l42-sdw.c                |   2 +-
 sound/soc/codecs/cs42l42.c                    |   4 +-
 sound/soc/codecs/cs42l43-jack.c               |  10 +-
 sound/soc/codecs/cs42l43.c                    |   4 +-
 sound/soc/codecs/hda.c                        |   6 +-
 sound/soc/codecs/madera.c                     |   6 +-
 sound/soc/codecs/max98363.c                   |   2 +-
 sound/soc/codecs/max98373-sdw.c               |   2 +-
 sound/soc/codecs/rt1017-sdca-sdw.c            |   2 +-
 sound/soc/codecs/rt1308-sdw.c                 |   2 +-
 sound/soc/codecs/rt1316-sdw.c                 |   2 +-
 sound/soc/codecs/rt1318-sdw.c                 |   2 +-
 sound/soc/codecs/rt1320-sdw.c                 |   2 +-
 sound/soc/codecs/rt5682-sdw.c                 |   2 +-
 sound/soc/codecs/rt700.c                      |   4 +-
 sound/soc/codecs/rt711-sdca.c                 |   4 +-
 sound/soc/codecs/rt711.c                      |   4 +-
 sound/soc/codecs/rt712-sdca-dmic.c            |   2 +-
 sound/soc/codecs/rt712-sdca.c                 |   4 +-
 sound/soc/codecs/rt715-sdca.c                 |   2 +-
 sound/soc/codecs/rt715.c                      |   2 +-
 sound/soc/codecs/rt722-sdca.c                 |   4 +-
 sound/soc/codecs/wcd-mbhc-v2.c                |   4 +-
 sound/soc/codecs/wsa881x.c                    |   2 +-
 sound/soc/codecs/wsa884x.c                    |   2 +-
 sound/soc/intel/atom/sst/sst_pvt.c            |   2 +-
 sound/soc/intel/avs/core.c                    |   2 +-
 sound/soc/intel/avs/debugfs.c                 |   4 +-
 sound/soc/intel/avs/pcm.c                     |   2 +-
 sound/soc/intel/catpt/pcm.c                   |  12 +-
 sound/soc/intel/catpt/sysfs.c                 |   2 +-
 sound/soc/soc-component.c                     |   2 +-
 sound/soc/sof/control.c                       |   2 +-
 sound/soc/sof/debug.c                         |   2 +-
 sound/soc/sof/ipc3-dtrace.c                   |   2 +-
 sound/soc/sof/ipc4-loader.c                   |   2 +-
 sound/soc/sof/pcm.c                           |   2 +-
 sound/soc/sof/sof-client-ipc-flood-test.c     |   2 +-
 .../soc/sof/sof-client-ipc-kernel-injector.c  |   2 +-
 sound/soc/sof/sof-client-ipc-msg-injector.c   |   2 +-
 sound/soc/sof/sof-client-probes.c             |   6 +-
 sound/x86/intel_hdmi_audio.c                  |   6 +-
 373 files changed, 1076 insertions(+), 1076 deletions(-)

-- 
2.39.5


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 45/51] usb: Switch to __pm_runtime_put_autosuspend()
  2024-10-04  9:41 [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend() Sakari Ailus
  2024-10-04  9:41 ` [PATCH 43/51] thunderbolt: " Sakari Ailus
@ 2024-10-04  9:41 ` Sakari Ailus
  2024-10-04 14:38 ` [PATCH 00/51] treewide: " Ulf Hansson
  2 siblings, 0 replies; 15+ messages in thread
From: Sakari Ailus @ 2024-10-04  9:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb

pm_runtime_put_autosuspend() will soon be changed to include a call to
pm_runtime_mark_last_busy(). This patch switches the current users to
__pm_runtime_put_autosuspend() which will continue to have the
functionality of old pm_runtime_put_autosuspend().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/usb/cdns3/cdns3-gadget.c            |  2 +-
 drivers/usb/cdns3/cdnsp-gadget.c            |  2 +-
 drivers/usb/chipidea/core.c                 |  2 +-
 drivers/usb/chipidea/otg_fsm.c              |  2 +-
 drivers/usb/dwc3/core.c                     |  2 +-
 drivers/usb/dwc3/dwc3-am62.c                |  2 +-
 drivers/usb/dwc3/dwc3-imx8mp.c              |  2 +-
 drivers/usb/gadget/udc/cdns2/cdns2-gadget.c |  2 +-
 drivers/usb/host/xhci-mtk.c                 |  2 +-
 drivers/usb/misc/apple-mfi-fastcharge.c     |  2 +-
 drivers/usb/mtu3/mtu3_plat.c                |  2 +-
 drivers/usb/musb/musb_core.c                | 10 +++++-----
 drivers/usb/musb/musb_debugfs.c             | 10 +++++-----
 drivers/usb/musb/musb_dsps.c                |  2 +-
 drivers/usb/musb/musb_gadget.c              |  8 ++++----
 drivers/usb/musb/omap2430.c                 |  2 +-
 16 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index fd1beb10bba7..660bbf6d9f17 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -3250,7 +3250,7 @@ static void cdns3_gadget_exit(struct cdns *cdns)
 
 
 	pm_runtime_mark_last_busy(cdns->dev);
-	pm_runtime_put_autosuspend(cdns->dev);
+	__pm_runtime_put_autosuspend(cdns->dev);
 
 	usb_del_gadget(&priv_dev->gadget);
 	devm_free_irq(cdns->dev, cdns->dev_irq, priv_dev);
diff --git a/drivers/usb/cdns3/cdnsp-gadget.c b/drivers/usb/cdns3/cdnsp-gadget.c
index 4a3f0f958256..47975436eec0 100644
--- a/drivers/usb/cdns3/cdnsp-gadget.c
+++ b/drivers/usb/cdns3/cdnsp-gadget.c
@@ -1948,7 +1948,7 @@ static void cdnsp_gadget_exit(struct cdns *cdns)
 
 	devm_free_irq(pdev->dev, cdns->dev_irq, pdev);
 	pm_runtime_mark_last_busy(cdns->dev);
-	pm_runtime_put_autosuspend(cdns->dev);
+	__pm_runtime_put_autosuspend(cdns->dev);
 	usb_del_gadget_udc(&pdev->gadget);
 	cdnsp_gadget_free_endpoints(pdev);
 	cdnsp_mem_cleanup(pdev);
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 835bf2428dc6..285cbb430e01 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1371,7 +1371,7 @@ static int ci_controller_resume(struct device *dev)
 	if (ci->wakeup_int) {
 		ci->wakeup_int = false;
 		pm_runtime_mark_last_busy(ci->dev);
-		pm_runtime_put_autosuspend(ci->dev);
+		__pm_runtime_put_autosuspend(ci->dev);
 		enable_irq(ci->irq);
 		if (ci_otg_is_fsm_mode(ci))
 			ci_otg_fsm_wakeup_by_srp(ci);
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index c17516c29b63..21d0eb6eed57 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -631,7 +631,7 @@ int ci_otg_fsm_work(struct ci_hdrc *ci)
 			}
 		} else if (ci->fsm.otg->state == OTG_STATE_A_HOST) {
 			pm_runtime_mark_last_busy(ci->dev);
-			pm_runtime_put_autosuspend(ci->dev);
+			__pm_runtime_put_autosuspend(ci->dev);
 			return 0;
 		}
 	}
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 9eb085f359ce..ec460e70082f 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -265,7 +265,7 @@ static void __dwc3_set_mode(struct work_struct *work)
 
 out:
 	pm_runtime_mark_last_busy(dwc->dev);
-	pm_runtime_put_autosuspend(dwc->dev);
+	__pm_runtime_put_autosuspend(dwc->dev);
 	mutex_unlock(&dwc->mutex);
 }
 
diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
index fad151e78fd6..dcc14c406f7f 100644
--- a/drivers/usb/dwc3/dwc3-am62.c
+++ b/drivers/usb/dwc3/dwc3-am62.c
@@ -282,7 +282,7 @@ static int dwc3_ti_probe(struct platform_device *pdev)
 	pm_runtime_set_autosuspend_delay(dev, DWC3_AM62_AUTOSUSPEND_DELAY);
 	pm_runtime_use_autosuspend(dev);
 	pm_runtime_mark_last_busy(dev);
-	pm_runtime_put_autosuspend(dev);
+	__pm_runtime_put_autosuspend(dev);
 	return 0;
 
 err_pm_disable:
diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c
index 64c0cd1995aa..c3b354f074c1 100644
--- a/drivers/usb/dwc3/dwc3-imx8mp.c
+++ b/drivers/usb/dwc3/dwc3-imx8mp.c
@@ -306,7 +306,7 @@ static int dwc3_imx8mp_resume(struct dwc3_imx8mp *dwc3_imx, pm_message_t msg)
 		dwc3_imx->wakeup_pending = false;
 		if (dwc->current_dr_role == DWC3_GCTL_PRTCAP_DEVICE) {
 			pm_runtime_mark_last_busy(dwc->dev);
-			pm_runtime_put_autosuspend(dwc->dev);
+			__pm_runtime_put_autosuspend(dwc->dev);
 		} else {
 			/*
 			 * Add wait for xhci switch from suspend
diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
index 62fce42ef2da..aabe325069c6 100644
--- a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
+++ b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
@@ -2415,7 +2415,7 @@ int cdns2_gadget_resume(struct cdns2_device *pdev, bool hibernated)
 void cdns2_gadget_remove(struct cdns2_device *pdev)
 {
 	pm_runtime_mark_last_busy(pdev->dev);
-	pm_runtime_put_autosuspend(pdev->dev);
+	__pm_runtime_put_autosuspend(pdev->dev);
 
 	usb_del_gadget(&pdev->gadget);
 	cdns2_free_all_eps(pdev);
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 3252e3d2d79c..c9d408860fce 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -671,7 +671,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 
 	device_enable_async_suspend(dev);
 	pm_runtime_mark_last_busy(dev);
-	pm_runtime_put_autosuspend(dev);
+	__pm_runtime_put_autosuspend(dev);
 	pm_runtime_forbid(dev);
 
 	return 0;
diff --git a/drivers/usb/misc/apple-mfi-fastcharge.c b/drivers/usb/misc/apple-mfi-fastcharge.c
index ac8695195c13..37be7548dc75 100644
--- a/drivers/usb/misc/apple-mfi-fastcharge.c
+++ b/drivers/usb/misc/apple-mfi-fastcharge.c
@@ -134,7 +134,7 @@ static int apple_mfi_fc_set_property(struct power_supply *psy,
 	}
 
 	pm_runtime_mark_last_busy(&mfi->udev->dev);
-	pm_runtime_put_autosuspend(&mfi->udev->dev);
+	__pm_runtime_put_autosuspend(&mfi->udev->dev);
 
 	return ret;
 }
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index 6858ed9fc3b2..51ab1d360bf7 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -432,7 +432,7 @@ static int mtu3_probe(struct platform_device *pdev)
 
 	device_enable_async_suspend(dev);
 	pm_runtime_mark_last_busy(dev);
-	pm_runtime_put_autosuspend(dev);
+	__pm_runtime_put_autosuspend(dev);
 	pm_runtime_forbid(dev);
 
 	return 0;
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index b24adb5b399f..f92b3a119f75 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2031,7 +2031,7 @@ static void musb_pm_runtime_check_session(struct musb *musb)
 			break;
 		trace_musb_state(musb, devctl, "Allow PM on possible host mode disconnect");
 		pm_runtime_mark_last_busy(musb->controller);
-		pm_runtime_put_autosuspend(musb->controller);
+		__pm_runtime_put_autosuspend(musb->controller);
 		musb->session = false;
 		return;
 	default:
@@ -2063,7 +2063,7 @@ static void musb_pm_runtime_check_session(struct musb *musb)
 	} else {
 		trace_musb_state(musb, devctl, "Allow PM with no session");
 		pm_runtime_mark_last_busy(musb->controller);
-		pm_runtime_put_autosuspend(musb->controller);
+		__pm_runtime_put_autosuspend(musb->controller);
 	}
 
 	musb->session = s;
@@ -2090,7 +2090,7 @@ static void musb_irq_work(struct work_struct *data)
 	}
 
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 }
 
 static void musb_recover_from_babble(struct musb *musb)
@@ -2564,7 +2564,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
 
 	musb->is_initialized = 1;
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 
 	return 0;
 
@@ -2887,7 +2887,7 @@ static int musb_resume(struct device *dev)
 	spin_unlock_irqrestore(&musb->lock, flags);
 
 	pm_runtime_mark_last_busy(dev);
-	pm_runtime_put_autosuspend(dev);
+	__pm_runtime_put_autosuspend(dev);
 
 	return 0;
 }
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 2d623284edf6..bdb7a9dbe946 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -107,7 +107,7 @@ static int musb_regdump_show(struct seq_file *s, void *unused)
 	}
 
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 	return 0;
 }
 DEFINE_SHOW_ATTRIBUTE(musb_regdump);
@@ -120,7 +120,7 @@ static int musb_test_mode_show(struct seq_file *s, void *unused)
 	pm_runtime_get_sync(musb->controller);
 	test = musb_readb(musb->mregs, MUSB_TESTMODE);
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 
 	if (test == (MUSB_TEST_FORCE_HOST | MUSB_TEST_FORCE_FS))
 		seq_printf(s, "force host full-speed\n");
@@ -217,7 +217,7 @@ static ssize_t musb_test_mode_write(struct file *file,
 
 ret:
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 	return count;
 }
 
@@ -244,7 +244,7 @@ static int musb_softconnect_show(struct seq_file *s, void *unused)
 		connect = reg & MUSB_DEVCTL_SESSION ? 1 : 0;
 
 		pm_runtime_mark_last_busy(musb->controller);
-		pm_runtime_put_autosuspend(musb->controller);
+		__pm_runtime_put_autosuspend(musb->controller);
 		break;
 	default:
 		connect = -1;
@@ -305,7 +305,7 @@ static ssize_t musb_softconnect_write(struct file *file,
 	}
 
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 	return count;
 }
 
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 9c7a8bbc0542..3d864c316043 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -296,7 +296,7 @@ static void otg_timer(struct timer_list *t)
 		dev_err(dev, "%s resume work: %i\n", __func__, err);
 	spin_unlock_irqrestore(&musb->lock, flags);
 	pm_runtime_mark_last_busy(dev);
-	pm_runtime_put_autosuspend(dev);
+	__pm_runtime_put_autosuspend(dev);
 }
 
 static void dsps_musb_clear_ep_rxintr(struct musb *musb, int epnum)
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index bdf13911a1e5..9aa7e7398d32 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1251,7 +1251,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
 unlock:
 	spin_unlock_irqrestore(&musb->lock, lockflags);
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 
 	return status;
 }
@@ -1635,7 +1635,7 @@ static void musb_gadget_work(struct work_struct *work)
 	musb_pullup(musb, musb->softconnect);
 	spin_unlock_irqrestore(&musb->lock, flags);
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 }
 
 static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on)
@@ -1855,7 +1855,7 @@ static int musb_gadget_start(struct usb_gadget *g,
 		musb_platform_set_vbus(musb, 1);
 
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 
 	return 0;
 
@@ -1908,7 +1908,7 @@ static int musb_gadget_stop(struct usb_gadget *g)
 
 	/* Force check of devctl register for PM runtime */
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 
 	return 0;
 }
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index b4a4c1df4e0d..25ef19b05af6 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -152,7 +152,7 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
 		dev_dbg(musb->controller, "ID float\n");
 	}
 	pm_runtime_mark_last_busy(musb->controller);
-	pm_runtime_put_autosuspend(musb->controller);
+	__pm_runtime_put_autosuspend(musb->controller);
 	atomic_notifier_call_chain(&musb->xceiv->notifier,
 			musb->xceiv->last_event, NULL);
 }
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 43/51] thunderbolt: Switch to __pm_runtime_put_autosuspend()
  2024-10-04  9:41 [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend() Sakari Ailus
@ 2024-10-04  9:41 ` Sakari Ailus
  2024-10-04 10:07   ` Mika Westerberg
  2024-10-04  9:41 ` [PATCH 45/51] usb: " Sakari Ailus
  2024-10-04 14:38 ` [PATCH 00/51] treewide: " Ulf Hansson
  2 siblings, 1 reply; 15+ messages in thread
From: Sakari Ailus @ 2024-10-04  9:41 UTC (permalink / raw)
  To: Andreas Noever, Michael Jamet, Mika Westerberg, Yehezkel Bernat; +Cc: linux-usb

pm_runtime_put_autosuspend() will soon be changed to include a call to
pm_runtime_mark_last_busy(). This patch switches the current users to
__pm_runtime_put_autosuspend() which will continue to have the
functionality of old pm_runtime_put_autosuspend().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/thunderbolt/debugfs.c   | 22 +++++++++++-----------
 drivers/thunderbolt/domain.c    |  4 ++--
 drivers/thunderbolt/icm.c       | 14 +++++++-------
 drivers/thunderbolt/nhi.c       |  2 +-
 drivers/thunderbolt/retimer.c   |  4 ++--
 drivers/thunderbolt/switch.c    |  6 +++---
 drivers/thunderbolt/tb.c        | 18 +++++++++---------
 drivers/thunderbolt/usb4_port.c |  4 ++--
 8 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/thunderbolt/debugfs.c b/drivers/thunderbolt/debugfs.c
index 350310bd0fee..c9dbd7e8c3b6 100644
--- a/drivers/thunderbolt/debugfs.c
+++ b/drivers/thunderbolt/debugfs.c
@@ -209,7 +209,7 @@ static ssize_t regs_write(struct tb_switch *sw, struct tb_port *port,
 
 out:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 	free_page((unsigned long)buf);
 
 	return ret < 0 ? ret : count;
@@ -341,7 +341,7 @@ static ssize_t port_sb_regs_write(struct file *file, const char __user *user_buf
 	mutex_unlock(&tb->lock);
 out:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 	free_page((unsigned long)buf);
 
 	return ret < 0 ? ret : count;
@@ -374,7 +374,7 @@ static ssize_t retimer_sb_regs_write(struct file *file,
 	mutex_unlock(&tb->lock);
 out:
 	pm_runtime_mark_last_busy(&rt->dev);
-	pm_runtime_put_autosuspend(&rt->dev);
+	__pm_runtime_put_autosuspend(&rt->dev);
 	free_page((unsigned long)buf);
 
 	return ret < 0 ? ret : count;
@@ -1113,7 +1113,7 @@ static int margining_run_write(void *data, u64 val)
 	mutex_unlock(&tb->lock);
 out_rpm_put:
 	pm_runtime_mark_last_busy(dev);
-	pm_runtime_put_autosuspend(dev);
+	__pm_runtime_put_autosuspend(dev);
 
 	return ret;
 }
@@ -1647,7 +1647,7 @@ static ssize_t counters_write(struct file *file, const char __user *user_buf,
 
 out:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 	free_page((unsigned long)buf);
 
 	return ret < 0 ? ret : count;
@@ -1842,7 +1842,7 @@ static int port_regs_show(struct seq_file *s, void *not_used)
 	mutex_unlock(&tb->lock);
 out_rpm_put:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
 }
@@ -1946,7 +1946,7 @@ static int switch_regs_show(struct seq_file *s, void *not_used)
 	mutex_unlock(&tb->lock);
 out_rpm_put:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
 }
@@ -2007,7 +2007,7 @@ static int path_show(struct seq_file *s, void *not_used)
 	mutex_unlock(&tb->lock);
 out_rpm_put:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
 }
@@ -2061,7 +2061,7 @@ static int counters_show(struct seq_file *s, void *not_used)
 
 out:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
 }
@@ -2115,7 +2115,7 @@ static int port_sb_regs_show(struct seq_file *s, void *not_used)
 	mutex_unlock(&tb->lock);
 out_rpm_put:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
 }
@@ -2228,7 +2228,7 @@ static int retimer_sb_regs_show(struct seq_file *s, void *not_used)
 	mutex_unlock(&tb->lock);
 out_rpm_put:
 	pm_runtime_mark_last_busy(&rt->dev);
-	pm_runtime_put_autosuspend(&rt->dev);
+	__pm_runtime_put_autosuspend(&rt->dev);
 
 	return ret;
 }
diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
index 144d0232a70c..a9106881f822 100644
--- a/drivers/thunderbolt/domain.c
+++ b/drivers/thunderbolt/domain.c
@@ -151,7 +151,7 @@ static ssize_t boot_acl_show(struct device *dev, struct device_attribute *attr,
 
 out:
 	pm_runtime_mark_last_busy(&tb->dev);
-	pm_runtime_put_autosuspend(&tb->dev);
+	__pm_runtime_put_autosuspend(&tb->dev);
 	kfree(uuids);
 
 	return ret;
@@ -223,7 +223,7 @@ static ssize_t boot_acl_store(struct device *dev, struct device_attribute *attr,
 
 err_rpm_put:
 	pm_runtime_mark_last_busy(&tb->dev);
-	pm_runtime_put_autosuspend(&tb->dev);
+	__pm_runtime_put_autosuspend(&tb->dev);
 err_free_acl:
 	kfree(acl);
 err_free_str:
diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c
index 7859bccc592d..3ed8703316ba 100644
--- a/drivers/thunderbolt/icm.c
+++ b/drivers/thunderbolt/icm.c
@@ -367,7 +367,7 @@ static void icm_veto_end(struct tb *tb)
 		icm->veto = false;
 		/* Allow the domain suspend now */
 		pm_runtime_mark_last_busy(&tb->dev);
-		pm_runtime_put_autosuspend(&tb->dev);
+		__pm_runtime_put_autosuspend(&tb->dev);
 	}
 }
 
@@ -697,7 +697,7 @@ static void add_xdomain(struct tb_switch *sw, u64 route,
 
 out:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 }
 
 static void update_xdomain(struct tb_xdomain *xd, u64 route, u8 link)
@@ -859,7 +859,7 @@ icm_fr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr)
 	}
 
 	pm_runtime_mark_last_busy(&parent_sw->dev);
-	pm_runtime_put_autosuspend(&parent_sw->dev);
+	__pm_runtime_put_autosuspend(&parent_sw->dev);
 
 	tb_switch_put(parent_sw);
 }
@@ -893,7 +893,7 @@ icm_fr_device_disconnected(struct tb *tb, const struct icm_pkg_header *hdr)
 	remove_switch(sw);
 
 	pm_runtime_mark_last_busy(sw->dev.parent);
-	pm_runtime_put_autosuspend(sw->dev.parent);
+	__pm_runtime_put_autosuspend(sw->dev.parent);
 
 	tb_switch_put(sw);
 }
@@ -1285,7 +1285,7 @@ __icm_tr_device_connected(struct tb *tb, const struct icm_pkg_header *hdr,
 	}
 
 	pm_runtime_mark_last_busy(&parent_sw->dev);
-	pm_runtime_put_autosuspend(&parent_sw->dev);
+	__pm_runtime_put_autosuspend(&parent_sw->dev);
 
 	tb_switch_put(parent_sw);
 }
@@ -1316,7 +1316,7 @@ icm_tr_device_disconnected(struct tb *tb, const struct icm_pkg_header *hdr)
 	remove_switch(sw);
 
 	pm_runtime_mark_last_busy(sw->dev.parent);
-	pm_runtime_put_autosuspend(sw->dev.parent);
+	__pm_runtime_put_autosuspend(sw->dev.parent);
 
 	tb_switch_put(sw);
 }
@@ -2045,7 +2045,7 @@ static void remove_unplugged_switch(struct tb_switch *sw)
 	tb_switch_remove(sw);
 
 	pm_runtime_mark_last_busy(parent);
-	pm_runtime_put_autosuspend(parent);
+	__pm_runtime_put_autosuspend(parent);
 
 	put_device(parent);
 }
diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
index 7af2642b97cb..d46fab8a7a33 100644
--- a/drivers/thunderbolt/nhi.c
+++ b/drivers/thunderbolt/nhi.c
@@ -1408,7 +1408,7 @@ static int nhi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	pm_runtime_allow(&pdev->dev);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, TB_AUTOSUSPEND_DELAY);
 	pm_runtime_use_autosuspend(&pdev->dev);
-	pm_runtime_put_autosuspend(&pdev->dev);
+	__pm_runtime_put_autosuspend(&pdev->dev);
 
 	return 0;
 }
diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
index 721319329afa..3818f0bb2512 100644
--- a/drivers/thunderbolt/retimer.c
+++ b/drivers/thunderbolt/retimer.c
@@ -54,7 +54,7 @@ static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes)
 
 out:
 	pm_runtime_mark_last_busy(&rt->dev);
-	pm_runtime_put_autosuspend(&rt->dev);
+	__pm_runtime_put_autosuspend(&rt->dev);
 
 	return ret;
 }
@@ -304,7 +304,7 @@ static ssize_t nvm_authenticate_store(struct device *dev,
 	mutex_unlock(&rt->tb->lock);
 exit_rpm:
 	pm_runtime_mark_last_busy(&rt->dev);
-	pm_runtime_put_autosuspend(&rt->dev);
+	__pm_runtime_put_autosuspend(&rt->dev);
 
 	if (ret)
 		return ret;
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 6a2116cbb06f..126e8ddd26f4 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -319,7 +319,7 @@ static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes)
 
 out:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
 }
@@ -1847,7 +1847,7 @@ static ssize_t authorized_store(struct device *dev,
 	pm_runtime_get_sync(&sw->dev);
 	ret = tb_switch_set_authorized(sw, val);
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret ? ret : count;
 }
@@ -2079,7 +2079,7 @@ static ssize_t nvm_authenticate_sysfs(struct device *dev, const char *buf,
 	mutex_unlock(&sw->tb->lock);
 exit_rpm:
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 	return ret;
 }
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 10e719dd837c..7a1d80ce3666 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -1217,7 +1217,7 @@ static void tb_scan_switch(struct tb_switch *sw)
 		tb_scan_port(port);
 
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 }
 
 /*
@@ -1349,7 +1349,7 @@ static void tb_scan_port(struct tb_port *port)
 out_rpm_put:
 	if (port->usb4) {
 		pm_runtime_mark_last_busy(&port->usb4->dev);
-		pm_runtime_put_autosuspend(&port->usb4->dev);
+		__pm_runtime_put_autosuspend(&port->usb4->dev);
 	}
 }
 
@@ -1674,9 +1674,9 @@ static void tb_deactivate_and_free_tunnel(struct tb_tunnel *tunnel)
 		tb_configure_sym(tb, src_port, dst_port, true);
 		/* Now we can allow the domain to runtime suspend again */
 		pm_runtime_mark_last_busy(&dst_port->sw->dev);
-		pm_runtime_put_autosuspend(&dst_port->sw->dev);
+		__pm_runtime_put_autosuspend(&dst_port->sw->dev);
 		pm_runtime_mark_last_busy(&src_port->sw->dev);
-		pm_runtime_put_autosuspend(&src_port->sw->dev);
+		__pm_runtime_put_autosuspend(&src_port->sw->dev);
 		fallthrough;
 
 	case TB_TUNNEL_USB3:
@@ -1932,9 +1932,9 @@ static bool tb_tunnel_one_dp(struct tb *tb, struct tb_port *in,
 	tb_switch_dealloc_dp_resource(in->sw, in);
 err_rpm_put:
 	pm_runtime_mark_last_busy(&out->sw->dev);
-	pm_runtime_put_autosuspend(&out->sw->dev);
+	__pm_runtime_put_autosuspend(&out->sw->dev);
 	pm_runtime_mark_last_busy(&in->sw->dev);
-	pm_runtime_put_autosuspend(&in->sw->dev);
+	__pm_runtime_put_autosuspend(&in->sw->dev);
 
 	return false;
 }
@@ -2364,7 +2364,7 @@ static void tb_handle_hotplug(struct work_struct *work)
 	}
 
 	pm_runtime_mark_last_busy(&sw->dev);
-	pm_runtime_put_autosuspend(&sw->dev);
+	__pm_runtime_put_autosuspend(&sw->dev);
 
 put_sw:
 	tb_switch_put(sw);
@@ -2372,7 +2372,7 @@ static void tb_handle_hotplug(struct work_struct *work)
 	mutex_unlock(&tb->lock);
 
 	pm_runtime_mark_last_busy(&tb->dev);
-	pm_runtime_put_autosuspend(&tb->dev);
+	__pm_runtime_put_autosuspend(&tb->dev);
 
 	kfree(ev);
 }
@@ -2673,7 +2673,7 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
 	mutex_unlock(&tb->lock);
 
 	pm_runtime_mark_last_busy(&tb->dev);
-	pm_runtime_put_autosuspend(&tb->dev);
+	__pm_runtime_put_autosuspend(&tb->dev);
 
 	kfree(ev);
 }
diff --git a/drivers/thunderbolt/usb4_port.c b/drivers/thunderbolt/usb4_port.c
index 5150879888ca..9b71ec355cd5 100644
--- a/drivers/thunderbolt/usb4_port.c
+++ b/drivers/thunderbolt/usb4_port.c
@@ -158,7 +158,7 @@ static ssize_t offline_store(struct device *dev,
 	mutex_unlock(&tb->lock);
 out_rpm:
 	pm_runtime_mark_last_busy(&usb4->dev);
-	pm_runtime_put_autosuspend(&usb4->dev);
+	__pm_runtime_put_autosuspend(&usb4->dev);
 
 	return ret ? ret : count;
 }
@@ -200,7 +200,7 @@ static ssize_t rescan_store(struct device *dev,
 	mutex_unlock(&tb->lock);
 out_rpm:
 	pm_runtime_mark_last_busy(&usb4->dev);
-	pm_runtime_put_autosuspend(&usb4->dev);
+	__pm_runtime_put_autosuspend(&usb4->dev);
 
 	return ret ? ret : count;
 }
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 43/51] thunderbolt: Switch to __pm_runtime_put_autosuspend()
  2024-10-04  9:41 ` [PATCH 43/51] thunderbolt: " Sakari Ailus
@ 2024-10-04 10:07   ` Mika Westerberg
  0 siblings, 0 replies; 15+ messages in thread
From: Mika Westerberg @ 2024-10-04 10:07 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: Andreas Noever, Michael Jamet, Yehezkel Bernat, linux-usb

On Fri, Oct 04, 2024 at 12:41:45PM +0300, Sakari Ailus wrote:
> pm_runtime_put_autosuspend() will soon be changed to include a call to
> pm_runtime_mark_last_busy(). This patch switches the current users to
> __pm_runtime_put_autosuspend() which will continue to have the
> functionality of old pm_runtime_put_autosuspend().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-04  9:41 [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend() Sakari Ailus
  2024-10-04  9:41 ` [PATCH 43/51] thunderbolt: " Sakari Ailus
  2024-10-04  9:41 ` [PATCH 45/51] usb: " Sakari Ailus
@ 2024-10-04 14:38 ` Ulf Hansson
  2024-10-07 18:49   ` Laurent Pinchart
  2 siblings, 1 reply; 15+ messages in thread
From: Ulf Hansson @ 2024-10-04 14:38 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: dri-devel, linux-kernel, linux-bluetooth, linux-clk, linux-crypto,
	dmaengine, linux-gpio, amd-gfx, nouveau, linux-stm32,
	linux-arm-kernel, linux-i2c, linux-i3c, linux-iio, linux-input,
	patches, iommu, imx, linux-mediatek, linux-media, linux-mmc,
	linux-mtd, netdev, linux-wireless, linux-pci, linux-phy,
	linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	laurent.pinchart, rafael, Andy Shevchenko

On Fri, 4 Oct 2024 at 11:41, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Hello everyone,
>
> This set will switch the users of pm_runtime_put_autosuspend() to
> __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> to include a call to pm_runtime_mark_last_busy(). The two are almost
> always used together, apart from bugs which are likely common. Going
> forward, most new users should be using pm_runtime_put_autosuspend().
>
> Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> and pm_runtime_mark_last_busy().

That sounds like it could cause a lot of churns.

Why not add a new helper function that does the
pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
things? Then we can start moving users over to this new interface,
rather than having this intermediate step?

Kind regards
Uffe

>
> The diff in these patches have been generated using the following
> Coccinelle script (besides a manual change in
> drivers/iio/magnetometer/af8133j.c):
>
> ----------8<-------------------
> @@
> expression E1;
>
> @@
>
> - pm_runtime_put_autosuspend(E1)
> + __pm_runtime_put_autosuspend(E1)
> ----------8<-------------------
>
> These patches are on top of today's linux-next (i.e. next-20241004).
>
> Sakari Ailus (51):
>   accel/ivpu: Switch to __pm_runtime_put_autosuspend()
>   bluetooth: Switch to __pm_runtime_put_autosuspend()
>   bus: sunxi-rsb: Switch to __pm_runtime_put_autosuspend()
>   hwrng: Switch to __pm_runtime_put_autosuspend()
>   clk: Switch to __pm_runtime_put_autosuspend()
>   crypto: Switch to __pm_runtime_put_autosuspend()
>   dmaengine: Switch to __pm_runtime_put_autosuspend()
>   gpio: Switch to __pm_runtime_put_autosuspend()
>   drm/amd: Switch to __pm_runtime_put_autosuspend()
>   drm/nouveau: Switch to __pm_runtime_put_autosuspend()
>   drm/radeon: Switch to __pm_runtime_put_autosuspend()
>   drm/panfrost: Switch to __pm_runtime_put_autosuspend()
>   drivers: drm: Switch to __pm_runtime_put_autosuspend()
>   HSI: omap_ssi_port: Switch to __pm_runtime_put_autosuspend()
>   stm class: Switch to __pm_runtime_put_autosuspend()
>   i2c: Switch to __pm_runtime_put_autosuspend()
>   i3c: master: svc: Switch to __pm_runtime_put_autosuspend()
>   i3c: dw: Switch to __pm_runtime_put_autosuspend()
>   iio: Switch to __pm_runtime_put_autosuspend()
>   Input: omap4-keypad: Switch to __pm_runtime_put_autosuspend()
>   Input: cs40l50: Switch to __pm_runtime_put_autosuspend()
>   iommu/arm-smmu: Switch to __pm_runtime_put_autosuspend()
>   irqchip/imx-irqsteer: Switch to __pm_runtime_put_autosuspend()
>   mailbox: mtk-cmdq-mailbox: Switch to __pm_runtime_put_autosuspend()
>   media: Switch to __pm_runtime_put_autosuspend()
>   mfd: Switch to __pm_runtime_put_autosuspend()
>   mei: Switch to __pm_runtime_put_autosuspend()
>   mmc: Switch to __pm_runtime_put_autosuspend()
>   mtd: rawnand: gpmi: Switch to __pm_runtime_put_autosuspend()
>   net: Switch to __pm_runtime_put_autosuspend()
>   nfc: trf7970a: Switch to __pm_runtime_put_autosuspend()
>   PCI/portdrv: Switch to __pm_runtime_put_autosuspend()
>   phy: motorola: phy-mapphone-mdm6600: Switch to
>     __pm_runtime_put_autosuspend()
>   phy: ti: phy-twl4030-usb: Switch to __pm_runtime_put_autosuspend()
>   power: Switch to __pm_runtime_put_autosuspend()
>   pwm: img: Switch to __pm_runtime_put_autosuspend()
>   regulator: stm32-vrefbuf: Switch to __pm_runtime_put_autosuspend()
>   remoteproc: omap: Switch to __pm_runtime_put_autosuspend()
>   slimbus: Switch to __pm_runtime_put_autosuspend()
>   soundwire: Switch to __pm_runtime_put_autosuspend()
>   spi: Switch to __pm_runtime_put_autosuspend()
>   staging: Switch to __pm_runtime_put_autosuspend()
>   thunderbolt: Switch to __pm_runtime_put_autosuspend()
>   serial: Switch to __pm_runtime_put_autosuspend()
>   usb: Switch to __pm_runtime_put_autosuspend()
>   w1: omap-hdq: Switch to __pm_runtime_put_autosuspend()
>   staging: greybus: Switch to __pm_runtime_put_autosuspend()
>   ALSA: hda: Switch to __pm_runtime_put_autosuspend()
>   ASoC: Switch to __pm_runtime_put_autosuspend()
>   ALSA: intel_hdmi: Switch to __pm_runtime_put_autosuspend()
>   soc: apple: mailbox: Switch to __pm_runtime_put_autosuspend()
>
>  drivers/accel/ivpu/ivpu_drv.c                 |   2 +-
>  drivers/accel/ivpu/ivpu_pm.c                  |   8 +-
>  drivers/bluetooth/btmtksdio.c                 |   2 +-
>  drivers/bluetooth/hci_bcm.c                   |   6 +-
>  drivers/bluetooth/hci_h5.c                    |   4 +-
>  drivers/bluetooth/hci_intel.c                 |   6 +-
>  drivers/bus/sunxi-rsb.c                       |   4 +-
>  drivers/char/hw_random/cctrng.c               |   2 +-
>  drivers/char/hw_random/omap3-rom-rng.c        |   2 +-
>  drivers/clk/imx/clk-imx8qxp-lpcg.c            |   2 +-
>  drivers/clk/imx/clk-scu.c                     |   2 +-
>  drivers/clk/qcom/lpassaudiocc-sc7280.c        |   4 +-
>  drivers/clk/qcom/lpasscorecc-sc7180.c         |   4 +-
>  drivers/crypto/ccree/cc_pm.c                  |   2 +-
>  drivers/crypto/hisilicon/qm.c                 |   2 +-
>  drivers/crypto/omap-aes-gcm.c                 |   2 +-
>  drivers/crypto/omap-aes.c                     |   2 +-
>  drivers/crypto/omap-des.c                     |   2 +-
>  drivers/crypto/omap-sham.c                    |   2 +-
>  drivers/crypto/rockchip/rk3288_crypto_ahash.c |   2 +-
>  .../crypto/rockchip/rk3288_crypto_skcipher.c  |   2 +-
>  drivers/crypto/stm32/stm32-crc32.c            |   4 +-
>  drivers/crypto/stm32/stm32-cryp.c             |   2 +-
>  drivers/crypto/stm32/stm32-hash.c             |   2 +-
>  drivers/dma/at_xdmac.c                        |  24 +--
>  drivers/dma/pl330.c                           |  14 +-
>  drivers/dma/qcom/bam_dma.c                    |  10 +-
>  drivers/dma/qcom/hidma.c                      |  18 +-
>  drivers/dma/qcom/hidma_dbg.c                  |   2 +-
>  drivers/dma/qcom/hidma_mgmt.c                 |   4 +-
>  drivers/dma/ste_dma40.c                       |  16 +-
>  drivers/dma/ti/cppi41.c                       |  10 +-
>  drivers/dma/xilinx/zynqmp_dma.c               |   2 +-
>  drivers/gpio/gpio-arizona.c                   |  10 +-
>  drivers/gpio/gpio-mxc.c                       |   2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c      |   2 +-
>  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |  16 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   | 120 ++++++------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |   2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |   6 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |   6 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       |   4 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   4 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c       |   4 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       |   2 +-
>  .../gpu/drm/amd/amdgpu/amdgpu_securedisplay.c |   4 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_process.c      |   4 +-
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   2 +-
>  drivers/gpu/drm/amd/pm/amdgpu_pm.c            | 178 +++++++++---------
>  .../drm/bridge/analogix/analogix_dp_core.c    |   2 +-
>  drivers/gpu/drm/bridge/analogix/anx7625.c     |   4 +-
>  drivers/gpu/drm/bridge/parade-ps8640.c        |   4 +-
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c         |  14 +-
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c         |  12 +-
>  drivers/gpu/drm/exynos/exynos_drm_fimc.c      |   4 +-
>  drivers/gpu/drm/exynos/exynos_drm_g2d.c       |   4 +-
>  drivers/gpu/drm/exynos/exynos_drm_gsc.c       |   6 +-
>  drivers/gpu/drm/exynos/exynos_drm_rotator.c   |   2 +-
>  drivers/gpu/drm/exynos/exynos_drm_scaler.c    |   2 +-
>  drivers/gpu/drm/i915/intel_runtime_pm.c       |   4 +-
>  drivers/gpu/drm/imx/dcss/dcss-crtc.c          |   2 +-
>  drivers/gpu/drm/lima/lima_sched.c             |   2 +-
>  drivers/gpu/drm/msm/adreno/adreno_device.c    |   2 +-
>  drivers/gpu/drm/msm/adreno/adreno_gpu.c       |   2 +-
>  drivers/gpu/drm/msm/msm_gpu.c                 |   2 +-
>  drivers/gpu/drm/msm/msm_iommu.c               |   4 +-
>  drivers/gpu/drm/msm/msm_submitqueue.c         |   2 +-
>  drivers/gpu/drm/nouveau/dispnv50/disp.c       |  10 +-
>  drivers/gpu/drm/nouveau/nouveau_connector.c   |   4 +-
>  drivers/gpu/drm/nouveau/nouveau_debugfs.c     |   8 +-
>  drivers/gpu/drm/nouveau/nouveau_display.c     |   4 +-
>  drivers/gpu/drm/nouveau/nouveau_drm.c         |  10 +-
>  drivers/gpu/drm/nouveau/nouveau_gem.c         |  10 +-
>  drivers/gpu/drm/panel/panel-edp.c             |   8 +-
>  .../gpu/drm/panel/panel-samsung-atna33xc20.c  |   6 +-
>  drivers/gpu/drm/panel/panel-simple.c          |   6 +-
>  drivers/gpu/drm/panfrost/panfrost_job.c       |   4 +-
>  drivers/gpu/drm/panfrost/panfrost_mmu.c       |   4 +-
>  drivers/gpu/drm/panfrost/panfrost_perfcnt.c   |   4 +-
>  drivers/gpu/drm/panthor/panthor_device.c      |   2 +-
>  drivers/gpu/drm/panthor/panthor_sched.c       |   6 +-
>  drivers/gpu/drm/radeon/radeon_acpi.c          |   2 +-
>  drivers/gpu/drm/radeon/radeon_connectors.c    |  20 +-
>  drivers/gpu/drm/radeon/radeon_display.c       |   6 +-
>  drivers/gpu/drm/radeon/radeon_drv.c           |   4 +-
>  drivers/gpu/drm/radeon/radeon_fbdev.c         |   4 +-
>  drivers/gpu/drm/radeon/radeon_kms.c           |  10 +-
>  drivers/gpu/drm/tegra/submit.c                |   2 +-
>  drivers/gpu/drm/tidss/tidss_drv.c             |   2 +-
>  drivers/gpu/drm/vc4/vc4_v3d.c                 |   2 +-
>  drivers/hsi/controllers/omap_ssi_port.c       |  42 ++---
>  drivers/hwtracing/stm/core.c                  |   8 +-
>  drivers/i2c/busses/i2c-amd-mp2-pci.c          |   2 +-
>  drivers/i2c/busses/i2c-amd-mp2.h              |   2 +-
>  drivers/i2c/busses/i2c-at91-master.c          |   2 +-
>  drivers/i2c/busses/i2c-cadence.c              |   2 +-
>  drivers/i2c/busses/i2c-davinci.c              |   4 +-
>  drivers/i2c/busses/i2c-designware-master.c    |   2 +-
>  drivers/i2c/busses/i2c-designware-pcidrv.c    |   2 +-
>  drivers/i2c/busses/i2c-hix5hd2.c              |   2 +-
>  drivers/i2c/busses/i2c-i801.c                 |   4 +-
>  drivers/i2c/busses/i2c-img-scb.c              |   6 +-
>  drivers/i2c/busses/i2c-imx-lpi2c.c            |   6 +-
>  drivers/i2c/busses/i2c-imx.c                  |   4 +-
>  drivers/i2c/busses/i2c-mv64xxx.c              |   2 +-
>  drivers/i2c/busses/i2c-nvidia-gpu.c           |   4 +-
>  drivers/i2c/busses/i2c-omap.c                 |   6 +-
>  drivers/i2c/busses/i2c-qcom-cci.c             |   2 +-
>  drivers/i2c/busses/i2c-qcom-geni.c            |   2 +-
>  drivers/i2c/busses/i2c-qup.c                  |   4 +-
>  drivers/i2c/busses/i2c-riic.c                 |   4 +-
>  drivers/i2c/busses/i2c-rzv2m.c                |   2 +-
>  drivers/i2c/busses/i2c-sprd.c                 |   4 +-
>  drivers/i2c/busses/i2c-stm32f7.c              |  10 +-
>  drivers/i2c/busses/i2c-xiic.c                 |   2 +-
>  drivers/i3c/master/dw-i3c-master.c            |  16 +-
>  drivers/i3c/master/svc-i3c-master.c           |  16 +-
>  drivers/iio/accel/bmc150-accel-core.c         |   2 +-
>  drivers/iio/accel/bmi088-accel-core.c         |   6 +-
>  drivers/iio/accel/fxls8962af-core.c           |   2 +-
>  drivers/iio/accel/kxcjk-1013.c                |   2 +-
>  drivers/iio/accel/kxsd9.c                     |   6 +-
>  drivers/iio/accel/mma8452.c                   |   2 +-
>  drivers/iio/accel/mma9551_core.c              |   2 +-
>  drivers/iio/accel/msa311.c                    |  12 +-
>  drivers/iio/adc/ab8500-gpadc.c                |   2 +-
>  drivers/iio/adc/at91-sama5d2_adc.c            |  20 +-
>  drivers/iio/adc/rcar-gyroadc.c                |   2 +-
>  drivers/iio/adc/stm32-adc-core.c              |   2 +-
>  drivers/iio/adc/stm32-adc.c                   |  12 +-
>  drivers/iio/adc/sun4i-gpadc-iio.c             |   4 +-
>  drivers/iio/adc/ti-ads1015.c                  |   2 +-
>  drivers/iio/adc/ti-ads1100.c                  |   2 +-
>  drivers/iio/adc/ti-ads1119.c                  |   4 +-
>  drivers/iio/chemical/atlas-sensor.c           |   4 +-
>  .../common/hid-sensors/hid-sensor-trigger.c   |   2 +-
>  drivers/iio/dac/stm32-dac.c                   |   6 +-
>  drivers/iio/gyro/bmg160_core.c                |   2 +-
>  drivers/iio/gyro/fxas21002c_core.c            |   2 +-
>  drivers/iio/gyro/mpu3050-core.c               |   6 +-
>  drivers/iio/gyro/mpu3050-i2c.c                |   2 +-
>  .../iio/imu/inv_icm42600/inv_icm42600_accel.c |  10 +-
>  .../imu/inv_icm42600/inv_icm42600_buffer.c    |   2 +-
>  .../iio/imu/inv_icm42600/inv_icm42600_gyro.c  |  10 +-
>  .../iio/imu/inv_icm42600/inv_icm42600_temp.c  |   2 +-
>  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    |  14 +-
>  drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |   4 +-
>  drivers/iio/imu/kmx61.c                       |   2 +-
>  drivers/iio/light/apds9306.c                  |   6 +-
>  drivers/iio/light/apds9960.c                  |   4 +-
>  drivers/iio/light/bh1780.c                    |   2 +-
>  drivers/iio/light/gp2ap002.c                  |   4 +-
>  drivers/iio/light/isl29028.c                  |   2 +-
>  drivers/iio/light/ltrf216a.c                  |   2 +-
>  drivers/iio/light/pa12203001.c                |   2 +-
>  drivers/iio/light/rpr0521.c                   |   2 +-
>  drivers/iio/light/tsl2583.c                   |   2 +-
>  drivers/iio/light/tsl2591.c                   |   4 +-
>  drivers/iio/light/us5182d.c                   |   2 +-
>  drivers/iio/light/vcnl4000.c                  |   2 +-
>  drivers/iio/light/vcnl4035.c                  |   2 +-
>  drivers/iio/magnetometer/af8133j.c            |   4 +-
>  drivers/iio/magnetometer/ak8974.c             |   4 +-
>  drivers/iio/magnetometer/ak8975.c             |   2 +-
>  drivers/iio/magnetometer/bmc150_magn.c        |   2 +-
>  drivers/iio/magnetometer/tmag5273.c           |   4 +-
>  drivers/iio/magnetometer/yamaha-yas530.c      |   4 +-
>  drivers/iio/pressure/bmp280-core.c            |  10 +-
>  drivers/iio/pressure/icp10100.c               |   2 +-
>  drivers/iio/pressure/mpl115.c                 |   4 +-
>  drivers/iio/pressure/zpa2326.c                |   4 +-
>  .../iio/proximity/pulsedlight-lidar-lite-v2.c |   2 +-
>  drivers/iio/proximity/srf04.c                 |   2 +-
>  drivers/iio/temperature/mlx90614.c            |   4 +-
>  drivers/iio/temperature/mlx90632.c            |   4 +-
>  drivers/iio/temperature/mlx90635.c            |   4 +-
>  drivers/input/keyboard/omap4-keypad.c         |   8 +-
>  drivers/input/misc/cs40l50-vibra.c            |   8 +-
>  drivers/iommu/arm/arm-smmu/arm-smmu.c         |   2 +-
>  drivers/irqchip/irq-imx-irqsteer.c            |   2 +-
>  drivers/mailbox/mtk-cmdq-mailbox.c            |  10 +-
>  drivers/media/i2c/alvium-csi2.c               |   2 +-
>  drivers/media/i2c/ccs/ccs-core.c              |  10 +-
>  drivers/media/i2c/dw9719.c                    |   2 +-
>  drivers/media/i2c/gc0308.c                    |   6 +-
>  drivers/media/i2c/gc2145.c                    |   8 +-
>  drivers/media/i2c/imx283.c                    |   6 +-
>  drivers/media/i2c/imx290.c                    |   6 +-
>  drivers/media/i2c/imx296.c                    |   4 +-
>  drivers/media/i2c/imx415.c                    |   4 +-
>  drivers/media/i2c/mt9m114.c                   |  12 +-
>  drivers/media/i2c/ov2680.c                    |   2 +-
>  drivers/media/i2c/ov4689.c                    |   6 +-
>  drivers/media/i2c/ov5640.c                    |   8 +-
>  drivers/media/i2c/ov5645.c                    |   6 +-
>  drivers/media/i2c/ov5693.c                    |   2 +-
>  drivers/media/i2c/ov64a40.c                   |   8 +-
>  drivers/media/i2c/ov7251.c                    |   2 +-
>  drivers/media/i2c/ov8858.c                    |   4 +-
>  drivers/media/i2c/thp7312.c                   |   8 +-
>  drivers/media/i2c/video-i2c.c                 |   8 +-
>  .../media/platform/nvidia/tegra-vde/h264.c    |   4 +-
>  drivers/media/platform/qcom/venus/vdec.c      |   4 +-
>  drivers/media/platform/qcom/venus/venc.c      |   4 +-
>  .../platform/raspberrypi/pisp_be/pisp_be.c    |   4 +-
>  .../media/platform/st/sti/delta/delta-v4l2.c  |   4 +-
>  drivers/media/platform/st/sti/hva/hva-hw.c    |   8 +-
>  .../media/platform/verisilicon/hantro_drv.c   |   2 +-
>  drivers/media/rc/gpio-ir-recv.c               |   2 +-
>  drivers/mfd/arizona-irq.c                     |   2 +-
>  drivers/mfd/cs40l50-core.c                    |   2 +-
>  drivers/mfd/cs42l43.c                         |   2 +-
>  drivers/misc/mei/client.c                     |  14 +-
>  drivers/mmc/core/core.c                       |   4 +-
>  drivers/mmc/host/atmel-mci.c                  |   4 +-
>  drivers/mmc/host/dw_mmc-rockchip.c            |   2 +-
>  drivers/mmc/host/dw_mmc.c                     |   2 +-
>  drivers/mmc/host/mmci.c                       |   2 +-
>  drivers/mmc/host/omap_hsmmc.c                 |   6 +-
>  drivers/mmc/host/sdhci-msm.c                  |   2 +-
>  drivers/mmc/host/sdhci-of-at91.c              |   2 +-
>  drivers/mmc/host/sdhci-omap.c                 |   4 +-
>  drivers/mmc/host/sdhci-pci-core.c             |   2 +-
>  drivers/mmc/host/sdhci-pxav3.c                |   6 +-
>  drivers/mmc/host/sdhci-sprd.c                 |   2 +-
>  drivers/mmc/host/sdhci-xenon.c                |   2 +-
>  drivers/mmc/host/sdhci_am654.c                |   2 +-
>  drivers/mmc/host/tmio_mmc_core.c              |   2 +-
>  drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c    |  10 +-
>  drivers/net/ethernet/cadence/macb_main.c      |  10 +-
>  drivers/net/ethernet/freescale/fec_main.c     |  16 +-
>  drivers/net/ethernet/renesas/ravb_main.c      |   8 +-
>  drivers/net/ethernet/ti/davinci_mdio.c        |  14 +-
>  drivers/net/ipa/ipa_interrupt.c               |   2 +-
>  drivers/net/ipa/ipa_main.c                    |   2 +-
>  drivers/net/ipa/ipa_modem.c                   |   8 +-
>  drivers/net/ipa/ipa_smp2p.c                   |   4 +-
>  drivers/net/ipa/ipa_uc.c                      |   4 +-
>  drivers/net/wireless/ath/wil6210/pm.c         |   2 +-
>  drivers/net/wireless/ti/wl18xx/debugfs.c      |   6 +-
>  drivers/net/wireless/ti/wlcore/cmd.c          |   2 +-
>  drivers/net/wireless/ti/wlcore/debugfs.c      |  22 +--
>  drivers/net/wireless/ti/wlcore/main.c         |  72 +++----
>  drivers/net/wireless/ti/wlcore/scan.c         |   2 +-
>  drivers/net/wireless/ti/wlcore/sysfs.c        |   2 +-
>  drivers/net/wireless/ti/wlcore/testmode.c     |   4 +-
>  drivers/net/wireless/ti/wlcore/tx.c           |   2 +-
>  drivers/net/wireless/ti/wlcore/vendor_cmd.c   |   6 +-
>  drivers/net/wwan/qcom_bam_dmux.c              |   4 +-
>  drivers/net/wwan/t7xx/t7xx_hif_cldma.c        |   6 +-
>  drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c    |   6 +-
>  drivers/net/wwan/t7xx/t7xx_hif_dpmaif_tx.c    |   4 +-
>  drivers/nfc/trf7970a.c                        |   2 +-
>  drivers/pci/pcie/portdrv.c                    |   2 +-
>  drivers/phy/motorola/phy-mapphone-mdm6600.c   |   4 +-
>  drivers/phy/ti/phy-twl4030-usb.c              |   8 +-
>  drivers/power/supply/bq24190_charger.c        |  28 +--
>  drivers/power/supply/twl4030_charger.c        |   2 +-
>  drivers/pwm/pwm-img.c                         |   4 +-
>  drivers/regulator/stm32-vrefbuf.c             |  12 +-
>  drivers/remoteproc/omap_remoteproc.c          |   6 +-
>  drivers/slimbus/core.c                        |   2 +-
>  drivers/slimbus/messaging.c                   |   4 +-
>  drivers/soc/apple/mailbox.c                   |   2 +-
>  drivers/soundwire/bus.c                       |   2 +-
>  drivers/soundwire/cadence_master.c            |   2 +-
>  drivers/soundwire/qcom.c                      |   6 +-
>  drivers/spi/atmel-quadspi.c                   |  10 +-
>  drivers/spi/spi-cadence-quadspi.c             |   4 +-
>  drivers/spi/spi-cadence.c                     |   2 +-
>  drivers/spi/spi-dw-pci.c                      |   2 +-
>  drivers/spi/spi-fsl-espi.c                    |   4 +-
>  drivers/spi/spi-fsl-lpspi.c                   |   4 +-
>  drivers/spi/spi-imx.c                         |   6 +-
>  drivers/spi/spi-mtk-nor.c                     |   2 +-
>  drivers/spi/spi-omap2-mcspi.c                 |   6 +-
>  drivers/spi/spi-pxa2xx-pci.c                  |   2 +-
>  drivers/spi/spi-s3c64xx.c                     |   6 +-
>  drivers/spi/spi-sprd.c                        |   2 +-
>  drivers/spi/spi-stm32-qspi.c                  |  14 +-
>  drivers/spi/spi-stm32.c                       |   4 +-
>  drivers/spi/spi-ti-qspi.c                     |   4 +-
>  drivers/spi/spi-zynqmp-gqspi.c                |   2 +-
>  drivers/spi/spi.c                             |   6 +-
>  drivers/staging/greybus/gbphy.h               |   2 +-
>  drivers/staging/media/rkvdec/rkvdec.c         |   2 +-
>  drivers/thunderbolt/debugfs.c                 |  22 +--
>  drivers/thunderbolt/domain.c                  |   4 +-
>  drivers/thunderbolt/icm.c                     |  14 +-
>  drivers/thunderbolt/nhi.c                     |   2 +-
>  drivers/thunderbolt/retimer.c                 |   4 +-
>  drivers/thunderbolt/switch.c                  |   6 +-
>  drivers/thunderbolt/tb.c                      |  18 +-
>  drivers/thunderbolt/usb4_port.c               |   4 +-
>  drivers/tty/serial/8250/8250_omap.c           |  18 +-
>  drivers/tty/serial/8250/8250_port.c           |   4 +-
>  drivers/tty/serial/fsl_lpuart.c               |   2 +-
>  drivers/tty/serial/serial_core.c              |   2 +-
>  drivers/tty/serial/uartlite.c                 |   4 +-
>  drivers/tty/serial/xilinx_uartps.c            |   2 +-
>  drivers/usb/cdns3/cdns3-gadget.c              |   2 +-
>  drivers/usb/cdns3/cdnsp-gadget.c              |   2 +-
>  drivers/usb/chipidea/core.c                   |   2 +-
>  drivers/usb/chipidea/otg_fsm.c                |   2 +-
>  drivers/usb/dwc3/core.c                       |   2 +-
>  drivers/usb/dwc3/dwc3-am62.c                  |   2 +-
>  drivers/usb/dwc3/dwc3-imx8mp.c                |   2 +-
>  drivers/usb/gadget/udc/cdns2/cdns2-gadget.c   |   2 +-
>  drivers/usb/host/xhci-mtk.c                   |   2 +-
>  drivers/usb/misc/apple-mfi-fastcharge.c       |   2 +-
>  drivers/usb/mtu3/mtu3_plat.c                  |   2 +-
>  drivers/usb/musb/musb_core.c                  |  10 +-
>  drivers/usb/musb/musb_debugfs.c               |  10 +-
>  drivers/usb/musb/musb_dsps.c                  |   2 +-
>  drivers/usb/musb/musb_gadget.c                |   8 +-
>  drivers/usb/musb/omap2430.c                   |   2 +-
>  drivers/w1/masters/omap_hdq.c                 |  10 +-
>  include/linux/greybus/bundle.h                |   2 +-
>  sound/hda/hdac_device.c                       |   2 +-
>  sound/pci/hda/cs35l41_hda.c                   |   8 +-
>  sound/pci/hda/cs35l56_hda.c                   |   2 +-
>  sound/pci/hda/hda_intel.c                     |   2 +-
>  sound/pci/hda/tas2781_hda_i2c.c               |   6 +-
>  sound/soc/atmel/mchp-spdifrx.c                |  12 +-
>  sound/soc/codecs/arizona-jack.c               |  12 +-
>  sound/soc/codecs/arizona.c                    |   2 +-
>  sound/soc/codecs/cs35l41.c                    |   4 +-
>  sound/soc/codecs/cs35l45.c                    |   2 +-
>  sound/soc/codecs/cs35l56-sdw.c                |   4 +-
>  sound/soc/codecs/cs35l56-shared.c             |   2 +-
>  sound/soc/codecs/cs35l56.c                    |   2 +-
>  sound/soc/codecs/cs42l42-sdw.c                |   2 +-
>  sound/soc/codecs/cs42l42.c                    |   4 +-
>  sound/soc/codecs/cs42l43-jack.c               |  10 +-
>  sound/soc/codecs/cs42l43.c                    |   4 +-
>  sound/soc/codecs/hda.c                        |   6 +-
>  sound/soc/codecs/madera.c                     |   6 +-
>  sound/soc/codecs/max98363.c                   |   2 +-
>  sound/soc/codecs/max98373-sdw.c               |   2 +-
>  sound/soc/codecs/rt1017-sdca-sdw.c            |   2 +-
>  sound/soc/codecs/rt1308-sdw.c                 |   2 +-
>  sound/soc/codecs/rt1316-sdw.c                 |   2 +-
>  sound/soc/codecs/rt1318-sdw.c                 |   2 +-
>  sound/soc/codecs/rt1320-sdw.c                 |   2 +-
>  sound/soc/codecs/rt5682-sdw.c                 |   2 +-
>  sound/soc/codecs/rt700.c                      |   4 +-
>  sound/soc/codecs/rt711-sdca.c                 |   4 +-
>  sound/soc/codecs/rt711.c                      |   4 +-
>  sound/soc/codecs/rt712-sdca-dmic.c            |   2 +-
>  sound/soc/codecs/rt712-sdca.c                 |   4 +-
>  sound/soc/codecs/rt715-sdca.c                 |   2 +-
>  sound/soc/codecs/rt715.c                      |   2 +-
>  sound/soc/codecs/rt722-sdca.c                 |   4 +-
>  sound/soc/codecs/wcd-mbhc-v2.c                |   4 +-
>  sound/soc/codecs/wsa881x.c                    |   2 +-
>  sound/soc/codecs/wsa884x.c                    |   2 +-
>  sound/soc/intel/atom/sst/sst_pvt.c            |   2 +-
>  sound/soc/intel/avs/core.c                    |   2 +-
>  sound/soc/intel/avs/debugfs.c                 |   4 +-
>  sound/soc/intel/avs/pcm.c                     |   2 +-
>  sound/soc/intel/catpt/pcm.c                   |  12 +-
>  sound/soc/intel/catpt/sysfs.c                 |   2 +-
>  sound/soc/soc-component.c                     |   2 +-
>  sound/soc/sof/control.c                       |   2 +-
>  sound/soc/sof/debug.c                         |   2 +-
>  sound/soc/sof/ipc3-dtrace.c                   |   2 +-
>  sound/soc/sof/ipc4-loader.c                   |   2 +-
>  sound/soc/sof/pcm.c                           |   2 +-
>  sound/soc/sof/sof-client-ipc-flood-test.c     |   2 +-
>  .../soc/sof/sof-client-ipc-kernel-injector.c  |   2 +-
>  sound/soc/sof/sof-client-ipc-msg-injector.c   |   2 +-
>  sound/soc/sof/sof-client-probes.c             |   6 +-
>  sound/x86/intel_hdmi_audio.c                  |   6 +-
>  373 files changed, 1076 insertions(+), 1076 deletions(-)
>
> --
> 2.39.5
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-04 14:38 ` [PATCH 00/51] treewide: " Ulf Hansson
@ 2024-10-07 18:49   ` Laurent Pinchart
  2024-10-07 22:08     ` Ulf Hansson
  2024-10-08 20:38     ` Uwe Kleine-König
  0 siblings, 2 replies; 15+ messages in thread
From: Laurent Pinchart @ 2024-10-07 18:49 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Sakari Ailus, dri-devel, linux-kernel, linux-bluetooth, linux-clk,
	linux-crypto, dmaengine, linux-gpio, amd-gfx, nouveau,
	linux-stm32, linux-arm-kernel, linux-i2c, linux-i3c, linux-iio,
	linux-input, patches, iommu, imx, linux-mediatek, linux-media,
	linux-mmc, linux-mtd, netdev, linux-wireless, linux-pci,
	linux-phy, linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	rafael, Andy Shevchenko

Hi Ulf,

On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> On Fri, 4 Oct 2024 at 11:41, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> >
> > Hello everyone,
> >
> > This set will switch the users of pm_runtime_put_autosuspend() to
> > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > always used together, apart from bugs which are likely common. Going
> > forward, most new users should be using pm_runtime_put_autosuspend().
> >
> > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > and pm_runtime_mark_last_busy().
> 
> That sounds like it could cause a lot of churns.
> 
> Why not add a new helper function that does the
> pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> things? Then we can start moving users over to this new interface,
> rather than having this intermediate step?

I think the API would be nicer if we used the shortest and simplest
function names for the most common use cases. Following
pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
most common use case. That's why I like Sakari's approach of repurposing
pm_runtime_put_autosuspend(), and introducing
__pm_runtime_put_autosuspend() for the odd cases where
pm_runtime_mark_last_busy() shouldn't be called.

> > The diff in these patches have been generated using the following
> > Coccinelle script (besides a manual change in
> > drivers/iio/magnetometer/af8133j.c):
> >
> > ----------8<-------------------
> > @@
> > expression E1;
> >
> > @@
> >
> > - pm_runtime_put_autosuspend(E1)
> > + __pm_runtime_put_autosuspend(E1)
> > ----------8<-------------------
> >
> > These patches are on top of today's linux-next (i.e. next-20241004).
> >
> > Sakari Ailus (51):
> >   accel/ivpu: Switch to __pm_runtime_put_autosuspend()
> >   bluetooth: Switch to __pm_runtime_put_autosuspend()
> >   bus: sunxi-rsb: Switch to __pm_runtime_put_autosuspend()
> >   hwrng: Switch to __pm_runtime_put_autosuspend()
> >   clk: Switch to __pm_runtime_put_autosuspend()
> >   crypto: Switch to __pm_runtime_put_autosuspend()
> >   dmaengine: Switch to __pm_runtime_put_autosuspend()
> >   gpio: Switch to __pm_runtime_put_autosuspend()
> >   drm/amd: Switch to __pm_runtime_put_autosuspend()
> >   drm/nouveau: Switch to __pm_runtime_put_autosuspend()
> >   drm/radeon: Switch to __pm_runtime_put_autosuspend()
> >   drm/panfrost: Switch to __pm_runtime_put_autosuspend()
> >   drivers: drm: Switch to __pm_runtime_put_autosuspend()
> >   HSI: omap_ssi_port: Switch to __pm_runtime_put_autosuspend()
> >   stm class: Switch to __pm_runtime_put_autosuspend()
> >   i2c: Switch to __pm_runtime_put_autosuspend()
> >   i3c: master: svc: Switch to __pm_runtime_put_autosuspend()
> >   i3c: dw: Switch to __pm_runtime_put_autosuspend()
> >   iio: Switch to __pm_runtime_put_autosuspend()
> >   Input: omap4-keypad: Switch to __pm_runtime_put_autosuspend()
> >   Input: cs40l50: Switch to __pm_runtime_put_autosuspend()
> >   iommu/arm-smmu: Switch to __pm_runtime_put_autosuspend()
> >   irqchip/imx-irqsteer: Switch to __pm_runtime_put_autosuspend()
> >   mailbox: mtk-cmdq-mailbox: Switch to __pm_runtime_put_autosuspend()
> >   media: Switch to __pm_runtime_put_autosuspend()
> >   mfd: Switch to __pm_runtime_put_autosuspend()
> >   mei: Switch to __pm_runtime_put_autosuspend()
> >   mmc: Switch to __pm_runtime_put_autosuspend()
> >   mtd: rawnand: gpmi: Switch to __pm_runtime_put_autosuspend()
> >   net: Switch to __pm_runtime_put_autosuspend()
> >   nfc: trf7970a: Switch to __pm_runtime_put_autosuspend()
> >   PCI/portdrv: Switch to __pm_runtime_put_autosuspend()
> >   phy: motorola: phy-mapphone-mdm6600: Switch to
> >     __pm_runtime_put_autosuspend()
> >   phy: ti: phy-twl4030-usb: Switch to __pm_runtime_put_autosuspend()
> >   power: Switch to __pm_runtime_put_autosuspend()
> >   pwm: img: Switch to __pm_runtime_put_autosuspend()
> >   regulator: stm32-vrefbuf: Switch to __pm_runtime_put_autosuspend()
> >   remoteproc: omap: Switch to __pm_runtime_put_autosuspend()
> >   slimbus: Switch to __pm_runtime_put_autosuspend()
> >   soundwire: Switch to __pm_runtime_put_autosuspend()
> >   spi: Switch to __pm_runtime_put_autosuspend()
> >   staging: Switch to __pm_runtime_put_autosuspend()
> >   thunderbolt: Switch to __pm_runtime_put_autosuspend()
> >   serial: Switch to __pm_runtime_put_autosuspend()
> >   usb: Switch to __pm_runtime_put_autosuspend()
> >   w1: omap-hdq: Switch to __pm_runtime_put_autosuspend()
> >   staging: greybus: Switch to __pm_runtime_put_autosuspend()
> >   ALSA: hda: Switch to __pm_runtime_put_autosuspend()
> >   ASoC: Switch to __pm_runtime_put_autosuspend()
> >   ALSA: intel_hdmi: Switch to __pm_runtime_put_autosuspend()
> >   soc: apple: mailbox: Switch to __pm_runtime_put_autosuspend()
> >
> >  drivers/accel/ivpu/ivpu_drv.c                 |   2 +-
> >  drivers/accel/ivpu/ivpu_pm.c                  |   8 +-
> >  drivers/bluetooth/btmtksdio.c                 |   2 +-
> >  drivers/bluetooth/hci_bcm.c                   |   6 +-
> >  drivers/bluetooth/hci_h5.c                    |   4 +-
> >  drivers/bluetooth/hci_intel.c                 |   6 +-
> >  drivers/bus/sunxi-rsb.c                       |   4 +-
> >  drivers/char/hw_random/cctrng.c               |   2 +-
> >  drivers/char/hw_random/omap3-rom-rng.c        |   2 +-
> >  drivers/clk/imx/clk-imx8qxp-lpcg.c            |   2 +-
> >  drivers/clk/imx/clk-scu.c                     |   2 +-
> >  drivers/clk/qcom/lpassaudiocc-sc7280.c        |   4 +-
> >  drivers/clk/qcom/lpasscorecc-sc7180.c         |   4 +-
> >  drivers/crypto/ccree/cc_pm.c                  |   2 +-
> >  drivers/crypto/hisilicon/qm.c                 |   2 +-
> >  drivers/crypto/omap-aes-gcm.c                 |   2 +-
> >  drivers/crypto/omap-aes.c                     |   2 +-
> >  drivers/crypto/omap-des.c                     |   2 +-
> >  drivers/crypto/omap-sham.c                    |   2 +-
> >  drivers/crypto/rockchip/rk3288_crypto_ahash.c |   2 +-
> >  .../crypto/rockchip/rk3288_crypto_skcipher.c  |   2 +-
> >  drivers/crypto/stm32/stm32-crc32.c            |   4 +-
> >  drivers/crypto/stm32/stm32-cryp.c             |   2 +-
> >  drivers/crypto/stm32/stm32-hash.c             |   2 +-
> >  drivers/dma/at_xdmac.c                        |  24 +--
> >  drivers/dma/pl330.c                           |  14 +-
> >  drivers/dma/qcom/bam_dma.c                    |  10 +-
> >  drivers/dma/qcom/hidma.c                      |  18 +-
> >  drivers/dma/qcom/hidma_dbg.c                  |   2 +-
> >  drivers/dma/qcom/hidma_mgmt.c                 |   4 +-
> >  drivers/dma/ste_dma40.c                       |  16 +-
> >  drivers/dma/ti/cppi41.c                       |  10 +-
> >  drivers/dma/xilinx/zynqmp_dma.c               |   2 +-
> >  drivers/gpio/gpio-arizona.c                   |  10 +-
> >  drivers/gpio/gpio-mxc.c                       |   2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c      |   2 +-
> >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    |  16 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c   | 120 ++++++------
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |   2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |   6 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c     |   6 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c       |   4 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c       |   4 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_rap.c       |   4 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c       |   2 +-
> >  .../gpu/drm/amd/amdgpu/amdgpu_securedisplay.c |   4 +-
> >  drivers/gpu/drm/amd/amdkfd/kfd_process.c      |   4 +-
> >  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |   2 +-
> >  drivers/gpu/drm/amd/pm/amdgpu_pm.c            | 178 +++++++++---------
> >  .../drm/bridge/analogix/analogix_dp_core.c    |   2 +-
> >  drivers/gpu/drm/bridge/analogix/anx7625.c     |   4 +-
> >  drivers/gpu/drm/bridge/parade-ps8640.c        |   4 +-
> >  drivers/gpu/drm/bridge/ti-sn65dsi86.c         |  14 +-
> >  drivers/gpu/drm/etnaviv/etnaviv_gpu.c         |  12 +-
> >  drivers/gpu/drm/exynos/exynos_drm_fimc.c      |   4 +-
> >  drivers/gpu/drm/exynos/exynos_drm_g2d.c       |   4 +-
> >  drivers/gpu/drm/exynos/exynos_drm_gsc.c       |   6 +-
> >  drivers/gpu/drm/exynos/exynos_drm_rotator.c   |   2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_scaler.c    |   2 +-
> >  drivers/gpu/drm/i915/intel_runtime_pm.c       |   4 +-
> >  drivers/gpu/drm/imx/dcss/dcss-crtc.c          |   2 +-
> >  drivers/gpu/drm/lima/lima_sched.c             |   2 +-
> >  drivers/gpu/drm/msm/adreno/adreno_device.c    |   2 +-
> >  drivers/gpu/drm/msm/adreno/adreno_gpu.c       |   2 +-
> >  drivers/gpu/drm/msm/msm_gpu.c                 |   2 +-
> >  drivers/gpu/drm/msm/msm_iommu.c               |   4 +-
> >  drivers/gpu/drm/msm/msm_submitqueue.c         |   2 +-
> >  drivers/gpu/drm/nouveau/dispnv50/disp.c       |  10 +-
> >  drivers/gpu/drm/nouveau/nouveau_connector.c   |   4 +-
> >  drivers/gpu/drm/nouveau/nouveau_debugfs.c     |   8 +-
> >  drivers/gpu/drm/nouveau/nouveau_display.c     |   4 +-
> >  drivers/gpu/drm/nouveau/nouveau_drm.c         |  10 +-
> >  drivers/gpu/drm/nouveau/nouveau_gem.c         |  10 +-
> >  drivers/gpu/drm/panel/panel-edp.c             |   8 +-
> >  .../gpu/drm/panel/panel-samsung-atna33xc20.c  |   6 +-
> >  drivers/gpu/drm/panel/panel-simple.c          |   6 +-
> >  drivers/gpu/drm/panfrost/panfrost_job.c       |   4 +-
> >  drivers/gpu/drm/panfrost/panfrost_mmu.c       |   4 +-
> >  drivers/gpu/drm/panfrost/panfrost_perfcnt.c   |   4 +-
> >  drivers/gpu/drm/panthor/panthor_device.c      |   2 +-
> >  drivers/gpu/drm/panthor/panthor_sched.c       |   6 +-
> >  drivers/gpu/drm/radeon/radeon_acpi.c          |   2 +-
> >  drivers/gpu/drm/radeon/radeon_connectors.c    |  20 +-
> >  drivers/gpu/drm/radeon/radeon_display.c       |   6 +-
> >  drivers/gpu/drm/radeon/radeon_drv.c           |   4 +-
> >  drivers/gpu/drm/radeon/radeon_fbdev.c         |   4 +-
> >  drivers/gpu/drm/radeon/radeon_kms.c           |  10 +-
> >  drivers/gpu/drm/tegra/submit.c                |   2 +-
> >  drivers/gpu/drm/tidss/tidss_drv.c             |   2 +-
> >  drivers/gpu/drm/vc4/vc4_v3d.c                 |   2 +-
> >  drivers/hsi/controllers/omap_ssi_port.c       |  42 ++---
> >  drivers/hwtracing/stm/core.c                  |   8 +-
> >  drivers/i2c/busses/i2c-amd-mp2-pci.c          |   2 +-
> >  drivers/i2c/busses/i2c-amd-mp2.h              |   2 +-
> >  drivers/i2c/busses/i2c-at91-master.c          |   2 +-
> >  drivers/i2c/busses/i2c-cadence.c              |   2 +-
> >  drivers/i2c/busses/i2c-davinci.c              |   4 +-
> >  drivers/i2c/busses/i2c-designware-master.c    |   2 +-
> >  drivers/i2c/busses/i2c-designware-pcidrv.c    |   2 +-
> >  drivers/i2c/busses/i2c-hix5hd2.c              |   2 +-
> >  drivers/i2c/busses/i2c-i801.c                 |   4 +-
> >  drivers/i2c/busses/i2c-img-scb.c              |   6 +-
> >  drivers/i2c/busses/i2c-imx-lpi2c.c            |   6 +-
> >  drivers/i2c/busses/i2c-imx.c                  |   4 +-
> >  drivers/i2c/busses/i2c-mv64xxx.c              |   2 +-
> >  drivers/i2c/busses/i2c-nvidia-gpu.c           |   4 +-
> >  drivers/i2c/busses/i2c-omap.c                 |   6 +-
> >  drivers/i2c/busses/i2c-qcom-cci.c             |   2 +-
> >  drivers/i2c/busses/i2c-qcom-geni.c            |   2 +-
> >  drivers/i2c/busses/i2c-qup.c                  |   4 +-
> >  drivers/i2c/busses/i2c-riic.c                 |   4 +-
> >  drivers/i2c/busses/i2c-rzv2m.c                |   2 +-
> >  drivers/i2c/busses/i2c-sprd.c                 |   4 +-
> >  drivers/i2c/busses/i2c-stm32f7.c              |  10 +-
> >  drivers/i2c/busses/i2c-xiic.c                 |   2 +-
> >  drivers/i3c/master/dw-i3c-master.c            |  16 +-
> >  drivers/i3c/master/svc-i3c-master.c           |  16 +-
> >  drivers/iio/accel/bmc150-accel-core.c         |   2 +-
> >  drivers/iio/accel/bmi088-accel-core.c         |   6 +-
> >  drivers/iio/accel/fxls8962af-core.c           |   2 +-
> >  drivers/iio/accel/kxcjk-1013.c                |   2 +-
> >  drivers/iio/accel/kxsd9.c                     |   6 +-
> >  drivers/iio/accel/mma8452.c                   |   2 +-
> >  drivers/iio/accel/mma9551_core.c              |   2 +-
> >  drivers/iio/accel/msa311.c                    |  12 +-
> >  drivers/iio/adc/ab8500-gpadc.c                |   2 +-
> >  drivers/iio/adc/at91-sama5d2_adc.c            |  20 +-
> >  drivers/iio/adc/rcar-gyroadc.c                |   2 +-
> >  drivers/iio/adc/stm32-adc-core.c              |   2 +-
> >  drivers/iio/adc/stm32-adc.c                   |  12 +-
> >  drivers/iio/adc/sun4i-gpadc-iio.c             |   4 +-
> >  drivers/iio/adc/ti-ads1015.c                  |   2 +-
> >  drivers/iio/adc/ti-ads1100.c                  |   2 +-
> >  drivers/iio/adc/ti-ads1119.c                  |   4 +-
> >  drivers/iio/chemical/atlas-sensor.c           |   4 +-
> >  .../common/hid-sensors/hid-sensor-trigger.c   |   2 +-
> >  drivers/iio/dac/stm32-dac.c                   |   6 +-
> >  drivers/iio/gyro/bmg160_core.c                |   2 +-
> >  drivers/iio/gyro/fxas21002c_core.c            |   2 +-
> >  drivers/iio/gyro/mpu3050-core.c               |   6 +-
> >  drivers/iio/gyro/mpu3050-i2c.c                |   2 +-
> >  .../iio/imu/inv_icm42600/inv_icm42600_accel.c |  10 +-
> >  .../imu/inv_icm42600/inv_icm42600_buffer.c    |   2 +-
> >  .../iio/imu/inv_icm42600/inv_icm42600_gyro.c  |  10 +-
> >  .../iio/imu/inv_icm42600/inv_icm42600_temp.c  |   2 +-
> >  drivers/iio/imu/inv_mpu6050/inv_mpu_core.c    |  14 +-
> >  drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |   4 +-
> >  drivers/iio/imu/kmx61.c                       |   2 +-
> >  drivers/iio/light/apds9306.c                  |   6 +-
> >  drivers/iio/light/apds9960.c                  |   4 +-
> >  drivers/iio/light/bh1780.c                    |   2 +-
> >  drivers/iio/light/gp2ap002.c                  |   4 +-
> >  drivers/iio/light/isl29028.c                  |   2 +-
> >  drivers/iio/light/ltrf216a.c                  |   2 +-
> >  drivers/iio/light/pa12203001.c                |   2 +-
> >  drivers/iio/light/rpr0521.c                   |   2 +-
> >  drivers/iio/light/tsl2583.c                   |   2 +-
> >  drivers/iio/light/tsl2591.c                   |   4 +-
> >  drivers/iio/light/us5182d.c                   |   2 +-
> >  drivers/iio/light/vcnl4000.c                  |   2 +-
> >  drivers/iio/light/vcnl4035.c                  |   2 +-
> >  drivers/iio/magnetometer/af8133j.c            |   4 +-
> >  drivers/iio/magnetometer/ak8974.c             |   4 +-
> >  drivers/iio/magnetometer/ak8975.c             |   2 +-
> >  drivers/iio/magnetometer/bmc150_magn.c        |   2 +-
> >  drivers/iio/magnetometer/tmag5273.c           |   4 +-
> >  drivers/iio/magnetometer/yamaha-yas530.c      |   4 +-
> >  drivers/iio/pressure/bmp280-core.c            |  10 +-
> >  drivers/iio/pressure/icp10100.c               |   2 +-
> >  drivers/iio/pressure/mpl115.c                 |   4 +-
> >  drivers/iio/pressure/zpa2326.c                |   4 +-
> >  .../iio/proximity/pulsedlight-lidar-lite-v2.c |   2 +-
> >  drivers/iio/proximity/srf04.c                 |   2 +-
> >  drivers/iio/temperature/mlx90614.c            |   4 +-
> >  drivers/iio/temperature/mlx90632.c            |   4 +-
> >  drivers/iio/temperature/mlx90635.c            |   4 +-
> >  drivers/input/keyboard/omap4-keypad.c         |   8 +-
> >  drivers/input/misc/cs40l50-vibra.c            |   8 +-
> >  drivers/iommu/arm/arm-smmu/arm-smmu.c         |   2 +-
> >  drivers/irqchip/irq-imx-irqsteer.c            |   2 +-
> >  drivers/mailbox/mtk-cmdq-mailbox.c            |  10 +-
> >  drivers/media/i2c/alvium-csi2.c               |   2 +-
> >  drivers/media/i2c/ccs/ccs-core.c              |  10 +-
> >  drivers/media/i2c/dw9719.c                    |   2 +-
> >  drivers/media/i2c/gc0308.c                    |   6 +-
> >  drivers/media/i2c/gc2145.c                    |   8 +-
> >  drivers/media/i2c/imx283.c                    |   6 +-
> >  drivers/media/i2c/imx290.c                    |   6 +-
> >  drivers/media/i2c/imx296.c                    |   4 +-
> >  drivers/media/i2c/imx415.c                    |   4 +-
> >  drivers/media/i2c/mt9m114.c                   |  12 +-
> >  drivers/media/i2c/ov2680.c                    |   2 +-
> >  drivers/media/i2c/ov4689.c                    |   6 +-
> >  drivers/media/i2c/ov5640.c                    |   8 +-
> >  drivers/media/i2c/ov5645.c                    |   6 +-
> >  drivers/media/i2c/ov5693.c                    |   2 +-
> >  drivers/media/i2c/ov64a40.c                   |   8 +-
> >  drivers/media/i2c/ov7251.c                    |   2 +-
> >  drivers/media/i2c/ov8858.c                    |   4 +-
> >  drivers/media/i2c/thp7312.c                   |   8 +-
> >  drivers/media/i2c/video-i2c.c                 |   8 +-
> >  .../media/platform/nvidia/tegra-vde/h264.c    |   4 +-
> >  drivers/media/platform/qcom/venus/vdec.c      |   4 +-
> >  drivers/media/platform/qcom/venus/venc.c      |   4 +-
> >  .../platform/raspberrypi/pisp_be/pisp_be.c    |   4 +-
> >  .../media/platform/st/sti/delta/delta-v4l2.c  |   4 +-
> >  drivers/media/platform/st/sti/hva/hva-hw.c    |   8 +-
> >  .../media/platform/verisilicon/hantro_drv.c   |   2 +-
> >  drivers/media/rc/gpio-ir-recv.c               |   2 +-
> >  drivers/mfd/arizona-irq.c                     |   2 +-
> >  drivers/mfd/cs40l50-core.c                    |   2 +-
> >  drivers/mfd/cs42l43.c                         |   2 +-
> >  drivers/misc/mei/client.c                     |  14 +-
> >  drivers/mmc/core/core.c                       |   4 +-
> >  drivers/mmc/host/atmel-mci.c                  |   4 +-
> >  drivers/mmc/host/dw_mmc-rockchip.c            |   2 +-
> >  drivers/mmc/host/dw_mmc.c                     |   2 +-
> >  drivers/mmc/host/mmci.c                       |   2 +-
> >  drivers/mmc/host/omap_hsmmc.c                 |   6 +-
> >  drivers/mmc/host/sdhci-msm.c                  |   2 +-
> >  drivers/mmc/host/sdhci-of-at91.c              |   2 +-
> >  drivers/mmc/host/sdhci-omap.c                 |   4 +-
> >  drivers/mmc/host/sdhci-pci-core.c             |   2 +-
> >  drivers/mmc/host/sdhci-pxav3.c                |   6 +-
> >  drivers/mmc/host/sdhci-sprd.c                 |   2 +-
> >  drivers/mmc/host/sdhci-xenon.c                |   2 +-
> >  drivers/mmc/host/sdhci_am654.c                |   2 +-
> >  drivers/mmc/host/tmio_mmc_core.c              |   2 +-
> >  drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c    |  10 +-
> >  drivers/net/ethernet/cadence/macb_main.c      |  10 +-
> >  drivers/net/ethernet/freescale/fec_main.c     |  16 +-
> >  drivers/net/ethernet/renesas/ravb_main.c      |   8 +-
> >  drivers/net/ethernet/ti/davinci_mdio.c        |  14 +-
> >  drivers/net/ipa/ipa_interrupt.c               |   2 +-
> >  drivers/net/ipa/ipa_main.c                    |   2 +-
> >  drivers/net/ipa/ipa_modem.c                   |   8 +-
> >  drivers/net/ipa/ipa_smp2p.c                   |   4 +-
> >  drivers/net/ipa/ipa_uc.c                      |   4 +-
> >  drivers/net/wireless/ath/wil6210/pm.c         |   2 +-
> >  drivers/net/wireless/ti/wl18xx/debugfs.c      |   6 +-
> >  drivers/net/wireless/ti/wlcore/cmd.c          |   2 +-
> >  drivers/net/wireless/ti/wlcore/debugfs.c      |  22 +--
> >  drivers/net/wireless/ti/wlcore/main.c         |  72 +++----
> >  drivers/net/wireless/ti/wlcore/scan.c         |   2 +-
> >  drivers/net/wireless/ti/wlcore/sysfs.c        |   2 +-
> >  drivers/net/wireless/ti/wlcore/testmode.c     |   4 +-
> >  drivers/net/wireless/ti/wlcore/tx.c           |   2 +-
> >  drivers/net/wireless/ti/wlcore/vendor_cmd.c   |   6 +-
> >  drivers/net/wwan/qcom_bam_dmux.c              |   4 +-
> >  drivers/net/wwan/t7xx/t7xx_hif_cldma.c        |   6 +-
> >  drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c    |   6 +-
> >  drivers/net/wwan/t7xx/t7xx_hif_dpmaif_tx.c    |   4 +-
> >  drivers/nfc/trf7970a.c                        |   2 +-
> >  drivers/pci/pcie/portdrv.c                    |   2 +-
> >  drivers/phy/motorola/phy-mapphone-mdm6600.c   |   4 +-
> >  drivers/phy/ti/phy-twl4030-usb.c              |   8 +-
> >  drivers/power/supply/bq24190_charger.c        |  28 +--
> >  drivers/power/supply/twl4030_charger.c        |   2 +-
> >  drivers/pwm/pwm-img.c                         |   4 +-
> >  drivers/regulator/stm32-vrefbuf.c             |  12 +-
> >  drivers/remoteproc/omap_remoteproc.c          |   6 +-
> >  drivers/slimbus/core.c                        |   2 +-
> >  drivers/slimbus/messaging.c                   |   4 +-
> >  drivers/soc/apple/mailbox.c                   |   2 +-
> >  drivers/soundwire/bus.c                       |   2 +-
> >  drivers/soundwire/cadence_master.c            |   2 +-
> >  drivers/soundwire/qcom.c                      |   6 +-
> >  drivers/spi/atmel-quadspi.c                   |  10 +-
> >  drivers/spi/spi-cadence-quadspi.c             |   4 +-
> >  drivers/spi/spi-cadence.c                     |   2 +-
> >  drivers/spi/spi-dw-pci.c                      |   2 +-
> >  drivers/spi/spi-fsl-espi.c                    |   4 +-
> >  drivers/spi/spi-fsl-lpspi.c                   |   4 +-
> >  drivers/spi/spi-imx.c                         |   6 +-
> >  drivers/spi/spi-mtk-nor.c                     |   2 +-
> >  drivers/spi/spi-omap2-mcspi.c                 |   6 +-
> >  drivers/spi/spi-pxa2xx-pci.c                  |   2 +-
> >  drivers/spi/spi-s3c64xx.c                     |   6 +-
> >  drivers/spi/spi-sprd.c                        |   2 +-
> >  drivers/spi/spi-stm32-qspi.c                  |  14 +-
> >  drivers/spi/spi-stm32.c                       |   4 +-
> >  drivers/spi/spi-ti-qspi.c                     |   4 +-
> >  drivers/spi/spi-zynqmp-gqspi.c                |   2 +-
> >  drivers/spi/spi.c                             |   6 +-
> >  drivers/staging/greybus/gbphy.h               |   2 +-
> >  drivers/staging/media/rkvdec/rkvdec.c         |   2 +-
> >  drivers/thunderbolt/debugfs.c                 |  22 +--
> >  drivers/thunderbolt/domain.c                  |   4 +-
> >  drivers/thunderbolt/icm.c                     |  14 +-
> >  drivers/thunderbolt/nhi.c                     |   2 +-
> >  drivers/thunderbolt/retimer.c                 |   4 +-
> >  drivers/thunderbolt/switch.c                  |   6 +-
> >  drivers/thunderbolt/tb.c                      |  18 +-
> >  drivers/thunderbolt/usb4_port.c               |   4 +-
> >  drivers/tty/serial/8250/8250_omap.c           |  18 +-
> >  drivers/tty/serial/8250/8250_port.c           |   4 +-
> >  drivers/tty/serial/fsl_lpuart.c               |   2 +-
> >  drivers/tty/serial/serial_core.c              |   2 +-
> >  drivers/tty/serial/uartlite.c                 |   4 +-
> >  drivers/tty/serial/xilinx_uartps.c            |   2 +-
> >  drivers/usb/cdns3/cdns3-gadget.c              |   2 +-
> >  drivers/usb/cdns3/cdnsp-gadget.c              |   2 +-
> >  drivers/usb/chipidea/core.c                   |   2 +-
> >  drivers/usb/chipidea/otg_fsm.c                |   2 +-
> >  drivers/usb/dwc3/core.c                       |   2 +-
> >  drivers/usb/dwc3/dwc3-am62.c                  |   2 +-
> >  drivers/usb/dwc3/dwc3-imx8mp.c                |   2 +-
> >  drivers/usb/gadget/udc/cdns2/cdns2-gadget.c   |   2 +-
> >  drivers/usb/host/xhci-mtk.c                   |   2 +-
> >  drivers/usb/misc/apple-mfi-fastcharge.c       |   2 +-
> >  drivers/usb/mtu3/mtu3_plat.c                  |   2 +-
> >  drivers/usb/musb/musb_core.c                  |  10 +-
> >  drivers/usb/musb/musb_debugfs.c               |  10 +-
> >  drivers/usb/musb/musb_dsps.c                  |   2 +-
> >  drivers/usb/musb/musb_gadget.c                |   8 +-
> >  drivers/usb/musb/omap2430.c                   |   2 +-
> >  drivers/w1/masters/omap_hdq.c                 |  10 +-
> >  include/linux/greybus/bundle.h                |   2 +-
> >  sound/hda/hdac_device.c                       |   2 +-
> >  sound/pci/hda/cs35l41_hda.c                   |   8 +-
> >  sound/pci/hda/cs35l56_hda.c                   |   2 +-
> >  sound/pci/hda/hda_intel.c                     |   2 +-
> >  sound/pci/hda/tas2781_hda_i2c.c               |   6 +-
> >  sound/soc/atmel/mchp-spdifrx.c                |  12 +-
> >  sound/soc/codecs/arizona-jack.c               |  12 +-
> >  sound/soc/codecs/arizona.c                    |   2 +-
> >  sound/soc/codecs/cs35l41.c                    |   4 +-
> >  sound/soc/codecs/cs35l45.c                    |   2 +-
> >  sound/soc/codecs/cs35l56-sdw.c                |   4 +-
> >  sound/soc/codecs/cs35l56-shared.c             |   2 +-
> >  sound/soc/codecs/cs35l56.c                    |   2 +-
> >  sound/soc/codecs/cs42l42-sdw.c                |   2 +-
> >  sound/soc/codecs/cs42l42.c                    |   4 +-
> >  sound/soc/codecs/cs42l43-jack.c               |  10 +-
> >  sound/soc/codecs/cs42l43.c                    |   4 +-
> >  sound/soc/codecs/hda.c                        |   6 +-
> >  sound/soc/codecs/madera.c                     |   6 +-
> >  sound/soc/codecs/max98363.c                   |   2 +-
> >  sound/soc/codecs/max98373-sdw.c               |   2 +-
> >  sound/soc/codecs/rt1017-sdca-sdw.c            |   2 +-
> >  sound/soc/codecs/rt1308-sdw.c                 |   2 +-
> >  sound/soc/codecs/rt1316-sdw.c                 |   2 +-
> >  sound/soc/codecs/rt1318-sdw.c                 |   2 +-
> >  sound/soc/codecs/rt1320-sdw.c                 |   2 +-
> >  sound/soc/codecs/rt5682-sdw.c                 |   2 +-
> >  sound/soc/codecs/rt700.c                      |   4 +-
> >  sound/soc/codecs/rt711-sdca.c                 |   4 +-
> >  sound/soc/codecs/rt711.c                      |   4 +-
> >  sound/soc/codecs/rt712-sdca-dmic.c            |   2 +-
> >  sound/soc/codecs/rt712-sdca.c                 |   4 +-
> >  sound/soc/codecs/rt715-sdca.c                 |   2 +-
> >  sound/soc/codecs/rt715.c                      |   2 +-
> >  sound/soc/codecs/rt722-sdca.c                 |   4 +-
> >  sound/soc/codecs/wcd-mbhc-v2.c                |   4 +-
> >  sound/soc/codecs/wsa881x.c                    |   2 +-
> >  sound/soc/codecs/wsa884x.c                    |   2 +-
> >  sound/soc/intel/atom/sst/sst_pvt.c            |   2 +-
> >  sound/soc/intel/avs/core.c                    |   2 +-
> >  sound/soc/intel/avs/debugfs.c                 |   4 +-
> >  sound/soc/intel/avs/pcm.c                     |   2 +-
> >  sound/soc/intel/catpt/pcm.c                   |  12 +-
> >  sound/soc/intel/catpt/sysfs.c                 |   2 +-
> >  sound/soc/soc-component.c                     |   2 +-
> >  sound/soc/sof/control.c                       |   2 +-
> >  sound/soc/sof/debug.c                         |   2 +-
> >  sound/soc/sof/ipc3-dtrace.c                   |   2 +-
> >  sound/soc/sof/ipc4-loader.c                   |   2 +-
> >  sound/soc/sof/pcm.c                           |   2 +-
> >  sound/soc/sof/sof-client-ipc-flood-test.c     |   2 +-
> >  .../soc/sof/sof-client-ipc-kernel-injector.c  |   2 +-
> >  sound/soc/sof/sof-client-ipc-msg-injector.c   |   2 +-
> >  sound/soc/sof/sof-client-probes.c             |   6 +-
> >  sound/x86/intel_hdmi_audio.c                  |   6 +-
> >  373 files changed, 1076 insertions(+), 1076 deletions(-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-07 18:49   ` Laurent Pinchart
@ 2024-10-07 22:08     ` Ulf Hansson
  2024-10-07 22:25       ` Laurent Pinchart
  2024-10-08 20:38     ` Uwe Kleine-König
  1 sibling, 1 reply; 15+ messages in thread
From: Ulf Hansson @ 2024-10-07 22:08 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Sakari Ailus, dri-devel, linux-kernel, linux-bluetooth, linux-clk,
	linux-crypto, dmaengine, linux-gpio, amd-gfx, nouveau,
	linux-stm32, linux-arm-kernel, linux-i2c, linux-i3c, linux-iio,
	linux-input, patches, iommu, imx, linux-mediatek, linux-media,
	linux-mmc, linux-mtd, netdev, linux-wireless, linux-pci,
	linux-phy, linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	rafael, Andy Shevchenko

On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Ulf,
>
> On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Hello everyone,
> > >
> > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > always used together, apart from bugs which are likely common. Going
> > > forward, most new users should be using pm_runtime_put_autosuspend().
> > >
> > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > and pm_runtime_mark_last_busy().
> >
> > That sounds like it could cause a lot of churns.
> >
> > Why not add a new helper function that does the
> > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > things? Then we can start moving users over to this new interface,
> > rather than having this intermediate step?
>
> I think the API would be nicer if we used the shortest and simplest
> function names for the most common use cases. Following
> pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> most common use case. That's why I like Sakari's approach of repurposing
> pm_runtime_put_autosuspend(), and introducing
> __pm_runtime_put_autosuspend() for the odd cases where
> pm_runtime_mark_last_busy() shouldn't be called.

Okay, so the reason for this approach is because we couldn't find a
short and descriptive name that could be used in favor of
pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
you like it - or not. :-)

I don't know what options you guys discussed, but to me the entire
"autosuspend"-suffix isn't really that necessary in my opinion. There
are more ways than calling pm_runtime_put_autosuspend() that triggers
us to use the RPM_AUTO flag for rpm_suspend(). For example, just
calling pm_runtime_put() has the similar effect.

Moreover, it's similar for pm_runtime_mark_last_busy(), it's called
during rpm_resume() too, for example. So why bother about having
"mark_last_busy" in the new name too.

That said, my suggestion is simply "pm_runtime_put_suspend".

If you don't like it, I will certainly not object to your current
approach, even if I think it leads to unnecessary churns.

[...]

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-07 22:08     ` Ulf Hansson
@ 2024-10-07 22:25       ` Laurent Pinchart
  2024-10-07 22:34         ` Ulf Hansson
  0 siblings, 1 reply; 15+ messages in thread
From: Laurent Pinchart @ 2024-10-07 22:25 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Sakari Ailus, dri-devel, linux-kernel, linux-bluetooth, linux-clk,
	linux-crypto, dmaengine, linux-gpio, amd-gfx, nouveau,
	linux-stm32, linux-arm-kernel, linux-i2c, linux-i3c, linux-iio,
	linux-input, patches, iommu, imx, linux-mediatek, linux-media,
	linux-mmc, linux-mtd, netdev, linux-wireless, linux-pci,
	linux-phy, linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	rafael, Andy Shevchenko

Hi Ulf,

On Tue, Oct 08, 2024 at 12:08:24AM +0200, Ulf Hansson wrote:
> On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote:
> > On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote:
> > > >
> > > > Hello everyone,
> > > >
> > > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > > always used together, apart from bugs which are likely common. Going
> > > > forward, most new users should be using pm_runtime_put_autosuspend().
> > > >
> > > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > > and pm_runtime_mark_last_busy().
> > >
> > > That sounds like it could cause a lot of churns.
> > >
> > > Why not add a new helper function that does the
> > > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > > things? Then we can start moving users over to this new interface,
> > > rather than having this intermediate step?
> >
> > I think the API would be nicer if we used the shortest and simplest
> > function names for the most common use cases. Following
> > pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> > most common use case. That's why I like Sakari's approach of repurposing
> > pm_runtime_put_autosuspend(), and introducing
> > __pm_runtime_put_autosuspend() for the odd cases where
> > pm_runtime_mark_last_busy() shouldn't be called.
> 
> Okay, so the reason for this approach is because we couldn't find a
> short and descriptive name that could be used in favor of
> pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
> you like it - or not. :-)

I like the idea at least :-)

> I don't know what options you guys discussed, but to me the entire
> "autosuspend"-suffix isn't really that necessary in my opinion. There
> are more ways than calling pm_runtime_put_autosuspend() that triggers
> us to use the RPM_AUTO flag for rpm_suspend(). For example, just
> calling pm_runtime_put() has the similar effect.

To be honest, I'm lost there. pm_runtime_put() calls
__pm_runtime_idle(RPM_GET_PUT | RPM_ASYNC), while
pm_runtime_put_autosuspend() calls __pm_runtime_suspend(RPM_GET_PUT |
RPM_ASYNC | RPM_AUTO).

> 
> Moreover, it's similar for pm_runtime_mark_last_busy(), it's called
> during rpm_resume() too, for example. So why bother about having
> "mark_last_busy" in the new name too.
> 
> That said, my suggestion is simply "pm_runtime_put_suspend".

Can we do even better, and make pm_runtime_put() to handle autosuspend
automatically when autosuspend is enabled ?

> If you don't like it, I will certainly not object to your current
> approach, even if I think it leads to unnecessary churns.
> 
> [...]
> 
> Kind regards
> Uffe

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-07 22:25       ` Laurent Pinchart
@ 2024-10-07 22:34         ` Ulf Hansson
  2024-10-08 18:24           ` Rafael J. Wysocki
  0 siblings, 1 reply; 15+ messages in thread
From: Ulf Hansson @ 2024-10-07 22:34 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Sakari Ailus, dri-devel, linux-kernel, linux-bluetooth, linux-clk,
	linux-crypto, dmaengine, linux-gpio, amd-gfx, nouveau,
	linux-stm32, linux-arm-kernel, linux-i2c, linux-i3c, linux-iio,
	linux-input, patches, iommu, imx, linux-mediatek, linux-media,
	linux-mmc, linux-mtd, netdev, linux-wireless, linux-pci,
	linux-phy, linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	rafael, Andy Shevchenko

On Tue, 8 Oct 2024 at 00:25, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Ulf,
>
> On Tue, Oct 08, 2024 at 12:08:24AM +0200, Ulf Hansson wrote:
> > On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote:
> > > On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > > > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote:
> > > > >
> > > > > Hello everyone,
> > > > >
> > > > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > > > always used together, apart from bugs which are likely common. Going
> > > > > forward, most new users should be using pm_runtime_put_autosuspend().
> > > > >
> > > > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > > > and pm_runtime_mark_last_busy().
> > > >
> > > > That sounds like it could cause a lot of churns.
> > > >
> > > > Why not add a new helper function that does the
> > > > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > > > things? Then we can start moving users over to this new interface,
> > > > rather than having this intermediate step?
> > >
> > > I think the API would be nicer if we used the shortest and simplest
> > > function names for the most common use cases. Following
> > > pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> > > most common use case. That's why I like Sakari's approach of repurposing
> > > pm_runtime_put_autosuspend(), and introducing
> > > __pm_runtime_put_autosuspend() for the odd cases where
> > > pm_runtime_mark_last_busy() shouldn't be called.
> >
> > Okay, so the reason for this approach is because we couldn't find a
> > short and descriptive name that could be used in favor of
> > pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
> > you like it - or not. :-)
>
> I like the idea at least :-)
>
> > I don't know what options you guys discussed, but to me the entire
> > "autosuspend"-suffix isn't really that necessary in my opinion. There
> > are more ways than calling pm_runtime_put_autosuspend() that triggers
> > us to use the RPM_AUTO flag for rpm_suspend(). For example, just
> > calling pm_runtime_put() has the similar effect.
>
> To be honest, I'm lost there. pm_runtime_put() calls
> __pm_runtime_idle(RPM_GET_PUT | RPM_ASYNC), while
> pm_runtime_put_autosuspend() calls __pm_runtime_suspend(RPM_GET_PUT |
> RPM_ASYNC | RPM_AUTO).

__pm_runtime_idle() ends up calling rpm_idle(), which may call
rpm_suspend() - if it succeeds to idle the device. In that case, it
tags on the RPM_AUTO flag in the call to rpm_suspend(). Quite similar
to what is happening when calling pm_runtime_put_autosuspend().

>
> >
> > Moreover, it's similar for pm_runtime_mark_last_busy(), it's called
> > during rpm_resume() too, for example. So why bother about having
> > "mark_last_busy" in the new name too.
> >
> > That said, my suggestion is simply "pm_runtime_put_suspend".
>
> Can we do even better, and make pm_runtime_put() to handle autosuspend
> automatically when autosuspend is enabled ?

As stated above, this is already the case.

>
> > If you don't like it, I will certainly not object to your current
> > approach, even if I think it leads to unnecessary churns.
> >
> > [...]
> >
> > Kind regards
> > Uffe
>
> --
> Regards,
>
> Laurent Pinchart

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-07 22:34         ` Ulf Hansson
@ 2024-10-08 18:24           ` Rafael J. Wysocki
  2024-10-09 10:20             ` Rafael J. Wysocki
                               ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Rafael J. Wysocki @ 2024-10-08 18:24 UTC (permalink / raw)
  To: Ulf Hansson, Laurent Pinchart, Sakari Ailus
  Cc: dri-devel, linux-kernel, linux-bluetooth, linux-clk, linux-crypto,
	dmaengine, linux-gpio, amd-gfx, nouveau, linux-stm32,
	linux-arm-kernel, linux-i2c, linux-i3c, linux-iio, linux-input,
	patches, iommu, imx, linux-mediatek, linux-media, linux-mmc,
	linux-mtd, netdev, linux-wireless, linux-pci, linux-phy,
	linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	Andy Shevchenko

On Tue, Oct 8, 2024 at 12:35 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Tue, 8 Oct 2024 at 00:25, Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
> >
> > Hi Ulf,
> >
> > On Tue, Oct 08, 2024 at 12:08:24AM +0200, Ulf Hansson wrote:
> > > On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote:
> > > > On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > > > > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote:
> > > > > >
> > > > > > Hello everyone,
> > > > > >
> > > > > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > > > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > > > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > > > > always used together, apart from bugs which are likely common. Going
> > > > > > forward, most new users should be using pm_runtime_put_autosuspend().
> > > > > >
> > > > > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > > > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > > > > and pm_runtime_mark_last_busy().
> > > > >
> > > > > That sounds like it could cause a lot of churns.
> > > > >
> > > > > Why not add a new helper function that does the
> > > > > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > > > > things? Then we can start moving users over to this new interface,
> > > > > rather than having this intermediate step?
> > > >
> > > > I think the API would be nicer if we used the shortest and simplest
> > > > function names for the most common use cases. Following
> > > > pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> > > > most common use case. That's why I like Sakari's approach of repurposing
> > > > pm_runtime_put_autosuspend(), and introducing
> > > > __pm_runtime_put_autosuspend() for the odd cases where
> > > > pm_runtime_mark_last_busy() shouldn't be called.
> > >
> > > Okay, so the reason for this approach is because we couldn't find a
> > > short and descriptive name that could be used in favor of
> > > pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
> > > you like it - or not. :-)
> >
> > I like the idea at least :-)
> >
> > > I don't know what options you guys discussed, but to me the entire
> > > "autosuspend"-suffix isn't really that necessary in my opinion. There
> > > are more ways than calling pm_runtime_put_autosuspend() that triggers
> > > us to use the RPM_AUTO flag for rpm_suspend(). For example, just
> > > calling pm_runtime_put() has the similar effect.
> >
> > To be honest, I'm lost there. pm_runtime_put() calls
> > __pm_runtime_idle(RPM_GET_PUT | RPM_ASYNC), while
> > pm_runtime_put_autosuspend() calls __pm_runtime_suspend(RPM_GET_PUT |
> > RPM_ASYNC | RPM_AUTO).
>
> __pm_runtime_idle() ends up calling rpm_idle(), which may call
> rpm_suspend() - if it succeeds to idle the device. In that case, it
> tags on the RPM_AUTO flag in the call to rpm_suspend(). Quite similar
> to what is happening when calling pm_runtime_put_autosuspend().

Right.

For almost everybody, except for a small bunch of drivers that
actually have a .runtime_idle() callback, pm_runtime_put() is
literally equivalent to pm_runtime_put_autosuspend().

So really the question is why anyone who doesn't provide a
.runtime_idle() callback bothers with using this special
pm_runtime_put_autosuspend() thing, which really means "do a
runtime_put(), but skip my .runtime_idle() callback".

> >
> > >
> > > Moreover, it's similar for pm_runtime_mark_last_busy(), it's called
> > > during rpm_resume() too, for example. So why bother about having
> > > "mark_last_busy" in the new name too.
> > >
> > > That said, my suggestion is simply "pm_runtime_put_suspend".
> >
> > Can we do even better, and make pm_runtime_put() to handle autosuspend
> > automatically when autosuspend is enabled ?
>
> As stated above, this is already the case.

What really is needed appears to be a combination of
pm_runtime_mark_last_busy() with pm_runtime_put().

Granted, pm_runtime_put() could do the pm_runtime_mark_last_busy()
thing automatically if autosuspend is enabled and the only consequence
of it might be delaying a suspend of the device until its autosuspend
timer expires, which should not be a problem in the vast majority of
cases.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-07 18:49   ` Laurent Pinchart
  2024-10-07 22:08     ` Ulf Hansson
@ 2024-10-08 20:38     ` Uwe Kleine-König
  1 sibling, 0 replies; 15+ messages in thread
From: Uwe Kleine-König @ 2024-10-08 20:38 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Ulf Hansson, Sakari Ailus, dri-devel, linux-kernel,
	linux-bluetooth, linux-clk, linux-crypto, dmaengine, linux-gpio,
	amd-gfx, nouveau, linux-stm32, linux-arm-kernel, linux-i2c,
	linux-i3c, linux-iio, linux-input, patches, iommu, imx,
	linux-mediatek, linux-media, linux-mmc, linux-mtd, netdev,
	linux-wireless, linux-pci, linux-phy, linux-pwm, linux-remoteproc,
	linux-sound, linux-spi, linux-staging, linux-usb, linux-serial,
	greybus-dev, asahi, rafael, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]

Hello,

On Mon, Oct 07, 2024 at 09:49:24PM +0300, Laurent Pinchart wrote:
> On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Hello everyone,
> > >
> > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > always used together, apart from bugs which are likely common. Going
> > > forward, most new users should be using pm_runtime_put_autosuspend().
> > >
> > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > and pm_runtime_mark_last_busy().
> > 
> > That sounds like it could cause a lot of churns.
> > 
> > Why not add a new helper function that does the
> > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > things? Then we can start moving users over to this new interface,
> > rather than having this intermediate step?
> 
> I think the API would be nicer if we used the shortest and simplest
> function names for the most common use cases. Following
> pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> most common use case. That's why I like Sakari's approach of repurposing
> pm_runtime_put_autosuspend(), and introducing
> __pm_runtime_put_autosuspend() for the odd cases where
> pm_runtime_mark_last_busy() shouldn't be called.

That's ok for me. However this patch series isn't the optimal path to
there because most drivers (i.e. those that already today do
pm_runtime_mark_last_busy() in combination with
pm_runtime_put_autosuspend()) have to be patched twice.

The saner route is: Only convert the drivers with a sole
pm_runtime_put_autosuspend() (i.e. without pm_runtime_mark_last_busy())
to __pm_runtime_put_autosuspend(). Then add the mark_last_busy() bits to
pm_runtime_put_autosuspend() and then drop the explicit calls to
pm_runtime_mark_last_busy() before pm_runtime_put_autosuspend().

(Note this doesn't take into account Rafael's position that
pm_runtime_put() might be the saner option. My argument applies for that
conversion analogously.)

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-08 18:24           ` Rafael J. Wysocki
@ 2024-10-09 10:20             ` Rafael J. Wysocki
  2024-10-09 10:27             ` Ulf Hansson
  2024-10-09 12:48             ` Richard Fitzgerald
  2 siblings, 0 replies; 15+ messages in thread
From: Rafael J. Wysocki @ 2024-10-09 10:20 UTC (permalink / raw)
  To: Ulf Hansson, Laurent Pinchart, Sakari Ailus
  Cc: dri-devel, linux-kernel, linux-bluetooth, linux-clk, linux-crypto,
	dmaengine, linux-gpio, amd-gfx, nouveau, linux-stm32,
	linux-arm-kernel, linux-i2c, linux-i3c, linux-iio, linux-input,
	patches, iommu, imx, linux-mediatek, linux-media, linux-mmc,
	linux-mtd, netdev, linux-wireless, linux-pci, linux-phy,
	linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	Andy Shevchenko

On Tue, Oct 8, 2024 at 8:24 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Tue, Oct 8, 2024 at 12:35 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >
> > On Tue, 8 Oct 2024 at 00:25, Laurent Pinchart
> > <laurent.pinchart@ideasonboard.com> wrote:
> > >
> > > Hi Ulf,
> > >
> > > On Tue, Oct 08, 2024 at 12:08:24AM +0200, Ulf Hansson wrote:
> > > > On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote:
> > > > > On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > > > > > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote:
> > > > > > >
> > > > > > > Hello everyone,
> > > > > > >
> > > > > > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > > > > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > > > > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > > > > > always used together, apart from bugs which are likely common. Going
> > > > > > > forward, most new users should be using pm_runtime_put_autosuspend().
> > > > > > >
> > > > > > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > > > > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > > > > > and pm_runtime_mark_last_busy().
> > > > > >
> > > > > > That sounds like it could cause a lot of churns.
> > > > > >
> > > > > > Why not add a new helper function that does the
> > > > > > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > > > > > things? Then we can start moving users over to this new interface,
> > > > > > rather than having this intermediate step?
> > > > >
> > > > > I think the API would be nicer if we used the shortest and simplest
> > > > > function names for the most common use cases. Following
> > > > > pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> > > > > most common use case. That's why I like Sakari's approach of repurposing
> > > > > pm_runtime_put_autosuspend(), and introducing
> > > > > __pm_runtime_put_autosuspend() for the odd cases where
> > > > > pm_runtime_mark_last_busy() shouldn't be called.
> > > >
> > > > Okay, so the reason for this approach is because we couldn't find a
> > > > short and descriptive name that could be used in favor of
> > > > pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
> > > > you like it - or not. :-)
> > >
> > > I like the idea at least :-)
> > >
> > > > I don't know what options you guys discussed, but to me the entire
> > > > "autosuspend"-suffix isn't really that necessary in my opinion. There
> > > > are more ways than calling pm_runtime_put_autosuspend() that triggers
> > > > us to use the RPM_AUTO flag for rpm_suspend(). For example, just
> > > > calling pm_runtime_put() has the similar effect.
> > >
> > > To be honest, I'm lost there. pm_runtime_put() calls
> > > __pm_runtime_idle(RPM_GET_PUT | RPM_ASYNC), while
> > > pm_runtime_put_autosuspend() calls __pm_runtime_suspend(RPM_GET_PUT |
> > > RPM_ASYNC | RPM_AUTO).
> >
> > __pm_runtime_idle() ends up calling rpm_idle(), which may call
> > rpm_suspend() - if it succeeds to idle the device. In that case, it
> > tags on the RPM_AUTO flag in the call to rpm_suspend(). Quite similar
> > to what is happening when calling pm_runtime_put_autosuspend().
>
> Right.
>
> For almost everybody, except for a small bunch of drivers that
> actually have a .runtime_idle() callback, pm_runtime_put() is
> literally equivalent to pm_runtime_put_autosuspend().
>
> So really the question is why anyone who doesn't provide a
> .runtime_idle() callback bothers with using this special
> pm_runtime_put_autosuspend() thing, which really means "do a
> runtime_put(), but skip my .runtime_idle() callback".
>
> > >
> > > >
> > > > Moreover, it's similar for pm_runtime_mark_last_busy(), it's called
> > > > during rpm_resume() too, for example. So why bother about having
> > > > "mark_last_busy" in the new name too.
> > > >
> > > > That said, my suggestion is simply "pm_runtime_put_suspend".
> > >
> > > Can we do even better, and make pm_runtime_put() to handle autosuspend
> > > automatically when autosuspend is enabled ?
> >
> > As stated above, this is already the case.
>
> What really is needed appears to be a combination of
> pm_runtime_mark_last_busy() with pm_runtime_put().
>
> Granted, pm_runtime_put() could do the pm_runtime_mark_last_busy()
> thing automatically if autosuspend is enabled and the only consequence
> of it might be delaying a suspend of the device until its autosuspend
> timer expires, which should not be a problem in the vast majority of
> cases.

That said, it is likely better to avoid surprising the current users
of pm_runtime_put() and define something like

static inline void pm_runtime_touch_and_put(struct device *dev)
{
        pm_runtime_mark_last_busy(dev);
        pm_runtime_put(dev);
}

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-08 18:24           ` Rafael J. Wysocki
  2024-10-09 10:20             ` Rafael J. Wysocki
@ 2024-10-09 10:27             ` Ulf Hansson
  2024-10-09 12:48             ` Richard Fitzgerald
  2 siblings, 0 replies; 15+ messages in thread
From: Ulf Hansson @ 2024-10-09 10:27 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Laurent Pinchart, Sakari Ailus, dri-devel, linux-kernel,
	linux-bluetooth, linux-clk, linux-crypto, dmaengine, linux-gpio,
	amd-gfx, nouveau, linux-stm32, linux-arm-kernel, linux-i2c,
	linux-i3c, linux-iio, linux-input, patches, iommu, imx,
	linux-mediatek, linux-media, linux-mmc, linux-mtd, netdev,
	linux-wireless, linux-pci, linux-phy, linux-pwm, linux-remoteproc,
	linux-sound, linux-spi, linux-staging, linux-usb, linux-serial,
	greybus-dev, asahi, Andy Shevchenko

On Tue, 8 Oct 2024 at 20:25, Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Tue, Oct 8, 2024 at 12:35 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >
> > On Tue, 8 Oct 2024 at 00:25, Laurent Pinchart
> > <laurent.pinchart@ideasonboard.com> wrote:
> > >
> > > Hi Ulf,
> > >
> > > On Tue, Oct 08, 2024 at 12:08:24AM +0200, Ulf Hansson wrote:
> > > > On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote:
> > > > > On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> > > > > > On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote:
> > > > > > >
> > > > > > > Hello everyone,
> > > > > > >
> > > > > > > This set will switch the users of pm_runtime_put_autosuspend() to
> > > > > > > __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> > > > > > > to include a call to pm_runtime_mark_last_busy(). The two are almost
> > > > > > > always used together, apart from bugs which are likely common. Going
> > > > > > > forward, most new users should be using pm_runtime_put_autosuspend().
> > > > > > >
> > > > > > > Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> > > > > > > I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> > > > > > > and pm_runtime_mark_last_busy().
> > > > > >
> > > > > > That sounds like it could cause a lot of churns.
> > > > > >
> > > > > > Why not add a new helper function that does the
> > > > > > pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> > > > > > things? Then we can start moving users over to this new interface,
> > > > > > rather than having this intermediate step?
> > > > >
> > > > > I think the API would be nicer if we used the shortest and simplest
> > > > > function names for the most common use cases. Following
> > > > > pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> > > > > most common use case. That's why I like Sakari's approach of repurposing
> > > > > pm_runtime_put_autosuspend(), and introducing
> > > > > __pm_runtime_put_autosuspend() for the odd cases where
> > > > > pm_runtime_mark_last_busy() shouldn't be called.
> > > >
> > > > Okay, so the reason for this approach is because we couldn't find a
> > > > short and descriptive name that could be used in favor of
> > > > pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
> > > > you like it - or not. :-)
> > >
> > > I like the idea at least :-)
> > >
> > > > I don't know what options you guys discussed, but to me the entire
> > > > "autosuspend"-suffix isn't really that necessary in my opinion. There
> > > > are more ways than calling pm_runtime_put_autosuspend() that triggers
> > > > us to use the RPM_AUTO flag for rpm_suspend(). For example, just
> > > > calling pm_runtime_put() has the similar effect.
> > >
> > > To be honest, I'm lost there. pm_runtime_put() calls
> > > __pm_runtime_idle(RPM_GET_PUT | RPM_ASYNC), while
> > > pm_runtime_put_autosuspend() calls __pm_runtime_suspend(RPM_GET_PUT |
> > > RPM_ASYNC | RPM_AUTO).
> >
> > __pm_runtime_idle() ends up calling rpm_idle(), which may call
> > rpm_suspend() - if it succeeds to idle the device. In that case, it
> > tags on the RPM_AUTO flag in the call to rpm_suspend(). Quite similar
> > to what is happening when calling pm_runtime_put_autosuspend().
>
> Right.
>
> For almost everybody, except for a small bunch of drivers that
> actually have a .runtime_idle() callback, pm_runtime_put() is
> literally equivalent to pm_runtime_put_autosuspend().
>
> So really the question is why anyone who doesn't provide a
> .runtime_idle() callback bothers with using this special
> pm_runtime_put_autosuspend() thing, which really means "do a
> runtime_put(), but skip my .runtime_idle() callback".

My guess is that it's in most cases a legacy pattern that is being
followed. Also note that rpm_idle() didn't "always" tag on the
RPM_AUTO flag, even if it's quite a while ago (2013) since we added
it.

Unless there is some actual optimization involved, as it also allows
us to skip calling rpm_idle() and go directly for rpm_suspend().

>
> > >
> > > >
> > > > Moreover, it's similar for pm_runtime_mark_last_busy(), it's called
> > > > during rpm_resume() too, for example. So why bother about having
> > > > "mark_last_busy" in the new name too.
> > > >
> > > > That said, my suggestion is simply "pm_runtime_put_suspend".
> > >
> > > Can we do even better, and make pm_runtime_put() to handle autosuspend
> > > automatically when autosuspend is enabled ?
> >
> > As stated above, this is already the case.
>
> What really is needed appears to be a combination of
> pm_runtime_mark_last_busy() with pm_runtime_put().

This makes sense to me too, but I don't think we should limit it to this.

Making pm_runtime_put_autosuspend (or if the name
"pm_runtime_put_suspend" is better?) to do the similar thing, is
probably a good idea too. At least in my opinion.

>
> Granted, pm_runtime_put() could do the pm_runtime_mark_last_busy()
> thing automatically if autosuspend is enabled and the only consequence
> of it might be delaying a suspend of the device until its autosuspend
> timer expires, which should not be a problem in the vast majority of
> cases.

Right.

I guess we should expect the *sync* variants to be used, if the timer
really needs to be overridden.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-08 18:24           ` Rafael J. Wysocki
  2024-10-09 10:20             ` Rafael J. Wysocki
  2024-10-09 10:27             ` Ulf Hansson
@ 2024-10-09 12:48             ` Richard Fitzgerald
  2024-10-09 13:34               ` Rafael J. Wysocki
  2 siblings, 1 reply; 15+ messages in thread
From: Richard Fitzgerald @ 2024-10-09 12:48 UTC (permalink / raw)
  To: Rafael J. Wysocki, Ulf Hansson, Laurent Pinchart, Sakari Ailus
  Cc: dri-devel, linux-kernel, linux-bluetooth, linux-clk, linux-crypto,
	dmaengine, linux-gpio, amd-gfx, nouveau, linux-stm32,
	linux-arm-kernel, linux-i2c, linux-i3c, linux-iio, linux-input,
	patches, iommu, imx, linux-mediatek, linux-media, linux-mmc,
	linux-mtd, netdev, linux-wireless, linux-pci, linux-phy,
	linux-pwm, linux-remoteproc, linux-sound, linux-spi,
	linux-staging, linux-usb, linux-serial, greybus-dev, asahi,
	Andy Shevchenko

On 08/10/2024 7:24 pm, Rafael J. Wysocki wrote:
> On Tue, Oct 8, 2024 at 12:35 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>
>> On Tue, 8 Oct 2024 at 00:25, Laurent Pinchart
>> <laurent.pinchart@ideasonboard.com> wrote:
>>>
>>> Hi Ulf,
>>>
>>> On Tue, Oct 08, 2024 at 12:08:24AM +0200, Ulf Hansson wrote:
>>>> On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote:
>>>>> On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
>>>>>> On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote:
>>>>>>>
>>>>>>> Hello everyone,
>>>>>>>
>>>>>>> This set will switch the users of pm_runtime_put_autosuspend() to
>>>>>>> __pm_runtime_put_autosuspend() while the former will soon be re-purposed
>>>>>>> to include a call to pm_runtime_mark_last_busy(). The two are almost
>>>>>>> always used together, apart from bugs which are likely common. Going
>>>>>>> forward, most new users should be using pm_runtime_put_autosuspend().
>>>>>>>
>>>>>>> Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
>>>>>>> I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
>>>>>>> and pm_runtime_mark_last_busy().
>>>>>>
>>>>>> That sounds like it could cause a lot of churns.
>>>>>>
>>>>>> Why not add a new helper function that does the
>>>>>> pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
>>>>>> things? Then we can start moving users over to this new interface,
>>>>>> rather than having this intermediate step?
>>>>>
>>>>> I think the API would be nicer if we used the shortest and simplest
>>>>> function names for the most common use cases. Following
>>>>> pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
>>>>> most common use case. That's why I like Sakari's approach of repurposing
>>>>> pm_runtime_put_autosuspend(), and introducing
>>>>> __pm_runtime_put_autosuspend() for the odd cases where
>>>>> pm_runtime_mark_last_busy() shouldn't be called.
>>>>
>>>> Okay, so the reason for this approach is because we couldn't find a
>>>> short and descriptive name that could be used in favor of
>>>> pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
>>>> you like it - or not. :-)
>>>
>>> I like the idea at least :-)
>>>
>>>> I don't know what options you guys discussed, but to me the entire
>>>> "autosuspend"-suffix isn't really that necessary in my opinion. There
>>>> are more ways than calling pm_runtime_put_autosuspend() that triggers
>>>> us to use the RPM_AUTO flag for rpm_suspend(). For example, just
>>>> calling pm_runtime_put() has the similar effect.
>>>
>>> To be honest, I'm lost there. pm_runtime_put() calls
>>> __pm_runtime_idle(RPM_GET_PUT | RPM_ASYNC), while
>>> pm_runtime_put_autosuspend() calls __pm_runtime_suspend(RPM_GET_PUT |
>>> RPM_ASYNC | RPM_AUTO).
>>
>> __pm_runtime_idle() ends up calling rpm_idle(), which may call
>> rpm_suspend() - if it succeeds to idle the device. In that case, it
>> tags on the RPM_AUTO flag in the call to rpm_suspend(). Quite similar
>> to what is happening when calling pm_runtime_put_autosuspend().
> 
> Right.
> 
> For almost everybody, except for a small bunch of drivers that
> actually have a .runtime_idle() callback, pm_runtime_put() is
> literally equivalent to pm_runtime_put_autosuspend().
> 
> So really the question is why anyone who doesn't provide a
> .runtime_idle() callback bothers with using this special
> pm_runtime_put_autosuspend() thing,

Because they are following the documentation? It says:

"Drivers should call pm_runtime_mark_last_busy() to update this field
after carrying out I/O, typically just before calling
pm_runtime_put_autosuspend()."

and

"In order to use autosuspend, subsystems or drivers must call
pm_runtime_use_autosuspend() (...), and thereafter they should use the
various `*_autosuspend()` helper functions instead of the non#
autosuspend counterparts"

So the documentation says I should be using pm_runtime_put_autosuspend()
instead of pm_runtime_put().

Seems unfair to criticise people for following the documentation.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend()
  2024-10-09 12:48             ` Richard Fitzgerald
@ 2024-10-09 13:34               ` Rafael J. Wysocki
  0 siblings, 0 replies; 15+ messages in thread
From: Rafael J. Wysocki @ 2024-10-09 13:34 UTC (permalink / raw)
  To: Richard Fitzgerald, Sakari Ailus
  Cc: Ulf Hansson, Laurent Pinchart, dri-devel, linux-kernel,
	linux-bluetooth, linux-clk, linux-crypto, dmaengine, linux-gpio,
	amd-gfx, nouveau, linux-stm32, linux-arm-kernel, linux-i2c,
	linux-i3c, linux-iio, linux-input, patches, iommu, imx,
	linux-mediatek, linux-media, linux-mmc, linux-mtd, netdev,
	linux-wireless, linux-pci, linux-phy, linux-pwm, linux-remoteproc,
	linux-sound, linux-spi, linux-staging, linux-usb, linux-serial,
	greybus-dev, asahi, Andy Shevchenko, Uwe Kleine-König

On Wed, Oct 9, 2024 at 2:48 PM Richard Fitzgerald
<rf@opensource.cirrus.com> wrote:
>
> On 08/10/2024 7:24 pm, Rafael J. Wysocki wrote:
> > On Tue, Oct 8, 2024 at 12:35 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >>
> >> On Tue, 8 Oct 2024 at 00:25, Laurent Pinchart
> >> <laurent.pinchart@ideasonboard.com> wrote:
> >>>
> >>> Hi Ulf,
> >>>
> >>> On Tue, Oct 08, 2024 at 12:08:24AM +0200, Ulf Hansson wrote:
> >>>> On Mon, 7 Oct 2024 at 20:49, Laurent Pinchart wrote:
> >>>>> On Fri, Oct 04, 2024 at 04:38:36PM +0200, Ulf Hansson wrote:
> >>>>>> On Fri, 4 Oct 2024 at 11:41, Sakari Ailus wrote:
> >>>>>>>
> >>>>>>> Hello everyone,
> >>>>>>>
> >>>>>>> This set will switch the users of pm_runtime_put_autosuspend() to
> >>>>>>> __pm_runtime_put_autosuspend() while the former will soon be re-purposed
> >>>>>>> to include a call to pm_runtime_mark_last_busy(). The two are almost
> >>>>>>> always used together, apart from bugs which are likely common. Going
> >>>>>>> forward, most new users should be using pm_runtime_put_autosuspend().
> >>>>>>>
> >>>>>>> Once this conversion is done and pm_runtime_put_autosuspend() re-purposed,
> >>>>>>> I'll post another set to merge the calls to __pm_runtime_put_autosuspend()
> >>>>>>> and pm_runtime_mark_last_busy().
> >>>>>>
> >>>>>> That sounds like it could cause a lot of churns.
> >>>>>>
> >>>>>> Why not add a new helper function that does the
> >>>>>> pm_runtime_put_autosuspend() and the pm_runtime_mark_last_busy()
> >>>>>> things? Then we can start moving users over to this new interface,
> >>>>>> rather than having this intermediate step?
> >>>>>
> >>>>> I think the API would be nicer if we used the shortest and simplest
> >>>>> function names for the most common use cases. Following
> >>>>> pm_runtime_put_autosuspend() with pm_runtime_mark_last_busy() is that
> >>>>> most common use case. That's why I like Sakari's approach of repurposing
> >>>>> pm_runtime_put_autosuspend(), and introducing
> >>>>> __pm_runtime_put_autosuspend() for the odd cases where
> >>>>> pm_runtime_mark_last_busy() shouldn't be called.
> >>>>
> >>>> Okay, so the reason for this approach is because we couldn't find a
> >>>> short and descriptive name that could be used in favor of
> >>>> pm_runtime_put_autosuspend(). Let me throw some ideas at it and maybe
> >>>> you like it - or not. :-)
> >>>
> >>> I like the idea at least :-)
> >>>
> >>>> I don't know what options you guys discussed, but to me the entire
> >>>> "autosuspend"-suffix isn't really that necessary in my opinion. There
> >>>> are more ways than calling pm_runtime_put_autosuspend() that triggers
> >>>> us to use the RPM_AUTO flag for rpm_suspend(). For example, just
> >>>> calling pm_runtime_put() has the similar effect.
> >>>
> >>> To be honest, I'm lost there. pm_runtime_put() calls
> >>> __pm_runtime_idle(RPM_GET_PUT | RPM_ASYNC), while
> >>> pm_runtime_put_autosuspend() calls __pm_runtime_suspend(RPM_GET_PUT |
> >>> RPM_ASYNC | RPM_AUTO).
> >>
> >> __pm_runtime_idle() ends up calling rpm_idle(), which may call
> >> rpm_suspend() - if it succeeds to idle the device. In that case, it
> >> tags on the RPM_AUTO flag in the call to rpm_suspend(). Quite similar
> >> to what is happening when calling pm_runtime_put_autosuspend().
> >
> > Right.
> >
> > For almost everybody, except for a small bunch of drivers that
> > actually have a .runtime_idle() callback, pm_runtime_put() is
> > literally equivalent to pm_runtime_put_autosuspend().
> >
> > So really the question is why anyone who doesn't provide a
> > .runtime_idle() callback bothers with using this special
> > pm_runtime_put_autosuspend() thing,
>
> Because they are following the documentation? It says:
>
> "Drivers should call pm_runtime_mark_last_busy() to update this field
> after carrying out I/O, typically just before calling
> pm_runtime_put_autosuspend()."
>
> and
>
> "In order to use autosuspend, subsystems or drivers must call
> pm_runtime_use_autosuspend() (...), and thereafter they should use the
> various `*_autosuspend()` helper functions instead of the non#
> autosuspend counterparts"
>
> So the documentation says I should be using pm_runtime_put_autosuspend()
> instead of pm_runtime_put().
>
> Seems unfair to criticise people for following the documentation.

I'm not criticising anyone, just wondering why they do what they do.

"Because it is documented this way" is a fair answer, but it doesn't
invalidate the observation that the difference between
pm_runtime_put_autosuspend() and pm_runtime_put() boils down to the
cases when the .runtime_idle() callback is present (which are few and
far between so to speak).  Moreover, there are call sites using
pm_runtime_*() functions even though they may not know whether or not
autosuspend is enabled for the target devices, so the advice given in
the documentation cannot be universally followed regardless.

This thread is about the way to go, generally speaking, and what I'm
saying is effectively that replacing pm_runtime_put_autosuspend() with
pm_runtime_put() almost everywhere (if not just everywhere) would be
fine with me.

I also think that the current users of pm_runtime_put_autosuspend()
that is not immediately preceded by pm_runtime_mark_last_busy() can be
readily switched over to using pm_runtime_put() instead of it and then
pm_runtime_put_autosuspend() can be made call
pm_runtime_mark_last_busy(), so the latter can be removed from the
code using the former.  Note that this last step does not require
tree-wide changes, because calling pm_runtime_mark_last_busy() twice
in a row for the same device is not a problem.

Of course, the documentation needs to be updated in accordance with
the code changes, which didn't happen when previous changes were made
to pm_runtime_put() and that likely is why it does not reflect the
current code.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-10-09 13:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04  9:41 [PATCH 00/51] treewide: Switch to __pm_runtime_put_autosuspend() Sakari Ailus
2024-10-04  9:41 ` [PATCH 43/51] thunderbolt: " Sakari Ailus
2024-10-04 10:07   ` Mika Westerberg
2024-10-04  9:41 ` [PATCH 45/51] usb: " Sakari Ailus
2024-10-04 14:38 ` [PATCH 00/51] treewide: " Ulf Hansson
2024-10-07 18:49   ` Laurent Pinchart
2024-10-07 22:08     ` Ulf Hansson
2024-10-07 22:25       ` Laurent Pinchart
2024-10-07 22:34         ` Ulf Hansson
2024-10-08 18:24           ` Rafael J. Wysocki
2024-10-09 10:20             ` Rafael J. Wysocki
2024-10-09 10:27             ` Ulf Hansson
2024-10-09 12:48             ` Richard Fitzgerald
2024-10-09 13:34               ` Rafael J. Wysocki
2024-10-08 20:38     ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).