[PATCH v2 00/45] Consolidate hrtimer initialization - Part 4

Nam Cao posted 45 patches 10 months, 1 week ago
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c         |  4 ++--
drivers/gpu/drm/i915/gt/uc/intel_huc.c           |  4 ++--
drivers/gpu/drm/i915/gvt/display.c               |  3 +--
drivers/gpu/drm/i915/gvt/sched_policy.c          |  3 +--
drivers/gpu/drm/i915/i915_perf.c                 |  5 ++---
drivers/gpu/drm/i915/i915_pmu.c                  |  3 +--
drivers/gpu/drm/i915/i915_request.c              |  3 +--
drivers/gpu/drm/i915/intel_uncore.c              |  3 +--
drivers/gpu/drm/msm/msm_fence.c                  |  3 +--
drivers/gpu/drm/msm/msm_io_utils.c               |  3 +--
drivers/gpu/drm/vkms/vkms_crtc.c                 |  4 ++--
drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c             |  4 ++--
drivers/gpu/drm/xe/xe_oa.c                       |  4 ++--
drivers/hwtracing/stm/heartbeat.c                |  6 ++----
drivers/i2c/busses/i2c-imx.c                     |  4 ++--
drivers/iio/adc/ti-tsc2046.c                     |  4 +---
drivers/iio/trigger/iio-trig-hrtimer.c           |  4 ++--
drivers/infiniband/hw/hfi1/init.c                |  5 ++---
drivers/infiniband/sw/rdmavt/qp.c                |  5 ++---
drivers/input/joystick/walkera0701.c             |  3 +--
drivers/input/keyboard/gpio_keys.c               | 10 ++++------
drivers/leds/trigger/ledtrig-pattern.c           |  4 ++--
drivers/mailbox/mailbox.c                        |  4 +---
drivers/media/cec/core/cec-pin.c                 |  3 +--
drivers/media/pci/cx88/cx88-input.c              |  3 +--
.../media/platform/chips-media/wave5/wave5-vpu.c |  4 ++--
drivers/media/rc/pwm-ir-tx.c                     |  3 +--
drivers/misc/vcpu_stall_detector.c               |  3 +--
drivers/mmc/host/dw_mmc.c                        |  3 +--
drivers/ntb/test/ntb_pingpong.c                  |  3 +--
drivers/perf/arm-ccn.c                           |  5 ++---
drivers/perf/marvell_cn10k_ddr_pmu.c             |  4 ++--
drivers/perf/thunderx2_pmu.c                     |  5 ++---
drivers/power/reset/ltc2952-poweroff.c           |  8 ++++----
drivers/power/supply/ab8500_chargalg.c           |  9 ++++-----
drivers/powercap/idle_inject.c                   |  3 +--
drivers/powercap/intel_rapl_common.c             |  3 +--
drivers/pps/generators/pps_gen_parport.c         |  3 +--
drivers/pwm/pwm-gpio.c                           |  5 ++---
drivers/rtc/class.c                              |  3 +--
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c         |  4 +---
drivers/scsi/lpfc/lpfc_init.c                    |  7 +++----
drivers/scsi/scsi_debug.c                        |  4 ++--
drivers/tty/serial/8250/8250_bcm7271.c           |  3 +--
drivers/tty/serial/8250/8250_port.c              | 10 ++++------
drivers/tty/serial/amba-pl011.c                  |  9 ++++-----
drivers/tty/serial/imx.c                         |  8 ++++----
drivers/tty/serial/sh-sci.c                      |  3 +--
drivers/tty/serial/xilinx_uartps.c               |  4 ++--
drivers/usb/chipidea/otg_fsm.c                   |  3 +--
drivers/usb/dwc2/hcd_queue.c                     |  3 +--
drivers/usb/fotg210/fotg210-hcd.c                |  3 +--
drivers/usb/gadget/function/f_ncm.c              |  3 +--
drivers/usb/gadget/udc/dummy_hcd.c               |  6 ++----
drivers/usb/host/ehci-hcd.c                      |  3 +--
drivers/usb/musb/musb_cppi41.c                   |  4 ++--
drivers/usb/typec/tcpm/tcpm.c                    | 16 ++++++++--------
drivers/virtio/virtio_mem.c                      |  4 ++--
sound/core/hrtimer.c                             |  3 +--
sound/drivers/dummy.c                            |  3 +--
sound/drivers/pcsp/pcsp.c                        |  3 +--
sound/sh/sh_dac_audio.c                          |  3 +--
sound/soc/fsl/imx-pcm-fiq.c                      |  3 +--
63 files changed, 112 insertions(+), 165 deletions(-)
[PATCH v2 00/45] Consolidate hrtimer initialization - Part 4
Posted by Nam Cao 10 months, 1 week ago
hrtimers is initialized with hrtimer_init(), and after that the timer's
callback function is setup separately. This separate initialization is
error prone and awkward to use.

