* [PATCH 01/44] USB: chipidea: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 02/44] usb: dwc2: " Nam Cao
` (46 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/chipidea/otg_fsm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c
index c17516c29b63..a093544482d5 100644
--- a/drivers/usb/chipidea/otg_fsm.c
+++ b/drivers/usb/chipidea/otg_fsm.c
@@ -424,8 +424,7 @@ static enum hrtimer_restart ci_otg_hrtimer_func(struct hrtimer *t)
/* Initialize timers */
static int ci_otg_init_timers(struct ci_hdrc *ci)
{
- hrtimer_init(&ci->otg_fsm_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- ci->otg_fsm_hrtimer.function = ci_otg_hrtimer_func;
+ hrtimer_setup(&ci->otg_fsm_hrtimer, ci_otg_hrtimer_func, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
return 0;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 02/44] usb: dwc2: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
2024-10-28 7:34 ` [PATCH 01/44] USB: chipidea: Switch to use hrtimer_setup() Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 03/44] usb: fotg210-hcd: " Nam Cao
` (45 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/dwc2/hcd_queue.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c
index 238c6fd50e75..2a542a99ec44 100644
--- a/drivers/usb/dwc2/hcd_queue.c
+++ b/drivers/usb/dwc2/hcd_queue.c
@@ -1459,8 +1459,7 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
/* Initialize QH */
qh->hsotg = hsotg;
timer_setup(&qh->unreserve_timer, dwc2_unreserve_timer_fn, 0);
- hrtimer_init(&qh->wait_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- qh->wait_timer.function = &dwc2_wait_timer_fn;
+ hrtimer_setup(&qh->wait_timer, &dwc2_wait_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
qh->ep_type = ep_type;
qh->ep_is_in = ep_is_in;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 03/44] usb: fotg210-hcd: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
2024-10-28 7:34 ` [PATCH 01/44] USB: chipidea: Switch to use hrtimer_setup() Nam Cao
2024-10-28 7:34 ` [PATCH 02/44] usb: dwc2: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 04/44] usb: gadget: " Nam Cao
` (44 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/fotg210/fotg210-hcd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/fotg210/fotg210-hcd.c b/drivers/usb/fotg210/fotg210-hcd.c
index 8c5aaf860635..36d4d5ab7a89 100644
--- a/drivers/usb/fotg210/fotg210-hcd.c
+++ b/drivers/usb/fotg210/fotg210-hcd.c
@@ -4901,8 +4901,7 @@ static int hcd_fotg210_init(struct usb_hcd *hcd)
*/
fotg210->need_io_watchdog = 1;
- hrtimer_init(&fotg210->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- fotg210->hrtimer.function = fotg210_hrtimer_func;
+ hrtimer_setup(&fotg210->hrtimer, fotg210_hrtimer_func, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
fotg210->next_hrtimer_event = FOTG210_HRTIMER_NO_EVENT;
hcc_params = fotg210_readl(fotg210, &fotg210->caps->hcc_params);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 04/44] usb: gadget: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (2 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 03/44] usb: fotg210-hcd: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 05/44] usb: ehci: " Nam Cao
` (43 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/function/f_ncm.c | 3 +--
drivers/usb/gadget/udc/dummy_hcd.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index 8e761249d672..dcdb6246e542 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -1558,8 +1558,7 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
ncm->port.open = ncm_open;
ncm->port.close = ncm_close;
- hrtimer_init(&ncm->task_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
- ncm->task_timer.function = ncm_tx_timeout;
+ hrtimer_setup(&ncm->task_timer, ncm_tx_timeout, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
DBG(cdev, "CDC Network: IN/%s OUT/%s NOTIFY/%s\n",
ncm->port.in_ep->name, ncm->port.out_ep->name,
diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
index ff7bee78bcc4..bae07e87f37f 100644
--- a/drivers/usb/gadget/udc/dummy_hcd.c
+++ b/drivers/usb/gadget/udc/dummy_hcd.c
@@ -2469,8 +2469,7 @@ static DEVICE_ATTR_RO(urbs);
static int dummy_start_ss(struct dummy_hcd *dum_hcd)
{
- hrtimer_init(&dum_hcd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
- dum_hcd->timer.function = dummy_timer;
+ hrtimer_setup(&dum_hcd->timer, dummy_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
dum_hcd->rh_state = DUMMY_RH_RUNNING;
dum_hcd->stream_en_ep = 0;
INIT_LIST_HEAD(&dum_hcd->urbp_list);
@@ -2499,8 +2498,7 @@ static int dummy_start(struct usb_hcd *hcd)
return dummy_start_ss(dum_hcd);
spin_lock_init(&dum_hcd->dum->lock);
- hrtimer_init(&dum_hcd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
- dum_hcd->timer.function = dummy_timer;
+ hrtimer_setup(&dum_hcd->timer, dummy_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
dum_hcd->rh_state = DUMMY_RH_RUNNING;
INIT_LIST_HEAD(&dum_hcd->urbp_list);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 05/44] usb: ehci: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (3 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 04/44] usb: gadget: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 06/44] usb: musb: cppi41: " Nam Cao
` (42 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/ehci-hcd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 802bfafb1012..127699aa482a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -466,8 +466,7 @@ static int ehci_init(struct usb_hcd *hcd)
*/
ehci->need_io_watchdog = 1;
- hrtimer_init(&ehci->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- ehci->hrtimer.function = ehci_hrtimer_func;
+ hrtimer_setup(&ehci->hrtimer, ehci_hrtimer_func, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
ehci->next_hrtimer_event = EHCI_HRTIMER_NO_EVENT;
hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 06/44] usb: musb: cppi41: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (4 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 05/44] usb: ehci: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 07/44] usb: typec: tcpm: " Nam Cao
` (41 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/musb/musb_cppi41.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c
index 9589243e8951..4cde3abb7006 100644
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -760,8 +760,8 @@ cppi41_dma_controller_create(struct musb *musb, void __iomem *base)
if (!controller)
goto kzalloc_fail;
- hrtimer_init(&controller->early_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- controller->early_tx.function = cppi41_recheck_tx_req;
+ hrtimer_setup(&controller->early_tx, cppi41_recheck_tx_req, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
INIT_LIST_HEAD(&controller->early_tx_list);
controller->controller.channel_alloc = cppi41_dma_channel_allocate;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 07/44] usb: typec: tcpm: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (5 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 06/44] usb: musb: cppi41: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 08/44] serial: 8250: " Nam Cao
` (40 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/typec/tcpm/tcpm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index fc619478200f..48ae73033972 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -7587,14 +7587,14 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
kthread_init_work(&port->event_work, tcpm_pd_event_handler);
kthread_init_work(&port->enable_frs, tcpm_enable_frs_work);
kthread_init_work(&port->send_discover_work, tcpm_send_discover_work);
- hrtimer_init(&port->state_machine_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- port->state_machine_timer.function = state_machine_timer_handler;
- hrtimer_init(&port->vdm_state_machine_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- port->vdm_state_machine_timer.function = vdm_state_machine_timer_handler;
- hrtimer_init(&port->enable_frs_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- port->enable_frs_timer.function = enable_frs_timer_handler;
- hrtimer_init(&port->send_discover_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- port->send_discover_timer.function = send_discover_timer_handler;
+ hrtimer_setup(&port->state_machine_timer, state_machine_timer_handler, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
+ hrtimer_setup(&port->vdm_state_machine_timer, vdm_state_machine_timer_handler,
+ CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ hrtimer_setup(&port->enable_frs_timer, enable_frs_timer_handler, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
+ hrtimer_setup(&port->send_discover_timer, send_discover_timer_handler, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
spin_lock_init(&port->pd_event_lock);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 08/44] serial: 8250: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (6 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 07/44] usb: typec: tcpm: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 09/44] serial: imx: " Nam Cao
` (39 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_bcm7271.c | 3 +--
drivers/tty/serial/8250/8250_port.c | 10 ++++------
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
index 2569ca69223f..766bbdb36d19 100644
--- a/drivers/tty/serial/8250/8250_bcm7271.c
+++ b/drivers/tty/serial/8250/8250_bcm7271.c
@@ -1056,8 +1056,7 @@ static int brcmuart_probe(struct platform_device *pdev)
}
/* setup HR timer */
- hrtimer_init(&priv->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- priv->hrt.function = brcmuart_hrtimer_func;
+ hrtimer_setup(&priv->hrt, brcmuart_hrtimer_func, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
up.port.shutdown = brcmuart_shutdown;
up.port.startup = brcmuart_startup;
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 3509af7dc52b..36820eed535a 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -546,12 +546,10 @@ static int serial8250_em485_init(struct uart_8250_port *p)
if (!p->em485)
return -ENOMEM;
- hrtimer_init(&p->em485->stop_tx_timer, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL);
- hrtimer_init(&p->em485->start_tx_timer, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL);
- p->em485->stop_tx_timer.function = &serial8250_em485_handle_stop_tx;
- p->em485->start_tx_timer.function = &serial8250_em485_handle_start_tx;
+ hrtimer_setup(&p->em485->stop_tx_timer, &serial8250_em485_handle_stop_tx, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
+ hrtimer_setup(&p->em485->start_tx_timer, &serial8250_em485_handle_start_tx, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
p->em485->port = p;
p->em485->active_timer = NULL;
p->em485->tx_stopped = true;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 09/44] serial: imx: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (7 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 08/44] serial: 8250: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 10/44] serial: sh-sci: " Nam Cao
` (38 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/imx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 67d4a72eda77..753325b6d125 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2475,10 +2475,10 @@ static int imx_uart_probe(struct platform_device *pdev)
imx_uart_writel(sport, ucr3, UCR3);
}
- hrtimer_init(&sport->trigger_start_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- hrtimer_init(&sport->trigger_stop_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- sport->trigger_start_tx.function = imx_trigger_start_tx;
- sport->trigger_stop_tx.function = imx_trigger_stop_tx;
+ hrtimer_setup(&sport->trigger_start_tx, imx_trigger_start_tx, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
+ hrtimer_setup(&sport->trigger_stop_tx, imx_trigger_stop_tx, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
/*
* Allocate the IRQ(s) i.MX1 has three interrupts whereas later
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 10/44] serial: sh-sci: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (8 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 09/44] serial: imx: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 11/44] serial: xilinx_uartps: " Nam Cao
` (37 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/sh-sci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index b80e9a528e17..42e9722c2c82 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1695,8 +1695,7 @@ static void sci_request_dma(struct uart_port *port)
dma += s->buf_len_rx;
}
- hrtimer_init(&s->rx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- s->rx_timer.function = sci_dma_rx_timer_fn;
+ hrtimer_setup(&s->rx_timer, sci_dma_rx_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
s->chan_rx_saved = s->chan_rx = chan;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 11/44] serial: xilinx_uartps: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (9 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 10/44] serial: sh-sci: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 12/44] scsi: " Nam Cao
` (36 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/xilinx_uartps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 777392914819..4e9a63590c82 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1628,8 +1628,8 @@ static int cdns_rs485_config(struct uart_port *port, struct ktermios *termios,
writel(val, port->membase + CDNS_UART_MODEMCR);
/* Timer setup */
- hrtimer_init(&cdns_uart->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- cdns_uart->tx_timer.function = &cdns_rs485_tx_callback;
+ hrtimer_setup(&cdns_uart->tx_timer, &cdns_rs485_tx_callback, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
/* Disable transmitter and make Rx setup*/
cdns_uart_stop_tx(port);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 12/44] scsi: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (10 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 11/44] serial: xilinx_uartps: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 13/44] rtc: class: " Nam Cao
` (35 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Martin K. Petersen
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
---
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 4 +---
drivers/scsi/lpfc/lpfc_init.c | 7 +++----
drivers/scsi/scsi_debug.c | 4 ++--
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index 16d085d56e9d..9e42230e42b8 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -2922,9 +2922,7 @@ static long ibmvscsis_alloctimer(struct scsi_info *vscsi)
struct timer_cb *p_timer;
p_timer = &vscsi->rsp_q_timer;
- hrtimer_init(&p_timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-
- p_timer->timer.function = ibmvscsis_service_wait_q;
+ hrtimer_setup(&p_timer->timer, ibmvscsis_service_wait_q, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
p_timer->started = false;
p_timer->timer_pops = 0;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 0dd451009b07..5dc9f47af1f2 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -7969,11 +7969,10 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
timer_setup(&phba->fcf.redisc_wait, lpfc_sli4_fcf_redisc_wait_tmo, 0);
/* CMF congestion timer */
- hrtimer_init(&phba->cmf_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- phba->cmf_timer.function = lpfc_cmf_timer;
+ hrtimer_setup(&phba->cmf_timer, lpfc_cmf_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
/* CMF 1 minute stats collection timer */
- hrtimer_init(&phba->cmf_stats_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- phba->cmf_stats_timer.function = lpfc_cmf_stats_timer;
+ hrtimer_setup(&phba->cmf_stats_timer, lpfc_cmf_stats_timer, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
/*
* Control structure for handling external multi-buffer mailbox
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index d95f417e24c0..6ddd2f83003d 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -6385,8 +6385,8 @@ static struct sdebug_queued_cmd *sdebug_alloc_queued_cmd(struct scsi_cmnd *scmd)
sd_dp = &sqcp->sd_dp;
- hrtimer_init(&sd_dp->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
- sd_dp->hrt.function = sdebug_q_cmd_hrt_complete;
+ hrtimer_setup(&sd_dp->hrt, sdebug_q_cmd_hrt_complete, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL_PINNED);
INIT_WORK(&sd_dp->ew.work, sdebug_q_cmd_wq_complete);
sqcp->scmd = scmd;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 13/44] rtc: class: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (11 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 12/44] scsi: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 14/44] pps: generators: pps_gen_parport: " Nam Cao
` (34 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Alexandre Belloni
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/class.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index e31fa0ad127e..b88cd4fb295b 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -240,8 +240,7 @@ static struct rtc_device *rtc_allocate_device(void)
/* Init uie timer */
rtc_timer_init(&rtc->uie_rtctimer, rtc_uie_update_irq, rtc);
/* Init pie timer */
- hrtimer_init(&rtc->pie_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- rtc->pie_timer.function = rtc_pie_update_irq;
+ hrtimer_setup(&rtc->pie_timer, rtc_pie_update_irq, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
rtc->pie_enabled = 0;
set_bit(RTC_FEATURE_ALARM, rtc->features);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 14/44] pps: generators: pps_gen_parport: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (12 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 13/44] rtc: class: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 15/44] powercap: " Nam Cao
` (33 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pps/generators/pps_gen_parport.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c
index d46eed159495..f5eeb4dd01ad 100644
--- a/drivers/pps/generators/pps_gen_parport.c
+++ b/drivers/pps/generators/pps_gen_parport.c
@@ -208,8 +208,7 @@ static void parport_attach(struct parport *port)
calibrate_port(&device);
- hrtimer_init(&device.timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
- device.timer.function = hrtimer_event;
+ hrtimer_setup(&device.timer, hrtimer_event, CLOCK_REALTIME, HRTIMER_MODE_ABS);
hrtimer_start(&device.timer, next_intr_time(&device), HRTIMER_MODE_ABS);
return;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 15/44] powercap: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (13 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 14/44] pps: generators: pps_gen_parport: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 11:44 ` Rafael J. Wysocki
2024-10-28 7:34 ` [PATCH 16/44] power: supply: ab8500_chargalg: " Nam Cao
` (32 subsequent siblings)
47 siblings, 1 reply; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Rafael J. Wysocki
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
---
drivers/powercap/idle_inject.c | 3 +--
drivers/powercap/intel_rapl_common.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/powercap/idle_inject.c b/drivers/powercap/idle_inject.c
index bafc59904ed3..29f9f452d445 100644
--- a/drivers/powercap/idle_inject.c
+++ b/drivers/powercap/idle_inject.c
@@ -339,8 +339,7 @@ struct idle_inject_device *idle_inject_register_full(struct cpumask *cpumask,
return NULL;
cpumask_copy(to_cpumask(ii_dev->cpumask), cpumask);
- hrtimer_init(&ii_dev->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- ii_dev->timer.function = idle_inject_timer_fn;
+ hrtimer_setup(&ii_dev->timer, idle_inject_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
ii_dev->latency_us = UINT_MAX;
ii_dev->update = update;
diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
index 5e793b80fd6b..e675d4240d9f 100644
--- a/drivers/powercap/intel_rapl_common.c
+++ b/drivers/powercap/intel_rapl_common.c
@@ -2063,8 +2063,7 @@ int rapl_package_add_pmu(struct rapl_package *rp)
raw_spin_lock_init(&data->lock);
INIT_LIST_HEAD(&data->active_list);
data->timer_interval = ms_to_ktime(rapl_pmu.timer_ms);
- hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- data->hrtimer.function = rapl_hrtimer_handle;
+ hrtimer_setup(&data->hrtimer, rapl_hrtimer_handle, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
return rapl_pmu_update(rp);
}
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* Re: [PATCH 15/44] powercap: Switch to use hrtimer_setup()
2024-10-28 7:34 ` [PATCH 15/44] powercap: " Nam Cao
@ 2024-10-28 11:44 ` Rafael J. Wysocki
0 siblings, 0 replies; 55+ messages in thread
From: Rafael J. Wysocki @ 2024-10-28 11:44 UTC (permalink / raw)
To: Nam Cao
Cc: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel, Rafael J. Wysocki
On Mon, Oct 28, 2024 at 8:35 AM Nam Cao <namcao@linutronix.de> wrote:
>
> There is a newly introduced hrtimer_setup() which will replace
> hrtimer_init(). This new function is similar to the old one, except that it
> also sanity-checks and initializes the timer's callback function.
>
> Switch to use this new function.
>
> Patch was created by using Coccinelle.
>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> ---
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Fine by me.
Acked-by: "Rafael J. Wysocki" <rafael@kernel.org>
> ---
> drivers/powercap/idle_inject.c | 3 +--
> drivers/powercap/intel_rapl_common.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/powercap/idle_inject.c b/drivers/powercap/idle_inject.c
> index bafc59904ed3..29f9f452d445 100644
> --- a/drivers/powercap/idle_inject.c
> +++ b/drivers/powercap/idle_inject.c
> @@ -339,8 +339,7 @@ struct idle_inject_device *idle_inject_register_full(struct cpumask *cpumask,
> return NULL;
>
> cpumask_copy(to_cpumask(ii_dev->cpumask), cpumask);
> - hrtimer_init(&ii_dev->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - ii_dev->timer.function = idle_inject_timer_fn;
> + hrtimer_setup(&ii_dev->timer, idle_inject_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> ii_dev->latency_us = UINT_MAX;
> ii_dev->update = update;
>
> diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
> index 5e793b80fd6b..e675d4240d9f 100644
> --- a/drivers/powercap/intel_rapl_common.c
> +++ b/drivers/powercap/intel_rapl_common.c
> @@ -2063,8 +2063,7 @@ int rapl_package_add_pmu(struct rapl_package *rp)
> raw_spin_lock_init(&data->lock);
> INIT_LIST_HEAD(&data->active_list);
> data->timer_interval = ms_to_ktime(rapl_pmu.timer_ms);
> - hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - data->hrtimer.function = rapl_hrtimer_handle;
> + hrtimer_setup(&data->hrtimer, rapl_hrtimer_handle, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>
> return rapl_pmu_update(rp);
> }
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 16/44] power: supply: ab8500_chargalg: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (14 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 15/44] powercap: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 12:48 ` Linus Walleij
2024-10-28 7:34 ` [PATCH 17/44] power: reset: ltc2952-poweroff: " Nam Cao
` (31 subsequent siblings)
47 siblings, 1 reply; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Linus Walleij
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Linus Walleij <linus.walleij@linaro.org>
---
drivers/power/supply/ab8500_chargalg.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
index 854491ad3ecd..56afd5d1f8c3 100644
--- a/drivers/power/supply/ab8500_chargalg.c
+++ b/drivers/power/supply/ab8500_chargalg.c
@@ -1788,13 +1788,12 @@ static int ab8500_chargalg_probe(struct platform_device *pdev)
psy_cfg.drv_data = di;
/* Initilialize safety timer */
- hrtimer_init(&di->safety_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- di->safety_timer.function = ab8500_chargalg_safety_timer_expired;
+ hrtimer_setup(&di->safety_timer, ab8500_chargalg_safety_timer_expired, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
/* Initilialize maintenance timer */
- hrtimer_init(&di->maintenance_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- di->maintenance_timer.function =
- ab8500_chargalg_maintenance_timer_expired;
+ hrtimer_setup(&di->maintenance_timer, ab8500_chargalg_maintenance_timer_expired,
+ CLOCK_MONOTONIC, HRTIMER_MODE_REL);
/* Init work for chargalg */
INIT_DEFERRABLE_WORK(&di->chargalg_periodic_work,
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* Re: [PATCH 16/44] power: supply: ab8500_chargalg: Switch to use hrtimer_setup()
2024-10-28 7:34 ` [PATCH 16/44] power: supply: ab8500_chargalg: " Nam Cao
@ 2024-10-28 12:48 ` Linus Walleij
0 siblings, 0 replies; 55+ messages in thread
From: Linus Walleij @ 2024-10-28 12:48 UTC (permalink / raw)
To: Nam Cao
Cc: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
On Mon, Oct 28, 2024 at 8:35 AM Nam Cao <namcao@linutronix.de> wrote:
> There is a newly introduced hrtimer_setup() which will replace
> hrtimer_init(). This new function is similar to the old one, except that it
> also sanity-checks and initializes the timer's callback function.
>
> Switch to use this new function.
>
> Patch was created by using Coccinelle.
>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 17/44] power: reset: ltc2952-poweroff: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (15 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 16/44] power: supply: ab8500_chargalg: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 18/44] drivers: perf: " Nam Cao
` (30 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Sebastian Reichel
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Sebastian Reichel <sre@kernel.org>
---
drivers/power/reset/ltc2952-poweroff.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c
index fa25fbd53934..f87ce4686d4f 100644
--- a/drivers/power/reset/ltc2952-poweroff.c
+++ b/drivers/power/reset/ltc2952-poweroff.c
@@ -162,11 +162,11 @@ static void ltc2952_poweroff_default(struct ltc2952_poweroff *data)
data->wde_interval = 300L * NSEC_PER_MSEC;
data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC);
- hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- data->timer_trigger.function = ltc2952_poweroff_timer_trigger;
+ hrtimer_setup(&data->timer_trigger, ltc2952_poweroff_timer_trigger, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
- hrtimer_init(&data->timer_wde, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- data->timer_wde.function = ltc2952_poweroff_timer_wde;
+ hrtimer_setup(&data->timer_wde, ltc2952_poweroff_timer_wde, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
}
static int ltc2952_poweroff_init(struct platform_device *pdev)
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 18/44] drivers: perf: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (16 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 17/44] power: reset: ltc2952-poweroff: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 19/44] ntb: ntb_pingpong: " Nam Cao
` (29 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Will Deacon
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Will Deacon <will@kernel.org>
---
drivers/perf/arm-ccn.c | 5 ++---
drivers/perf/marvell_cn10k_ddr_pmu.c | 4 ++--
drivers/perf/thunderx2_pmu.c | 5 ++---
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
index 5c66b9278862..716c14da5564 100644
--- a/drivers/perf/arm-ccn.c
+++ b/drivers/perf/arm-ccn.c
@@ -1273,9 +1273,8 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
/* No overflow interrupt? Have to use a timer instead. */
if (!ccn->irq) {
dev_info(ccn->dev, "No access to interrupts, using timer.\n");
- hrtimer_init(&ccn->dt.hrtimer, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL);
- ccn->dt.hrtimer.function = arm_ccn_pmu_timer_handler;
+ hrtimer_setup(&ccn->dt.hrtimer, arm_ccn_pmu_timer_handler, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
}
/* Pick one CPU which we will use to collect data from CCN... */
diff --git a/drivers/perf/marvell_cn10k_ddr_pmu.c b/drivers/perf/marvell_cn10k_ddr_pmu.c
index 94f1ebcd2a27..12ee0971b6ee 100644
--- a/drivers/perf/marvell_cn10k_ddr_pmu.c
+++ b/drivers/perf/marvell_cn10k_ddr_pmu.c
@@ -677,8 +677,8 @@ static int cn10k_ddr_perf_probe(struct platform_device *pdev)
if (!name)
return -ENOMEM;
- hrtimer_init(&ddr_pmu->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- ddr_pmu->hrtimer.function = cn10k_ddr_pmu_timer_handler;
+ hrtimer_setup(&ddr_pmu->hrtimer, cn10k_ddr_pmu_timer_handler, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
cpuhp_state_add_instance_nocalls(
CPUHP_AP_PERF_ARM_MARVELL_CN10K_DDR_ONLINE,
diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c
index faf763d2c95c..769a088c8747 100644
--- a/drivers/perf/thunderx2_pmu.c
+++ b/drivers/perf/thunderx2_pmu.c
@@ -752,9 +752,8 @@ static int tx2_uncore_pmu_add_dev(struct tx2_uncore_pmu *tx2_pmu)
tx2_pmu->cpu = cpu;
if (tx2_pmu->hrtimer_callback) {
- hrtimer_init(&tx2_pmu->hrtimer,
- CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- tx2_pmu->hrtimer.function = tx2_pmu->hrtimer_callback;
+ hrtimer_setup(&tx2_pmu->hrtimer, tx2_pmu->hrtimer_callback, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
}
ret = tx2_uncore_pmu_register(tx2_pmu);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 19/44] ntb: ntb_pingpong: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (17 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 18/44] drivers: perf: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 20/44] mmc: dw_mmc: " Nam Cao
` (28 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jon Mason
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jon Mason <jdmason@kudzu.us>
---
drivers/ntb/test/ntb_pingpong.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/ntb/test/ntb_pingpong.c b/drivers/ntb/test/ntb_pingpong.c
index 8aeca7914050..1c1c74f4ff2d 100644
--- a/drivers/ntb/test/ntb_pingpong.c
+++ b/drivers/ntb/test/ntb_pingpong.c
@@ -284,8 +284,7 @@ static struct pp_ctx *pp_create_data(struct ntb_dev *ntb)
pp->ntb = ntb;
atomic_set(&pp->count, 0);
spin_lock_init(&pp->lock);
- hrtimer_init(&pp->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- pp->timer.function = pp_timer_func;
+ hrtimer_setup(&pp->timer, pp_timer_func, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
return pp;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 20/44] mmc: dw_mmc: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (18 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 19/44] ntb: ntb_pingpong: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 21/44] misc: vcpu_stall_detector: " Nam Cao
` (27 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jaehoon Chung
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/mmc/host/dw_mmc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 41e451235f63..3a15af97e4e1 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1875,8 +1875,7 @@ static void dw_mci_init_fault(struct dw_mci *host)
{
host->fail_data_crc = (struct fault_attr) FAULT_ATTR_INITIALIZER;
- hrtimer_init(&host->fault_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- host->fault_timer.function = dw_mci_fault_timer;
+ hrtimer_setup(&host->fault_timer, dw_mci_fault_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
}
#else
static void dw_mci_init_fault(struct dw_mci *host)
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 21/44] misc: vcpu_stall_detector: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (19 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 20/44] mmc: dw_mmc: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:34 ` [PATCH 22/44] media: " Nam Cao
` (26 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/vcpu_stall_detector.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/misc/vcpu_stall_detector.c b/drivers/misc/vcpu_stall_detector.c
index 41b8c2119e20..dea5f8290895 100644
--- a/drivers/misc/vcpu_stall_detector.c
+++ b/drivers/misc/vcpu_stall_detector.c
@@ -111,8 +111,7 @@ static int start_stall_detector_cpu(unsigned int cpu)
ping_timeout_ms = vcpu_stall_config.stall_timeout_sec *
MSEC_PER_SEC / 2;
- hrtimer_init(vcpu_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- vcpu_hrtimer->function = vcpu_stall_detect_timer_fn;
+ hrtimer_setup(vcpu_hrtimer, vcpu_stall_detect_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
vcpu_stall_detector->is_initialized = true;
hrtimer_start(vcpu_hrtimer, ms_to_ktime(ping_timeout_ms),
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 22/44] media: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (20 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 21/44] misc: vcpu_stall_detector: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 8:00 ` Hans Verkuil
2024-10-28 7:34 ` [PATCH 23/44] mailbox: " Nam Cao
` (25 subsequent siblings)
47 siblings, 1 reply; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Hans Verkuil
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
drivers/media/cec/core/cec-pin.c | 3 +--
drivers/media/pci/cx88/cx88-input.c | 3 +--
drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++--
drivers/media/rc/pwm-ir-tx.c | 3 +--
4 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/media/cec/core/cec-pin.c b/drivers/media/cec/core/cec-pin.c
index 330d5d5d86ab..fe1cf365a25c 100644
--- a/drivers/media/cec/core/cec-pin.c
+++ b/drivers/media/cec/core/cec-pin.c
@@ -1345,9 +1345,8 @@ struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops,
if (pin == NULL)
return ERR_PTR(-ENOMEM);
pin->ops = pin_ops;
- hrtimer_init(&pin->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
atomic_set(&pin->work_pin_num_events, 0);
- pin->timer.function = cec_pin_timer;
+ hrtimer_setup(&pin->timer, cec_pin_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
init_waitqueue_head(&pin->kthread_waitq);
pin->tx_custom_low_usecs = CEC_TIM_CUSTOM_DEFAULT;
pin->tx_custom_high_usecs = CEC_TIM_CUSTOM_DEFAULT;
diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c
index a04a1d33fadb..b9f2c14d62b4 100644
--- a/drivers/media/pci/cx88/cx88-input.c
+++ b/drivers/media/pci/cx88/cx88-input.c
@@ -190,8 +190,7 @@ static int __cx88_ir_start(void *priv)
ir = core->ir;
if (ir->polling) {
- hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- ir->timer.function = cx88_ir_work;
+ hrtimer_setup(&ir->timer, cx88_ir_work, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtimer_start(&ir->timer,
ktime_set(0, ir->polling * 1000000),
HRTIMER_MODE_REL);
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index 7273254ecb03..d7795d7f8a35 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -229,8 +229,8 @@ static int wave5_vpu_probe(struct platform_device *pdev)
dev->irq = platform_get_irq(pdev, 0);
if (dev->irq < 0) {
dev_err(&pdev->dev, "failed to get irq resource, falling back to polling\n");
- hrtimer_init(&dev->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
- dev->hrtimer.function = &wave5_vpu_timer_callback;
+ hrtimer_setup(&dev->hrtimer, &wave5_vpu_timer_callback, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL_PINNED);
dev->worker = kthread_create_worker(0, "vpu_irq_thread");
if (IS_ERR(dev->worker)) {
dev_err(&pdev->dev, "failed to create vpu irq worker\n");
diff --git a/drivers/media/rc/pwm-ir-tx.c b/drivers/media/rc/pwm-ir-tx.c
index fe368aebbc13..84533fdd61aa 100644
--- a/drivers/media/rc/pwm-ir-tx.c
+++ b/drivers/media/rc/pwm-ir-tx.c
@@ -172,8 +172,7 @@ static int pwm_ir_probe(struct platform_device *pdev)
rcdev->tx_ir = pwm_ir_tx_sleep;
} else {
init_completion(&pwm_ir->tx_done);
- hrtimer_init(&pwm_ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- pwm_ir->timer.function = pwm_ir_timer;
+ hrtimer_setup(&pwm_ir->timer, pwm_ir_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
rcdev->tx_ir = pwm_ir_tx_atomic;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* Re: [PATCH 22/44] media: Switch to use hrtimer_setup()
2024-10-28 7:34 ` [PATCH 22/44] media: " Nam Cao
@ 2024-10-28 8:00 ` Hans Verkuil
0 siblings, 0 replies; 55+ messages in thread
From: Hans Verkuil @ 2024-10-28 8:00 UTC (permalink / raw)
To: Nam Cao, Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
On 28/10/2024 08:34, Nam Cao wrote:
> There is a newly introduced hrtimer_setup() which will replace
> hrtimer_init(). This new function is similar to the old one, except that it
> also sanity-checks and initializes the timer's callback function.
>
> Switch to use this new function.
>
> Patch was created by using Coccinelle.
>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Regards,
Hans
> ---
> Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> drivers/media/cec/core/cec-pin.c | 3 +--
> drivers/media/pci/cx88/cx88-input.c | 3 +--
> drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++--
> drivers/media/rc/pwm-ir-tx.c | 3 +--
> 4 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/cec/core/cec-pin.c b/drivers/media/cec/core/cec-pin.c
> index 330d5d5d86ab..fe1cf365a25c 100644
> --- a/drivers/media/cec/core/cec-pin.c
> +++ b/drivers/media/cec/core/cec-pin.c
> @@ -1345,9 +1345,8 @@ struct cec_adapter *cec_pin_allocate_adapter(const struct cec_pin_ops *pin_ops,
> if (pin == NULL)
> return ERR_PTR(-ENOMEM);
> pin->ops = pin_ops;
> - hrtimer_init(&pin->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> atomic_set(&pin->work_pin_num_events, 0);
> - pin->timer.function = cec_pin_timer;
> + hrtimer_setup(&pin->timer, cec_pin_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> init_waitqueue_head(&pin->kthread_waitq);
> pin->tx_custom_low_usecs = CEC_TIM_CUSTOM_DEFAULT;
> pin->tx_custom_high_usecs = CEC_TIM_CUSTOM_DEFAULT;
> diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c
> index a04a1d33fadb..b9f2c14d62b4 100644
> --- a/drivers/media/pci/cx88/cx88-input.c
> +++ b/drivers/media/pci/cx88/cx88-input.c
> @@ -190,8 +190,7 @@ static int __cx88_ir_start(void *priv)
> ir = core->ir;
>
> if (ir->polling) {
> - hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - ir->timer.function = cx88_ir_work;
> + hrtimer_setup(&ir->timer, cx88_ir_work, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> hrtimer_start(&ir->timer,
> ktime_set(0, ir->polling * 1000000),
> HRTIMER_MODE_REL);
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> index 7273254ecb03..d7795d7f8a35 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> @@ -229,8 +229,8 @@ static int wave5_vpu_probe(struct platform_device *pdev)
> dev->irq = platform_get_irq(pdev, 0);
> if (dev->irq < 0) {
> dev_err(&pdev->dev, "failed to get irq resource, falling back to polling\n");
> - hrtimer_init(&dev->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
> - dev->hrtimer.function = &wave5_vpu_timer_callback;
> + hrtimer_setup(&dev->hrtimer, &wave5_vpu_timer_callback, CLOCK_MONOTONIC,
> + HRTIMER_MODE_REL_PINNED);
> dev->worker = kthread_create_worker(0, "vpu_irq_thread");
> if (IS_ERR(dev->worker)) {
> dev_err(&pdev->dev, "failed to create vpu irq worker\n");
> diff --git a/drivers/media/rc/pwm-ir-tx.c b/drivers/media/rc/pwm-ir-tx.c
> index fe368aebbc13..84533fdd61aa 100644
> --- a/drivers/media/rc/pwm-ir-tx.c
> +++ b/drivers/media/rc/pwm-ir-tx.c
> @@ -172,8 +172,7 @@ static int pwm_ir_probe(struct platform_device *pdev)
> rcdev->tx_ir = pwm_ir_tx_sleep;
> } else {
> init_completion(&pwm_ir->tx_done);
> - hrtimer_init(&pwm_ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> - pwm_ir->timer.function = pwm_ir_timer;
> + hrtimer_setup(&pwm_ir->timer, pwm_ir_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> rcdev->tx_ir = pwm_ir_tx_atomic;
> }
>
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 23/44] mailbox: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (21 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 22/44] media: " Nam Cao
@ 2024-10-28 7:34 ` Nam Cao
2024-10-28 7:35 ` [PATCH 24/44] leds: trigger: pattern: " Nam Cao
` (24 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:34 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jassi Brar
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jassi Brar <jassisinghbrar@gmail.com>
---
drivers/mailbox/mailbox.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index d3d26a2c9895..118beaf447aa 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -534,9 +534,7 @@ int mbox_controller_register(struct mbox_controller *mbox)
return -EINVAL;
}
- hrtimer_init(&mbox->poll_hrt, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL);
- mbox->poll_hrt.function = txdone_hrtimer;
+ hrtimer_setup(&mbox->poll_hrt, txdone_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
spin_lock_init(&mbox->poll_hrt_lock);
}
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 24/44] leds: trigger: pattern: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (22 preceding siblings ...)
2024-10-28 7:34 ` [PATCH 23/44] mailbox: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 25/44] Input: " Nam Cao
` (23 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Pavel Machek
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Pavel Machek <pavel@ucw.cz>
---
drivers/leds/trigger/ledtrig-pattern.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/trigger/ledtrig-pattern.c b/drivers/leds/trigger/ledtrig-pattern.c
index aad48c2540fc..a594bd5e2233 100644
--- a/drivers/leds/trigger/ledtrig-pattern.c
+++ b/drivers/leds/trigger/ledtrig-pattern.c
@@ -483,8 +483,8 @@ static int pattern_trig_activate(struct led_classdev *led_cdev)
data->led_cdev = led_cdev;
led_set_trigger_data(led_cdev, data);
timer_setup(&data->timer, pattern_trig_timer_function, 0);
- hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- data->hrtimer.function = pattern_trig_hrtimer_function;
+ hrtimer_setup(&data->hrtimer, pattern_trig_hrtimer_function, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
led_cdev->activated = true;
if (led_cdev->flags & LED_INIT_DEFAULT_TRIGGER) {
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 25/44] Input: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (23 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 24/44] leds: trigger: pattern: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 26/44] iio: " Nam Cao
` (22 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Dmitry Torokhov
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/joystick/walkera0701.c | 3 +--
drivers/input/keyboard/gpio_keys.c | 10 ++++------
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/input/joystick/walkera0701.c b/drivers/input/joystick/walkera0701.c
index 59eea813f258..15370fb82317 100644
--- a/drivers/input/joystick/walkera0701.c
+++ b/drivers/input/joystick/walkera0701.c
@@ -232,8 +232,7 @@ static void walkera0701_attach(struct parport *pp)
goto err_unregister_device;
}
- hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- w->timer.function = timer_handler;
+ hrtimer_setup(&w->timer, timer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
w->input_dev = input_allocate_device();
if (!w->input_dev) {
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 380fe8dab3b0..224cfd0062a1 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -592,9 +592,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func);
- hrtimer_init(&bdata->debounce_timer,
- CLOCK_REALTIME, HRTIMER_MODE_REL);
- bdata->debounce_timer.function = gpio_keys_debounce_timer;
+ hrtimer_setup(&bdata->debounce_timer, gpio_keys_debounce_timer, CLOCK_REALTIME,
+ HRTIMER_MODE_REL);
isr = gpio_keys_gpio_isr;
irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
@@ -630,9 +629,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
}
bdata->release_delay = button->debounce_interval;
- hrtimer_init(&bdata->release_timer,
- CLOCK_REALTIME, HRTIMER_MODE_REL_HARD);
- bdata->release_timer.function = gpio_keys_irq_timer;
+ hrtimer_setup(&bdata->release_timer, gpio_keys_irq_timer, CLOCK_REALTIME,
+ HRTIMER_MODE_REL_HARD);
isr = gpio_keys_irq_isr;
irqflags = 0;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 26/44] iio: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (24 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 25/44] Input: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-11-02 16:00 ` Jonathan Cameron
2024-10-28 7:35 ` [PATCH 27/44] i2c: " Nam Cao
` (21 subsequent siblings)
47 siblings, 1 reply; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jonathan Cameron
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jonathan Cameron <jic23@kernel.org>
---
drivers/iio/adc/ti-tsc2046.c | 4 +---
drivers/iio/trigger/iio-trig-hrtimer.c | 4 ++--
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
index 311d97001249..87c86d752293 100644
--- a/drivers/iio/adc/ti-tsc2046.c
+++ b/drivers/iio/adc/ti-tsc2046.c
@@ -812,9 +812,7 @@ static int tsc2046_adc_probe(struct spi_device *spi)
spin_lock_init(&priv->state_lock);
priv->state = TSC2046_STATE_SHUTDOWN;
- hrtimer_init(&priv->trig_timer, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL_SOFT);
- priv->trig_timer.function = tsc2046_adc_timer;
+ hrtimer_setup(&priv->trig_timer, tsc2046_adc_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
ret = devm_iio_trigger_register(dev, trig);
if (ret) {
diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c
index 716c795d08fb..82c72baccb62 100644
--- a/drivers/iio/trigger/iio-trig-hrtimer.c
+++ b/drivers/iio/trigger/iio-trig-hrtimer.c
@@ -145,8 +145,8 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name)
trig_info->swt.trigger->ops = &iio_hrtimer_trigger_ops;
trig_info->swt.trigger->dev.groups = iio_hrtimer_attr_groups;
- hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
- trig_info->timer.function = iio_hrtimer_trig_handler;
+ hrtimer_setup(&trig_info->timer, iio_hrtimer_trig_handler, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL_HARD);
trig_info->sampling_frequency[0] = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;
trig_info->period = NSEC_PER_SEC / trig_info->sampling_frequency[0];
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* Re: [PATCH 26/44] iio: Switch to use hrtimer_setup()
2024-10-28 7:35 ` [PATCH 26/44] iio: " Nam Cao
@ 2024-11-02 16:00 ` Jonathan Cameron
0 siblings, 0 replies; 55+ messages in thread
From: Jonathan Cameron @ 2024-11-02 16:00 UTC (permalink / raw)
To: Nam Cao
Cc: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel, linux-iio
On Mon, 28 Oct 2024 08:35:02 +0100
Nam Cao <namcao@linutronix.de> wrote:
> There is a newly introduced hrtimer_setup() which will replace
> hrtimer_init(). This new function is similar to the old one, except that it
> also sanity-checks and initializes the timer's callback function.
>
> Switch to use this new function.
>
> Patch was created by using Coccinelle.
>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Seems sensible to me.
https://lore.kernel.org/lkml/2159c09badceec667d800005ac98824105ba8dc6.1729864615.git.namcao@linutronix.de/
Has definition of hrtimer_setup()
+CC linux-iio as an FYI.
Jonathan
> ---
> Cc: Jonathan Cameron <jic23@kernel.org>
> ---
> drivers/iio/adc/ti-tsc2046.c | 4 +---
> drivers/iio/trigger/iio-trig-hrtimer.c | 4 ++--
> 2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c
> index 311d97001249..87c86d752293 100644
> --- a/drivers/iio/adc/ti-tsc2046.c
> +++ b/drivers/iio/adc/ti-tsc2046.c
> @@ -812,9 +812,7 @@ static int tsc2046_adc_probe(struct spi_device *spi)
>
> spin_lock_init(&priv->state_lock);
> priv->state = TSC2046_STATE_SHUTDOWN;
> - hrtimer_init(&priv->trig_timer, CLOCK_MONOTONIC,
> - HRTIMER_MODE_REL_SOFT);
> - priv->trig_timer.function = tsc2046_adc_timer;
> + hrtimer_setup(&priv->trig_timer, tsc2046_adc_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
>
> ret = devm_iio_trigger_register(dev, trig);
> if (ret) {
> diff --git a/drivers/iio/trigger/iio-trig-hrtimer.c b/drivers/iio/trigger/iio-trig-hrtimer.c
> index 716c795d08fb..82c72baccb62 100644
> --- a/drivers/iio/trigger/iio-trig-hrtimer.c
> +++ b/drivers/iio/trigger/iio-trig-hrtimer.c
> @@ -145,8 +145,8 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name)
> trig_info->swt.trigger->ops = &iio_hrtimer_trigger_ops;
> trig_info->swt.trigger->dev.groups = iio_hrtimer_attr_groups;
>
> - hrtimer_init(&trig_info->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
> - trig_info->timer.function = iio_hrtimer_trig_handler;
> + hrtimer_setup(&trig_info->timer, iio_hrtimer_trig_handler, CLOCK_MONOTONIC,
> + HRTIMER_MODE_REL_HARD);
>
> trig_info->sampling_frequency[0] = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;
> trig_info->period = NSEC_PER_SEC / trig_info->sampling_frequency[0];
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 27/44] i2c: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (25 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 26/44] iio: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 28/44] stm class: heartbeat: " Nam Cao
` (20 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Andi Shyti
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Andi Shyti <andi.shyti@kernel.org>
---
drivers/i2c/busses/i2c-imx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 98539313cbc9..47f3ea4dc79d 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1417,8 +1417,8 @@ static int i2c_imx_probe(struct platform_device *pdev)
return -ENOMEM;
spin_lock_init(&i2c_imx->slave_lock);
- hrtimer_init(&i2c_imx->slave_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- i2c_imx->slave_timer.function = i2c_imx_slave_timeout;
+ hrtimer_setup(&i2c_imx->slave_timer, i2c_imx_slave_timeout, CLOCK_MONOTONIC,
+ HRTIMER_MODE_ABS);
match = device_get_match_data(&pdev->dev);
if (match)
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 28/44] stm class: heartbeat: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (26 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 27/44] i2c: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 29/44] drm/amdgpu: " Nam Cao
` (19 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Alexander Shishkin
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
drivers/hwtracing/stm/heartbeat.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/hwtracing/stm/heartbeat.c b/drivers/hwtracing/stm/heartbeat.c
index e9496fe97baa..495eb1dc8ac5 100644
--- a/drivers/hwtracing/stm/heartbeat.c
+++ b/drivers/hwtracing/stm/heartbeat.c
@@ -81,10 +81,8 @@ static int stm_heartbeat_init(void)
stm_heartbeat[i].data.type = STM_USER;
stm_heartbeat[i].data.link = stm_heartbeat_link;
stm_heartbeat[i].data.unlink = stm_heartbeat_unlink;
- hrtimer_init(&stm_heartbeat[i].hrtimer, CLOCK_MONOTONIC,
- HRTIMER_MODE_ABS);
- stm_heartbeat[i].hrtimer.function =
- stm_heartbeat_hrtimer_handler;
+ hrtimer_setup(&stm_heartbeat[i].hrtimer, stm_heartbeat_hrtimer_handler,
+ CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
ret = stm_source_register_device(NULL, &stm_heartbeat[i].data);
if (ret)
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 29/44] drm/amdgpu: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (27 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 28/44] stm class: heartbeat: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 30/44] drm/i915/huc: " Nam Cao
` (18 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Alex Deucher
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index d4c2afafbb73..9f78dd176057 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -188,8 +188,8 @@ static int amdgpu_vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
amdgpu_crtc->connector = NULL;
amdgpu_crtc->vsync_timer_enabled = AMDGPU_IRQ_STATE_DISABLE;
- hrtimer_init(&amdgpu_crtc->vblank_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- amdgpu_crtc->vblank_timer.function = &amdgpu_vkms_vblank_simulate;
+ hrtimer_setup(&amdgpu_crtc->vblank_timer, &amdgpu_vkms_vblank_simulate, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
return ret;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 30/44] drm/i915/huc: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (28 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 29/44] drm/amdgpu: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 31/44] drm/i915/gvt: " Nam Cao
` (17 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jani Nikula
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
drivers/gpu/drm/i915/gt/uc/intel_huc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_huc.c b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
index 2d9152eb7282..1c1582aef8b9 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_huc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_huc.c
@@ -231,8 +231,8 @@ static void delayed_huc_load_init(struct intel_huc *huc)
sw_fence_dummy_notify);
i915_sw_fence_commit(&huc->delayed_load.fence);
- hrtimer_init(&huc->delayed_load.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- huc->delayed_load.timer.function = huc_delayed_load_timer_callback;
+ hrtimer_setup(&huc->delayed_load.timer, huc_delayed_load_timer_callback, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
}
static void delayed_huc_load_fini(struct intel_huc *huc)
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 31/44] drm/i915/gvt: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (29 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 30/44] drm/i915/huc: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 32/44] drm/i915/perf: " Nam Cao
` (16 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jani Nikula
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
drivers/gpu/drm/i915/gvt/display.c | 3 +--
drivers/gpu/drm/i915/gvt/sched_policy.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/display.c b/drivers/gpu/drm/i915/gvt/display.c
index c66d6d3177c8..0e80251d2666 100644
--- a/drivers/gpu/drm/i915/gvt/display.c
+++ b/drivers/gpu/drm/i915/gvt/display.c
@@ -575,8 +575,7 @@ static int setup_virtual_dp_monitor(struct intel_vgpu *vgpu, int port_num,
vgpu->display.port_num = port_num;
/* Init hrtimer based on default refresh rate */
- hrtimer_init(&vblank_timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- vblank_timer->timer.function = vblank_timer_fn;
+ hrtimer_setup(&vblank_timer->timer, vblank_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
vblank_timer->vrefresh_k = port->vrefresh_k;
vblank_timer->period = DIV64_U64_ROUND_CLOSEST(NSEC_PER_SEC * MSEC_PER_SEC, vblank_timer->vrefresh_k);
diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c
index c077fb4674f0..9f97f743aa71 100644
--- a/drivers/gpu/drm/i915/gvt/sched_policy.c
+++ b/drivers/gpu/drm/i915/gvt/sched_policy.c
@@ -286,8 +286,7 @@ static int tbs_sched_init(struct intel_gvt *gvt)
return -ENOMEM;
INIT_LIST_HEAD(&data->lru_runq_head);
- hrtimer_init(&data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- data->timer.function = tbs_timer_fn;
+ hrtimer_setup(&data->timer, tbs_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
data->period = GVT_DEFAULT_TIME_SLICE;
data->gvt = gvt;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 32/44] drm/i915/perf: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (30 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 31/44] drm/i915/gvt: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 33/44] drm/i915/pmu: " Nam Cao
` (15 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jani Nikula
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
drivers/gpu/drm/i915/i915_perf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 2406cda75b7b..e82a47ceed68 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -3359,9 +3359,8 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
"opening stream oa config uuid=%s\n",
stream->oa_config->uuid);
- hrtimer_init(&stream->poll_check_timer,
- CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- stream->poll_check_timer.function = oa_poll_check_timer_cb;
+ hrtimer_setup(&stream->poll_check_timer, oa_poll_check_timer_cb, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
init_waitqueue_head(&stream->poll_wq);
spin_lock_init(&stream->oa_buffer.ptr_lock);
mutex_init(&stream->lock);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 33/44] drm/i915/pmu: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (31 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 32/44] drm/i915/perf: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 34/44] drm/i915/uncore: " Nam Cao
` (14 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jani Nikula
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
drivers/gpu/drm/i915/i915_pmu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 21eb0c5b320d..5f5210a8f58b 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -1261,8 +1261,7 @@ void i915_pmu_register(struct drm_i915_private *i915)
}
spin_lock_init(&pmu->lock);
- hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- pmu->timer.function = i915_sample;
+ hrtimer_setup(&pmu->timer, i915_sample, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
pmu->cpuhp.cpu = -1;
init_rc6(pmu);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 34/44] drm/i915/uncore: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (32 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 33/44] drm/i915/pmu: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 35/44] drm/i915/request: " Nam Cao
` (13 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jani Nikula
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
drivers/gpu/drm/i915/intel_uncore.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 6aa179a3e92a..f68e76c5c883 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -2098,8 +2098,7 @@ static int __fw_domain_init(struct intel_uncore *uncore,
d->mask = BIT(domain_id);
- hrtimer_init(&d->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- d->timer.function = intel_uncore_fw_release_timer;
+ hrtimer_setup(&d->timer, intel_uncore_fw_release_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
uncore->fw_domains |= BIT(domain_id);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 35/44] drm/i915/request: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (33 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 34/44] drm/i915/uncore: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 36/44] drm/msm: " Nam Cao
` (12 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jani Nikula
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jani Nikula <jani.nikula@linux.intel.com>
---
drivers/gpu/drm/i915/i915_request.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 8f62cfa23fb7..ea0b8e7e4828 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -293,8 +293,7 @@ static void __rq_init_watchdog(struct i915_request *rq)
{
struct i915_request_watchdog *wdg = &rq->watchdog;
- hrtimer_init(&wdg->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- wdg->timer.function = __rq_watchdog_expired;
+ hrtimer_setup(&wdg->timer, __rq_watchdog_expired, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
}
static void __rq_arm_watchdog(struct i915_request *rq)
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 36/44] drm/msm: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (34 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 35/44] drm/i915/request: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 37/44] drm/vkms: " Nam Cao
` (11 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Rob Clark
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Rob Clark <robdclark@gmail.com>
---
drivers/gpu/drm/msm/msm_fence.c | 3 +--
drivers/gpu/drm/msm/msm_io_utils.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c
index 1a5d4f1c8b42..d41e5a6bbee0 100644
--- a/drivers/gpu/drm/msm/msm_fence.c
+++ b/drivers/gpu/drm/msm/msm_fence.c
@@ -65,8 +65,7 @@ msm_fence_context_alloc(struct drm_device *dev, volatile uint32_t *fenceptr,
fctx->completed_fence = fctx->last_fence;
*fctx->fenceptr = fctx->last_fence;
- hrtimer_init(&fctx->deadline_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- fctx->deadline_timer.function = deadline_timer;
+ hrtimer_setup(&fctx->deadline_timer, deadline_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
kthread_init_work(&fctx->deadline_work, deadline_work);
diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c
index afedd61c3e28..a6efe1eac271 100644
--- a/drivers/gpu/drm/msm/msm_io_utils.c
+++ b/drivers/gpu/drm/msm/msm_io_utils.c
@@ -135,8 +135,7 @@ void msm_hrtimer_work_init(struct msm_hrtimer_work *work,
clockid_t clock_id,
enum hrtimer_mode mode)
{
- hrtimer_init(&work->timer, clock_id, mode);
- work->timer.function = msm_hrtimer_worktimer;
+ hrtimer_setup(&work->timer, msm_hrtimer_worktimer, clock_id, mode);
work->worker = worker;
kthread_init_work(&work->work, fn);
}
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 37/44] drm/vkms: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (35 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 36/44] drm/msm: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 38/44] drm/xe/oa: " Nam Cao
` (10 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Rodrigo Siqueira
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
drivers/gpu/drm/vkms/vkms_crtc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
index 40b4d084e3ce..5fb597bfdcaf 100644
--- a/drivers/gpu/drm/vkms/vkms_crtc.c
+++ b/drivers/gpu/drm/vkms/vkms_crtc.c
@@ -66,8 +66,8 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)
drm_calc_timestamping_constants(crtc, &crtc->mode);
- hrtimer_init(&out->vblank_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- out->vblank_hrtimer.function = &vkms_vblank_simulate;
+ hrtimer_setup(&out->vblank_hrtimer, &vkms_vblank_simulate, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
out->period_ns = ktime_set(0, vblank->framedur_ns);
hrtimer_start(&out->vblank_hrtimer, out->period_ns, HRTIMER_MODE_REL);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 38/44] drm/xe/oa: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (36 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 37/44] drm/vkms: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-31 13:12 ` Lucas De Marchi
2024-10-28 7:35 ` [PATCH 39/44] drm/vmwgfx: " Nam Cao
` (9 subsequent siblings)
47 siblings, 1 reply; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Lucas De Marchi
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
---
drivers/gpu/drm/xe/xe_oa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index eae38a49ee8e..600eaaee8a72 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -1437,8 +1437,8 @@ static int xe_oa_stream_init(struct xe_oa_stream *stream,
WRITE_ONCE(u->exclusive_stream, stream);
- hrtimer_init(&stream->poll_check_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- stream->poll_check_timer.function = xe_oa_poll_check_timer_cb;
+ hrtimer_setup(&stream->poll_check_timer, xe_oa_poll_check_timer_cb, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
init_waitqueue_head(&stream->poll_wq);
spin_lock_init(&stream->oa_buffer.ptr_lock);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* Re: [PATCH 38/44] drm/xe/oa: Switch to use hrtimer_setup()
2024-10-28 7:35 ` [PATCH 38/44] drm/xe/oa: " Nam Cao
@ 2024-10-31 13:12 ` Lucas De Marchi
0 siblings, 0 replies; 55+ messages in thread
From: Lucas De Marchi @ 2024-10-31 13:12 UTC (permalink / raw)
To: Nam Cao
Cc: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
On Mon, Oct 28, 2024 at 08:35:14AM +0100, Nam Cao wrote:
>There is a newly introduced hrtimer_setup() which will replace
>hrtimer_init(). This new function is similar to the old one, except that it
>also sanity-checks and initializes the timer's callback function.
>
>Switch to use this new function.
>
>Patch was created by using Coccinelle.
>
>Signed-off-by: Nam Cao <namcao@linutronix.de>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Lucas De Marchi
>---
>Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>---
> drivers/gpu/drm/xe/xe_oa.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
>index eae38a49ee8e..600eaaee8a72 100644
>--- a/drivers/gpu/drm/xe/xe_oa.c
>+++ b/drivers/gpu/drm/xe/xe_oa.c
>@@ -1437,8 +1437,8 @@ static int xe_oa_stream_init(struct xe_oa_stream *stream,
>
> WRITE_ONCE(u->exclusive_stream, stream);
>
>- hrtimer_init(&stream->poll_check_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>- stream->poll_check_timer.function = xe_oa_poll_check_timer_cb;
>+ hrtimer_setup(&stream->poll_check_timer, xe_oa_poll_check_timer_cb, CLOCK_MONOTONIC,
>+ HRTIMER_MODE_REL);
> init_waitqueue_head(&stream->poll_wq);
>
> spin_lock_init(&stream->oa_buffer.ptr_lock);
>--
>2.39.5
>
^ permalink raw reply [flat|nested] 55+ messages in thread
* [PATCH 39/44] drm/vmwgfx: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (37 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 38/44] drm/xe/oa: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 40/44] virtio: mem: " Nam Cao
` (8 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Zack Rusin
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Zack Rusin <zack.rusin@broadcom.com>
---
drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
index 8651b788e98b..aec774fa4d7b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c
@@ -290,8 +290,8 @@ vmw_vkms_enable_vblank(struct drm_crtc *crtc)
drm_calc_timestamping_constants(crtc, &crtc->mode);
- hrtimer_init(&du->vkms.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- du->vkms.timer.function = &vmw_vkms_vblank_simulate;
+ hrtimer_setup(&du->vkms.timer, &vmw_vkms_vblank_simulate, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
du->vkms.period_ns = ktime_set(0, vblank->framedur_ns);
hrtimer_start(&du->vkms.timer, du->vkms.period_ns, HRTIMER_MODE_REL);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 40/44] virtio: mem: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (38 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 39/44] drm/vmwgfx: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 41/44] RDMA: " Nam Cao
` (7 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Michael S. Tsirkin
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: "Michael S. Tsirkin" <mst@redhat.com>
---
drivers/virtio/virtio_mem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
index b0b871441578..a74ff1418282 100644
--- a/drivers/virtio/virtio_mem.c
+++ b/drivers/virtio/virtio_mem.c
@@ -2855,8 +2855,8 @@ static int virtio_mem_probe(struct virtio_device *vdev)
mutex_init(&vm->hotplug_mutex);
INIT_LIST_HEAD(&vm->next);
spin_lock_init(&vm->removal_lock);
- hrtimer_init(&vm->retry_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- vm->retry_timer.function = virtio_mem_timer_expired;
+ hrtimer_setup(&vm->retry_timer, virtio_mem_timer_expired, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
vm->retry_timer_ms = VIRTIO_MEM_RETRY_TIMER_MIN_MS;
vm->in_kdump = is_kdump_kernel();
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 41/44] RDMA: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (39 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 40/44] virtio: mem: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 42/44] pwm: gpio: " Nam Cao
` (6 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Jason Gunthorpe
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Jason Gunthorpe <jgg@ziepe.ca>
---
drivers/infiniband/hw/hfi1/init.c | 5 ++---
drivers/infiniband/sw/rdmavt/qp.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c
index cbac4a442d9e..d6fbd9c2b8b4 100644
--- a/drivers/infiniband/hw/hfi1/init.c
+++ b/drivers/infiniband/hw/hfi1/init.c
@@ -635,12 +635,11 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd,
spin_lock_init(&ppd->cca_timer_lock);
for (i = 0; i < OPA_MAX_SLS; i++) {
- hrtimer_init(&ppd->cca_timer[i].hrtimer, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL);
ppd->cca_timer[i].ppd = ppd;
ppd->cca_timer[i].sl = i;
ppd->cca_timer[i].ccti = 0;
- ppd->cca_timer[i].hrtimer.function = cca_timer_fn;
+ hrtimer_setup(&ppd->cca_timer[i].hrtimer, cca_timer_fn, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
}
ppd->cc_max_table_entries = IB_CC_TABLE_CAP_DEFAULT;
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index e6203e26cc06..614009fb9632 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1107,9 +1107,8 @@ int rvt_create_qp(struct ib_qp *ibqp, struct ib_qp_init_attr *init_attr,
}
/* initialize timers needed for rc qp */
timer_setup(&qp->s_timer, rvt_rc_timeout, 0);
- hrtimer_init(&qp->s_rnr_timer, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL);
- qp->s_rnr_timer.function = rvt_rc_rnr_retry;
+ hrtimer_setup(&qp->s_rnr_timer, rvt_rc_rnr_retry, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
/*
* Driver needs to set up it's private QP structure and do any
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 42/44] pwm: gpio: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (40 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 41/44] RDMA: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 43/44] ASoC: fsl: imx-pcm-fiq: " Nam Cao
` (5 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Uwe Kleine-König
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: "Uwe Kleine-König" <ukleinek@kernel.org>
---
drivers/pwm/pwm-gpio.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pwm/pwm-gpio.c b/drivers/pwm/pwm-gpio.c
index 9f8884ac7504..5f4edeb394a9 100644
--- a/drivers/pwm/pwm-gpio.c
+++ b/drivers/pwm/pwm-gpio.c
@@ -207,13 +207,12 @@ static int pwm_gpio_probe(struct platform_device *pdev)
chip->ops = &pwm_gpio_ops;
chip->atomic = true;
- hrtimer_init(&gpwm->gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ hrtimer_setup(&gpwm->gpio_timer, pwm_gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+
ret = devm_add_action_or_reset(dev, pwm_gpio_disable_hrtimer, gpwm);
if (ret)
return ret;
- gpwm->gpio_timer.function = pwm_gpio_timer;
-
ret = pwmchip_add(chip);
if (ret < 0)
return dev_err_probe(dev, ret, "could not add pwmchip\n");
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 43/44] ASoC: fsl: imx-pcm-fiq: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (41 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 42/44] pwm: gpio: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 7:35 ` [PATCH 44/44] ALSA: " Nam Cao
` (4 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Takashi Iwai
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Takashi Iwai <tiwai@suse.com>
---
sound/soc/fsl/imx-pcm-fiq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 3391430e4253..83de3ae33691 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -185,8 +185,7 @@ static int snd_imx_open(struct snd_soc_component *component,
atomic_set(&iprtd->playing, 0);
atomic_set(&iprtd->capturing, 0);
- hrtimer_init(&iprtd->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- iprtd->hrt.function = snd_hrtimer_callback;
+ hrtimer_setup(&iprtd->hrt, snd_hrtimer_callback, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
ret = snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* [PATCH 44/44] ALSA: Switch to use hrtimer_setup()
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (42 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 43/44] ASoC: fsl: imx-pcm-fiq: " Nam Cao
@ 2024-10-28 7:35 ` Nam Cao
2024-10-28 8:58 ` [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Alexander Shishkin
` (3 subsequent siblings)
47 siblings, 0 replies; 55+ messages in thread
From: Nam Cao @ 2024-10-28 7:35 UTC (permalink / raw)
To: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Takashi Iwai
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.
Switch to use this new function.
Patch was created by using Coccinelle.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Takashi Iwai <tiwai@suse.com>
---
sound/core/hrtimer.c | 3 +--
sound/drivers/dummy.c | 3 +--
sound/drivers/pcsp/pcsp.c | 3 +--
sound/sh/sh_dac_audio.c | 3 +--
4 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c
index 147c1fea4708..e9c60dce59fb 100644
--- a/sound/core/hrtimer.c
+++ b/sound/core/hrtimer.c
@@ -66,9 +66,8 @@ static int snd_hrtimer_open(struct snd_timer *t)
stime = kzalloc(sizeof(*stime), GFP_KERNEL);
if (!stime)
return -ENOMEM;
- hrtimer_init(&stime->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
stime->timer = t;
- stime->hrt.function = snd_hrtimer_callback;
+ hrtimer_setup(&stime->hrt, snd_hrtimer_callback, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
t->private_data = stime;
return 0;
}
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 8f5df9b3aaaa..c1a3efb633c5 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -457,8 +457,7 @@ static int dummy_hrtimer_create(struct snd_pcm_substream *substream)
if (!dpcm)
return -ENOMEM;
substream->runtime->private_data = dpcm;
- hrtimer_init(&dpcm->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
- dpcm->timer.function = dummy_hrtimer_callback;
+ hrtimer_setup(&dpcm->timer, dummy_hrtimer_callback, CLOCK_MONOTONIC, HRTIMER_MODE_REL_SOFT);
dpcm->substream = substream;
atomic_set(&dpcm->running, 0);
return 0;
diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c
index 78c9b1c7590f..e8482c2290c3 100644
--- a/sound/drivers/pcsp/pcsp.c
+++ b/sound/drivers/pcsp/pcsp.c
@@ -103,8 +103,7 @@ static int snd_card_pcsp_probe(int devnum, struct device *dev)
if (devnum != 0)
return -EINVAL;
- hrtimer_init(&pcsp_chip.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- pcsp_chip.timer.function = pcsp_do_timer;
+ hrtimer_setup(&pcsp_chip.timer, pcsp_do_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
err = snd_devm_card_new(dev, index, id, THIS_MODULE, 0, &card);
if (err < 0)
diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c
index e7b6ce7bd086..4fb88c3a4902 100644
--- a/sound/sh/sh_dac_audio.c
+++ b/sound/sh/sh_dac_audio.c
@@ -313,8 +313,7 @@ static int snd_sh_dac_create(struct snd_card *card,
chip->card = card;
- hrtimer_init(&chip->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- chip->hrtimer.function = sh_dac_audio_timer;
+ hrtimer_setup(&chip->hrtimer, sh_dac_audio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
dac_audio_reset(chip);
chip->rate = 8000;
--
2.39.5
^ permalink raw reply related [flat|nested] 55+ messages in thread* Re: [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5)
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (43 preceding siblings ...)
2024-10-28 7:35 ` [PATCH 44/44] ALSA: " Nam Cao
@ 2024-10-28 8:58 ` Alexander Shishkin
2024-10-28 11:06 ` Thomas Gleixner
2024-10-31 12:21 ` Jani Nikula
` (2 subsequent siblings)
47 siblings, 1 reply; 55+ messages in thread
From: Alexander Shishkin @ 2024-10-28 8:58 UTC (permalink / raw)
To: Nam Cao, Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman, Martin K. Petersen,
Alexandre Belloni, Rafael J. Wysocki, Linus Walleij,
Sebastian Reichel, Will Deacon, Jon Mason, Jaehoon Chung,
Hans Verkuil, Jassi Brar, Pavel Machek, Dmitry Torokhov,
Jonathan Cameron, Andi Shyti, Alex Deucher, Jani Nikula,
Rob Clark, Lucas De Marchi, Zack Rusin, Michael S. Tsirkin,
Jason Gunthorpe, Uwe Kleine-König, Takashi Iwai,
alexander.shishkin
Nam Cao <namcao@linutronix.de> writes:
> This is the forth part of a 5-part series (split for convenience). All 5
> parts are:
>
> Part 1: https://lore.kernel.org/lkml/cover.1729864615.git.namcao@linutronix.de
> Part 2: https://lore.kernel.org/lkml/cover.1729864823.git.namcao@linutronix.de
> Part 3: https://lore.kernel.org/lkml/cover.1729865232.git.namcao@linutronix.de
> Part 4: https://lore.kernel.org/lkml/cover.1729865485.git.namcao@linutronix.de
> Part 5: https://lore.kernel.org/lkml/cover.1729865740.git.namcao@linutronix.de
Which one do I need to click on to see the actual hrtimer_setup*()
implementations? Why is it even a separate series? Please, don't make
people click on things.
> To use hrtimer, hrtimer_init() (or one of its variant) must be called, and
> also the timer's callfack function must be setup separately.
"callback", right?
> That can cause misuse of hrtimer. For example, because:
> - The callback function is not setup
> - The callback function is setup while it is not safe to do so
These are not examples, these are hypotheticals. Do either of these
things actually happen in the codebase?
> To prevent misuse of hrtimer, this series:
> - Introduce new functions hrtimer_setup*(). These new functions are
> similar to hrtimer_init*(), except that they also sanity-check and
> initialize the callback function.
No, it doesn't. This series only converts some drivers. I'd like to see
the sanity-checking in question, since it's the big selling point.
But IMO, "switching to a cleaner hrtimer API" or some words to that
effect is a better justification than sanity checking.
I'm not objecting to the idea, it's just carried out weirdly.
> - Introduce hrtimer_update_function() which checks that it is safe to
> change the callback function. The 'function' field of hrtimer is then
> made private.
Also not in this series.
> - Convert all users to use the new functions.
> - Some minor cleanups on the way.
Thanks,
--
Alex
^ permalink raw reply [flat|nested] 55+ messages in thread* Re: [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5)
2024-10-28 8:58 ` [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Alexander Shishkin
@ 2024-10-28 11:06 ` Thomas Gleixner
0 siblings, 0 replies; 55+ messages in thread
From: Thomas Gleixner @ 2024-10-28 11:06 UTC (permalink / raw)
To: Alexander Shishkin, Nam Cao, Anna-Maria Behnsen,
Frederic Weisbecker, Andreas Hindborg, Alice Ryhl, Miguel Ojeda,
Kees Cook, linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman, Martin K. Petersen,
Alexandre Belloni, Rafael J. Wysocki, Linus Walleij,
Sebastian Reichel, Will Deacon, Jon Mason, Jaehoon Chung,
Hans Verkuil, Jassi Brar, Pavel Machek, Dmitry Torokhov,
Jonathan Cameron, Andi Shyti, Alex Deucher, Jani Nikula,
Rob Clark, Lucas De Marchi, Zack Rusin, Michael S. Tsirkin,
Jason Gunthorpe, Uwe Kleine-König, Takashi Iwai,
alexander.shishkin
On Mon, Oct 28 2024 at 10:58, Alexander Shishkin wrote:
> Nam Cao <namcao@linutronix.de> writes:
>
>> This is the forth part of a 5-part series (split for convenience). All 5
>> parts are:
>>
>> Part 1: https://lore.kernel.org/lkml/cover.1729864615.git.namcao@linutronix.de
>> Part 2: https://lore.kernel.org/lkml/cover.1729864823.git.namcao@linutronix.de
>> Part 3: https://lore.kernel.org/lkml/cover.1729865232.git.namcao@linutronix.de
>> Part 4: https://lore.kernel.org/lkml/cover.1729865485.git.namcao@linutronix.de
>> Part 5: https://lore.kernel.org/lkml/cover.1729865740.git.namcao@linutronix.de
>
> Which one do I need to click on to see the actual hrtimer_setup*()
> implementations? Why is it even a separate series? Please, don't make
> people click on things.
Obviously part 1. The splitup was dont to avoid 500+ people which is
generally frowned upon.
>> That can cause misuse of hrtimer. For example, because:
>> - The callback function is not setup
>> - The callback function is setup while it is not safe to do so
>
> These are not examples, these are hypotheticals. Do either of these
> things actually happen in the codebase?
Right now not, but we had this in the past.
>> To prevent misuse of hrtimer, this series:
>> - Introduce new functions hrtimer_setup*(). These new functions are
>> similar to hrtimer_init*(), except that they also sanity-check and
>> initialize the callback function.
> I'm not objecting to the idea, it's just carried out weirdly.
Right. There should have been a sectioning to explain what which part of
the series does. My bad.
Thanks,
tglx
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5)
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (44 preceding siblings ...)
2024-10-28 8:58 ` [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Alexander Shishkin
@ 2024-10-31 12:21 ` Jani Nikula
2024-10-31 15:59 ` Zack Rusin
2024-10-31 21:42 ` Deucher, Alexander
47 siblings, 0 replies; 55+ messages in thread
From: Jani Nikula @ 2024-10-31 12:21 UTC (permalink / raw)
To: Nam Cao, Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel
Cc: Nam Cao, Greg Kroah-Hartman, Martin K. Petersen,
Alexandre Belloni, Rafael J. Wysocki, Linus Walleij,
Sebastian Reichel, Will Deacon, Jon Mason, Jaehoon Chung,
Hans Verkuil, Jassi Brar, Pavel Machek, Dmitry Torokhov,
Jonathan Cameron, Andi Shyti, Alexander Shishkin, Alex Deucher,
Rob Clark, Lucas De Marchi, Zack Rusin, Michael S. Tsirkin,
Jason Gunthorpe, Uwe Kleine-König, Takashi Iwai
On Mon, 28 Oct 2024, Nam Cao <namcao@linutronix.de> wrote:
> drm/i915/huc: Switch to use hrtimer_setup()
> drm/i915/gvt: Switch to use hrtimer_setup()
> drm/i915/perf: Switch to use hrtimer_setup()
> drm/i915/pmu: Switch to use hrtimer_setup()
> drm/i915/uncore: Switch to use hrtimer_setup()
> drm/i915/request: Switch to use hrtimer_setup()
Acked-by: Jani Nikula <jani.nikula@intel.com>
for merging the above via whichever tree you find convenient.
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 55+ messages in thread* Re: [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5)
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (45 preceding siblings ...)
2024-10-31 12:21 ` Jani Nikula
@ 2024-10-31 15:59 ` Zack Rusin
2024-10-31 21:42 ` Deucher, Alexander
47 siblings, 0 replies; 55+ messages in thread
From: Zack Rusin @ 2024-10-31 15:59 UTC (permalink / raw)
To: Nam Cao
Cc: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel, Greg Kroah-Hartman, Martin K. Petersen,
Alexandre Belloni, Rafael J. Wysocki, Linus Walleij,
Sebastian Reichel, Will Deacon, Jon Mason, Jaehoon Chung,
Hans Verkuil, Jassi Brar, Pavel Machek, Dmitry Torokhov,
Jonathan Cameron, Andi Shyti, Alexander Shishkin, Alex Deucher,
Jani Nikula, Rob Clark, Lucas De Marchi, Michael S. Tsirkin,
Jason Gunthorpe, Uwe Kleine-König, Takashi Iwai
On Mon, Oct 28, 2024 at 3:35 AM Nam Cao <namcao@linutronix.de> wrote:
>
> This is the forth part of a 5-part series (split for convenience). All 5
> parts are:
>
> Part 1: https://lore.kernel.org/lkml/cover.1729864615.git.namcao@linutronix.de
> Part 2: https://lore.kernel.org/lkml/cover.1729864823.git.namcao@linutronix.de
> Part 3: https://lore.kernel.org/lkml/cover.1729865232.git.namcao@linutronix.de
> Part 4: https://lore.kernel.org/lkml/cover.1729865485.git.namcao@linutronix.de
> Part 5: https://lore.kernel.org/lkml/cover.1729865740.git.namcao@linutronix.de
>
> To use hrtimer, hrtimer_init() (or one of its variant) must be called, and
> also the timer's callfack function must be setup separately.
>
> That can cause misuse of hrtimer. For example, because:
> - The callback function is not setup
> - The callback function is setup while it is not safe to do so
>
> To prevent misuse of hrtimer, this series:
> - Introduce new functions hrtimer_setup*(). These new functions are
> similar to hrtimer_init*(), except that they also sanity-check and
> initialize the callback function.
> - Introduce hrtimer_update_function() which checks that it is safe to
> change the callback function. The 'function' field of hrtimer is then
> made private.
> - Convert all users to use the new functions.
> - Some minor cleanups on the way.
>
> Most conversion patches were created using Coccinelle with the sematic
> patch below; except for tricky cases that Coccinelle cannot handle, or for
> some cases where a Coccinelle's bug regarding 100 column limit is
> triggered. Any patches not mentioning Coccinelle were done manually.
>
> 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);
>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> 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>
>
> Nam Cao (44):
> USB: chipidea: Switch to use hrtimer_setup()
> usb: dwc2: Switch to use hrtimer_setup()
> usb: fotg210-hcd: Switch to use hrtimer_setup()
> usb: gadget: Switch to use hrtimer_setup()
> usb: ehci: Switch to use hrtimer_setup()
> usb: musb: cppi41: Switch to use hrtimer_setup()
> usb: typec: tcpm: Switch to use hrtimer_setup()
> serial: 8250: Switch to use hrtimer_setup()
> serial: imx: Switch to use hrtimer_setup()
> serial: sh-sci: Switch to use hrtimer_setup()
> serial: xilinx_uartps: Switch to use hrtimer_setup()
> scsi: Switch to use hrtimer_setup()
> rtc: class: Switch to use hrtimer_setup()
> pps: generators: pps_gen_parport: Switch to use hrtimer_setup()
> powercap: Switch to use hrtimer_setup()
> power: supply: ab8500_chargalg: Switch to use hrtimer_setup()
> power: reset: ltc2952-poweroff: Switch to use hrtimer_setup()
> drivers: perf: Switch to use hrtimer_setup()
> ntb: ntb_pingpong: Switch to use hrtimer_setup()
> mmc: dw_mmc: Switch to use hrtimer_setup()
> misc: vcpu_stall_detector: Switch to use hrtimer_setup()
> media: Switch to use hrtimer_setup()
> mailbox: Switch to use hrtimer_setup()
> leds: trigger: pattern: Switch to use hrtimer_setup()
> Input: Switch to use hrtimer_setup()
> iio: Switch to use hrtimer_setup()
> i2c: Switch to use hrtimer_setup()
> stm class: heartbeat: Switch to use hrtimer_setup()
> drm/amdgpu: Switch to use hrtimer_setup()
> drm/i915/huc: Switch to use hrtimer_setup()
> drm/i915/gvt: Switch to use hrtimer_setup()
> drm/i915/perf: Switch to use hrtimer_setup()
> drm/i915/pmu: Switch to use hrtimer_setup()
> drm/i915/uncore: Switch to use hrtimer_setup()
> drm/i915/request: Switch to use hrtimer_setup()
> drm/msm: Switch to use hrtimer_setup()
> drm/vkms: Switch to use hrtimer_setup()
> drm/xe/oa: Switch to use hrtimer_setup()
> drm/vmwgfx: Switch to use hrtimer_setup()
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
FWIW, even if there's no current errors in those paths, that's a nice
change. I remember looking at the hrtimer initialization code the
first time and thinking that setting the function member of the struct
after initialization must be a bug or some hack... Now it will
instinctively make sense to anyone reading it for the first time.
z
^ permalink raw reply [flat|nested] 55+ messages in thread* RE: [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5)
2024-10-28 7:34 [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5) Nam Cao
` (46 preceding siblings ...)
2024-10-31 15:59 ` Zack Rusin
@ 2024-10-31 21:42 ` Deucher, Alexander
47 siblings, 0 replies; 55+ messages in thread
From: Deucher, Alexander @ 2024-10-31 21:42 UTC (permalink / raw)
To: Nam Cao, Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner,
Andreas Hindborg, Alice Ryhl, Miguel Ojeda, Kees Cook,
linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman, Martin K. Petersen, Alexandre Belloni,
Rafael J. Wysocki, Linus Walleij, Sebastian Reichel, Will Deacon,
Jon Mason, Jaehoon Chung, Hans Verkuil, Jassi Brar, Pavel Machek,
Dmitry Torokhov, Jonathan Cameron, Andi Shyti, Alexander Shishkin,
Jani Nikula, Rob Clark, Lucas De Marchi, Zack Rusin,
Michael S. Tsirkin, Jason Gunthorpe, Uwe Kleine-König,
Takashi Iwai
[Public]
> -----Original Message-----
> From: Nam Cao <namcao@linutronix.de>
> Sent: Monday, October 28, 2024 3:35 AM
> To: Anna-Maria Behnsen <anna-maria@linutronix.de>; Frederic Weisbecker
> <frederic@kernel.org>; Thomas Gleixner <tglx@linutronix.de>; Andreas Hindborg
> <a.hindborg@kernel.org>; Alice Ryhl <aliceryhl@google.com>; Miguel Ojeda
> <ojeda@kernel.org>; Kees Cook <kees@kernel.org>; linux-kernel@vger.kernel.org
> Cc: Nam Cao <namcao@linutronix.de>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Martin K. Petersen <martin.petersen@oracle.com>;
> Alexandre Belloni <alexandre.belloni@bootlin.com>; Rafael J. Wysocki
> <rafael@kernel.org>; Linus Walleij <linus.walleij@linaro.org>; Sebastian Reichel
> <sre@kernel.org>; Will Deacon <will@kernel.org>; Jon Mason
> <jdmason@kudzu.us>; Jaehoon Chung <jh80.chung@samsung.com>; Hans
> Verkuil <hverkuil-cisco@xs4all.nl>; Jassi Brar <jassisinghbrar@gmail.com>; Pavel
> Machek <pavel@ucw.cz>; Dmitry Torokhov <dmitry.torokhov@gmail.com>;
> Jonathan Cameron <jic23@kernel.org>; Andi Shyti <andi.shyti@kernel.org>;
> Alexander Shishkin <alexander.shishkin@linux.intel.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Jani Nikula <jani.nikula@linux.intel.com>; Rob
> Clark <robdclark@gmail.com>; Lucas De Marchi <lucas.demarchi@intel.com>;
> Zack Rusin <zack.rusin@broadcom.com>; Michael S. Tsirkin <mst@redhat.com>;
> Jason Gunthorpe <jgg@ziepe.ca>; Uwe Kleine-König <ukleinek@kernel.org>;
> Takashi Iwai <tiwai@suse.com>
> Subject: [PATCH 00/44] hrtimers: Switch to new hrtimer interface functions (4/5)
>
> drm/amdgpu: Switch to use hrtimer_setup()
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Feel free to take it via whatever tree makes sense.
Alex
^ permalink raw reply [flat|nested] 55+ messages in thread