[linux-yocto] [linux-yocto-rt v5.0/standard/preempt-rt/base][PATCH 1/1] genirq: invoke kthread_cancel_work_sync on RT kernel to aviod compile error
Bruce Ashfield
bruce.ashfield at gmail.com
Wed May 29 20:11:59 PDT 2019
I'm doing full updates on the 5.0 -rt at the moment, so I'll pickup
this fix along with the reset of the recent -rt changes upstream.
Bruce
On Thu, May 23, 2019 at 5:55 AM Liwei Song <liwei.song at windriver.com> wrote:
>
> fix following compile error:
>
> kernel/irq/manage.c:388:20: error: passing argument 1 of 'cancel_work_sync' from incompatible pointer type
>
> The compile error was got with CONFIG_PREEMPT_RT_BASE enabled,
> On RT kernel work_struct was replaced by kthread_work, so here
> we should use kthread_cancel_work_sync() instead of cancel_work_sync()
> to fix it.
>
> Signed-off-by: Liwei Song <liwei.song at windriver.com>
> ---
> kernel/irq/manage.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index f72bd3a357da..143f87bbff48 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -385,7 +385,11 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
> raw_spin_unlock_irqrestore(&desc->lock, flags);
>
> if (old_notify) {
> +#ifdef CONFIG_PREEMPT_RT_BASE
> + kthread_cancel_work_sync(&old_notify->work);
> +#else
> cancel_work_sync(&old_notify->work);
> +#endif
> kref_put(&old_notify->kref, old_notify->release);
> }
>
> --
> 2.18.1
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
More information about the linux-yocto
mailing list