hrtimer_setup() combines the initialization and is simpler to use.

Switch to use the new setup function. Most conversions were done with
Coccinelle, see the sematic patch below.

This series is intended to be applied to the tip tree

v1 -> v2 https://lore.kernel.org/lkml/cover.1729865485.git.namcao@linutronix.de
  - rebase onto v6.14-rc1
---
virtual patch
@@ expression timer, clock, mode, func; @@
- hrtimer_init(timer, clock, mode);
  ...
- timer->function = func;
+ hrtimer_setup(timer, func, clock, mode);

@@ expression timer, clock, mode, func; @@
- hrtimer_init(&timer, clock, mode);
  ...
- timer.function = func;
+ hrtimer_setup(&timer, func, clock, mode);

@@ expression timer, clock, mode, func; @@
- hrtimer_init_on_stack(&timer, clock, mode);
  ...
- timer.function = func;
+ hrtimer_setup_on_stack(&timer, func, clock, mode);

@@ expression timer, clock, mode; @@
- hrtimer_init_sleeper_on_stack(timer, clock, mode);
+ hrtimer_setup_sleeper_on_stack(timer, clock, mode);

---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Jassi Brar <jassisinghbrar@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Andi Shyti <andi.shyti@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Zack Rusin <zack.rusin@broadcom.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: "Uwe Kleine-König" <ukleinek@kernel.org>
Cc: Takashi Iwai <tiwai@suse.com>
---

 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c         |  4 ++--
 drivers/gpu/drm/i915/gt/uc/intel_huc.c           |  4 ++--
 drivers/gpu/drm/i915/gvt/display.c               |  3 +--
 drivers/gpu/drm/i915/gvt/sched_policy.c          |  3 +--
 drivers/gpu/drm/i915/i915_perf.c                 |  5 ++---
 drivers/gpu/drm/i915/i915_pmu.c                  |  3 +--
 drivers/gpu/drm/i915/i915_request.c              |  3 +--
 drivers/gpu/drm/i915/intel_uncore.c              |  3 +--
 drivers/gpu/drm/msm/msm_fence.c                  |  3 +--
 drivers/gpu/drm/msm/msm_io_utils.c               |  3 +--
 drivers/gpu/drm/vkms/vkms_crtc.c                 |  4 ++--
 drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c             |  4 ++--
 drivers/gpu/drm/xe/xe_oa.c                       |  4 ++--
 drivers/hwtracing/stm/heartbeat.c                |  6 ++----
 drivers/i2c/busses/i2c-imx.c                     |  4 ++--
 drivers/iio/adc/ti-tsc2046.c                     |  4 +---
 drivers/iio/trigger/iio-trig-hrtimer.c           |  4 ++--
 drivers/infiniband/hw/hfi1/init.c                |  5 ++---
 drivers/infiniband/sw/rdmavt/qp.c                |  5 ++---
 drivers/input/joystick/walkera0701.c             |  3 +--
 drivers/input/keyboard/gpio_keys.c               | 10 ++++------
 drivers/leds/trigger/ledtrig-pattern.c           |  4 ++--
 drivers/mailbox/mailbox.c                        |  4 +---
 drivers/media/cec/core/cec-pin.c                 |  3 +--
 drivers/media/pci/cx88/cx88-input.c              |  3 +--
 .../media/platform/chips-media/wave5/wave5-vpu.c |  4 ++--
 drivers/media/rc/pwm-ir-tx.c                     |  3 +--
 drivers/misc/vcpu_stall_detector.c               |  3 +--
 drivers/mmc/host/dw_mmc.c                        |  3 +--
 drivers/ntb/test/ntb_pingpong.c                  |  3 +--
 drivers/perf/arm-ccn.c                           |  5 ++---
 drivers/perf/marvell_cn10k_ddr_pmu.c             |  4 ++--
 drivers/perf/thunderx2_pmu.c                     |  5 ++---
 drivers/power/reset/ltc2952-poweroff.c           |  8 ++++----
 drivers/power/supply/ab8500_chargalg.c           |  9 ++++-----
 drivers/powercap/idle_inject.c                   |  3 +--
 drivers/powercap/intel_rapl_common.c             |  3 +--
 drivers/pps/generators/pps_gen_parport.c         |  3 +--
 drivers/pwm/pwm-gpio.c                           |  5 ++---
 drivers/rtc/class.c                              |  3 +--
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c         |  4 +---
 drivers/scsi/lpfc/lpfc_init.c                    |  7 +++----
 drivers/scsi/scsi_debug.c                        |  4 ++--
 drivers/tty/serial/8250/8250_bcm7271.c           |  3 +--
 drivers/tty/serial/8250/8250_port.c              | 10 ++++------
 drivers/tty/serial/amba-pl011.c                  |  9 ++++-----
 drivers/tty/serial/imx.c                         |  8 ++++----
 drivers/tty/serial/sh-sci.c                      |  3 +--
 drivers/tty/serial/xilinx_uartps.c               |  4 ++--
 drivers/usb/chipidea/otg_fsm.c                   |  3 +--
 drivers/usb/dwc2/hcd_queue.c                     |  3 +--
 drivers/usb/fotg210/fotg210-hcd.c                |  3 +--
 drivers/usb/gadget/function/f_ncm.c              |  3 +--
 drivers/usb/gadget/udc/dummy_hcd.c               |  6 ++----
 drivers/usb/host/ehci-hcd.c                      |  3 +--
 drivers/usb/musb/musb_cppi41.c                   |  4 ++--
 drivers/usb/typec/tcpm/tcpm.c                    | 16 ++++++++--------
 drivers/virtio/virtio_mem.c                      |  4 ++--
 sound/core/hrtimer.c                             |  3 +--
 sound/drivers/dummy.c                            |  3 +--
 sound/drivers/pcsp/pcsp.c                        |  3 +--
 sound/sh/sh_dac_audio.c                          |  3 +--
 sound/soc/fsl/imx-pcm-fiq.c                      |  3 +--
 63 files changed, 112 insertions(+), 165 deletions(-)

-- 
2.39.5
Re: [PATCH v2 00/45] Consolidate hrtimer initialization - Part 4
Posted by Alexander Shishkin 10 months, 1 week ago
Nam Cao <namcao@linutronix.de> writes:

> hrtimers is initialized with hrtimer_init(), and after that the timer's
> callback function is setup separately. This separate initialization is
> error prone and awkward to use.
>
> hrtimer_setup() combines the initialization and is simpler to use.
>
> Switch to use the new setup function. Most conversions were done with
> Coccinelle, see the sematic patch below.
>
> This series is intended to be applied to the tip tree
>
> v1 -> v2 https://lore.kernel.org/lkml/cover.1729865485.git.namcao@linutronix.de
>   - rebase onto v6.14-rc1

Link to v2 of part 1 is missing. It's also somehow not in my notmuch
datadase (looked for "hrtimers: Switch to new hrtimer interface
functions" -- took a guess based on v1) and is not googleable. It's kind
of important for reviewing this one. v1 did have the links to the other
parts, at least.

Anyway, sorry for being that guy, but can you fix this?

Thanks,
--
Alex
Re: [PATCH v2 00/45] Consolidate hrtimer initialization - Part 4
Posted by Thomas Gleixner 10 months, 1 week ago
On Thu, Feb 06 2025 at 11:56, Alexander Shishkin wrote:
> Nam Cao <namcao@linutronix.de> writes:
>
>> hrtimers is initialized with hrtimer_init(), and after that the timer's
>> callback function is setup separately. This separate initialization is
>> error prone and awkward to use.
>>
>> hrtimer_setup() combines the initialization and is simpler to use.
>>
>> Switch to use the new setup function. Most conversions were done with
>> Coccinelle, see the sematic patch below.
>>
>> This series is intended to be applied to the tip tree
>>
>> v1 -> v2 https://lore.kernel.org/lkml/cover.1729865485.git.namcao@linutronix.de
>>   - rebase onto v6.14-rc1
>
> Link to v2 of part 1 is missing. It's also somehow not in my notmuch
> datadase (looked for "hrtimers: Switch to new hrtimer interface
> functions" -- took a guess based on v1) and is not googleable. It's kind
> of important for reviewing this one. v1 did have the links to the other
> parts, at least.

It's archived and searchable on lore:

  https://lore.kernel.org/all/?q=hrtimers%3A+Consolidate+hrtimer+initialization+-+Part+1

and the third google result points to:

https://patchwork.kernel.org/project/linux-wireless/patch/20241031-hrtimer_setup_p1_v2-v2-0-23400656575a@linutronix.de/

That part 1 series has been applied and is in mainline already.

Thanks,

        tglx
Re: [PATCH v2 00/45] Consolidate hrtimer initialization - Part 4
Posted by Alexander Shishkin 10 months, 1 week ago
Thomas Gleixner <tglx@linutronix.de> writes:

> On Thu, Feb 06 2025 at 11:56, Alexander Shishkin wrote:
>> Nam Cao <namcao@linutronix.de> writes:
>>
>>> hrtimers is initialized with hrtimer_init(), and after that the timer's
>>> callback function is setup separately. This separate initialization is
>>> error prone and awkward to use.
>>>
>>> hrtimer_setup() combines the initialization and is simpler to use.
>>>
>>> Switch to use the new setup function. Most conversions were done with
>>> Coccinelle, see the sematic patch below.
>>>
>>> This series is intended to be applied to the tip tree
>>>
>>> v1 -> v2 https://lore.kernel.org/lkml/cover.1729865485.git.namcao@linutronix.de
>>>   - rebase onto v6.14-rc1
>>
>> Link to v2 of part 1 is missing. It's also somehow not in my notmuch
>> datadase (looked for "hrtimers: Switch to new hrtimer interface
>> functions" -- took a guess based on v1) and is not googleable. It's kind
>> of important for reviewing this one. v1 did have the links to the other
>> parts, at least.
>
> It's archived and searchable on lore:
>
>   https://lore.kernel.org/all/?q=hrtimers%3A+Consolidate+hrtimer+initialization+-+Part+1
>
> and the third google result points to:
>
> https://patchwork.kernel.org/project/linux-wireless/patch/20241031-hrtimer_setup_p1_v2-v2-0-23400656575a@linutronix.de/

In the only other version that I was CC'd on, Part 1's subject line was:
"hrtimers: Switch to new hrtimer interface functions", hence the
confusion.

> That part 1 series has been applied and is in mainline already.

Yes, I was grepping for the function that got removed. Low caffeine
level in the bloodstream or something.

But now that it's in mainline, I can pick up the patch intended for me
or just ack it. Any preferences?

Thanks,
--
Alex
Re: [PATCH v2 00/45] Consolidate hrtimer initialization - Part 4
Posted by Thomas Gleixner 10 months, 1 week ago
On Fri, Feb 07 2025 at 13:08, Alexander Shishkin wrote:
> Thomas Gleixner <tglx@linutronix.de> writes:
>> That part 1 series has been applied and is in mainline already.
>
> Yes, I was grepping for the function that got removed. Low caffeine
> level in the bloodstream or something.
>
> But now that it's in mainline, I can pick up the patch intended for me
> or just ack it. Any preferences?

Just pick it up through your tree. I'm only going to collect the
leftovers.

Thanks,

        tglx
Re: [PATCH v2 00/45] Consolidate hrtimer initialization - Part 4
Posted by Alexander Shishkin 10 months, 1 week ago
Thomas Gleixner <tglx@linutronix.de> writes:

> On Fri, Feb 07 2025 at 13:08, Alexander Shishkin wrote:
>> Thomas Gleixner <tglx@linutronix.de> writes:
>>> That part 1 series has been applied and is in mainline already.
>>
>> Yes, I was grepping for the function that got removed. Low caffeine
>> level in the bloodstream or something.
>>
>> But now that it's in mainline, I can pick up the patch intended for me
>> or just ack it. Any preferences?
>
> Just pick it up through your tree. I'm only going to collect the
> leftovers.

Wilco.

Thanks,
--
Alex