All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Philippe Gerum <rpm@xenomai.org>, xenomai@xenomai.org
Subject: Re: [PATCH Dovetail 06/13] cobalt/sched, clock: pipeline: abstract IPI management
Date: Fri, 8 Jan 2021 10:40:55 +0100	[thread overview]
Message-ID: <6c2e91b7-2cbe-7eb4-56c5-fd9994825af1@siemens.com> (raw)
In-Reply-To: <20210102093353.3195090-7-rpm@xenomai.org>

On 02.01.21 10:33, Philippe Gerum wrote:
> From: Philippe Gerum <rpm@xenomai.org>
> 
> The I-pipe and Dovetail share the very same concept of out-of-band,
> high-priority IPI, but using a different interface. Let's abstract the
> calls manipulating those IPIs to make them pipeline-specific.
> 
> No functional change is introduced.
> 
> Signed-off-by: Philippe Gerum <rpm@xenomai.org>
> ---
>  .../cobalt/kernel/ipipe/pipeline/pipeline.h   | 50 ++++++++++++++++++-
>  kernel/cobalt/clock.c                         |  2 +-
>  .../include/asm-generic/xenomai/wrappers.h    |  4 --
>  kernel/cobalt/sched.c                         | 11 ++--
>  kernel/cobalt/timer.c                         |  7 +--
>  5 files changed, 56 insertions(+), 18 deletions(-)
> 
> diff --git a/include/cobalt/kernel/ipipe/pipeline/pipeline.h b/include/cobalt/kernel/ipipe/pipeline/pipeline.h
> index 317fa62d7..6f6958402 100644
> --- a/include/cobalt/kernel/ipipe/pipeline/pipeline.h
> +++ b/include/cobalt/kernel/ipipe/pipeline/pipeline.h
> @@ -5,7 +5,13 @@
>  #ifndef _COBALT_KERNEL_IPIPE_PIPELINE_H
>  #define _COBALT_KERNEL_IPIPE_PIPELINE_H
>  
> -#include <linux/ipipe.h>
> +#ifdef CONFIG_IPIPE_LEGACY
> +#error "CONFIG_IPIPE_LEGACY must be switched off"
> +#endif
> +
> +#include <pipeline/machine.h>
> +
> +#define PIPELINE_NR_IRQS  IPIPE_NR_IRQS
>  
>  typedef unsigned long spl_t;
>  
> @@ -22,4 +28,46 @@ typedef unsigned long spl_t;
>  #define is_secondary_domain()	ipipe_root_p
>  #define is_primary_domain()	(!ipipe_root_p)
>  
> +#ifdef CONFIG_SMP
> +
> +static inline int pipeline_request_resched_ipi(void (*handler)(void))
> +{
> +	return ipipe_request_irq(&cobalt_pipeline.domain,
> +				IPIPE_RESCHEDULE_IPI,
> +				(ipipe_irq_handler_t)handler,
> +				NULL, NULL);
> +}
> +
> +static inline void pipeline_free_resched_ipi(void)
> +{
> +	ipipe_free_irq(&cobalt_pipeline.domain,
> +		IPIPE_RESCHEDULE_IPI);
> +}
> +
> +static inline void pipeline_send_resched_ipi(const struct cpumask *dest)
> +{
> +	ipipe_send_ipi(IPIPE_RESCHEDULE_IPI, *dest);
> +}
> +
> +static inline int pipeline_request_timer_ipi(void (*handler)(void))
> +{
> +	return ipipe_request_irq(&cobalt_pipeline.domain,
> +				IPIPE_HRTIMER_IPI,
> +				(ipipe_irq_handler_t)handler,
> +				NULL, NULL);
> +}
> +
> +static inline void pipeline_free_timer_ipi(void)
> +{
> +	return ipipe_free_irq(&cobalt_pipeline.domain,
> +			IPIPE_HRTIMER_IPI);
> +}
> +
> +static inline void pipeline_send_timer_ipi(const struct cpumask *dest)
> +{
> +	ipipe_send_ipi(IPIPE_HRTIMER_IPI, *dest);
> +}
> +
> +#endif
> +
>  #endif /* !_COBALT_KERNEL_IPIPE_PIPELINE_H */
> diff --git a/kernel/cobalt/clock.c b/kernel/cobalt/clock.c
> index 2a5b61760..d73ade3f9 100644
> --- a/kernel/cobalt/clock.c
> +++ b/kernel/cobalt/clock.c
> @@ -228,7 +228,7 @@ void xnclock_core_local_shot(struct xnsched *sched)
>  #ifdef CONFIG_SMP
>  void xnclock_core_remote_shot(struct xnsched *sched)
>  {
> -	ipipe_send_ipi(IPIPE_HRTIMER_IPI, *cpumask_of(xnsched_cpu(sched)));
> +	pipeline_send_timer_ipi(cpumask_of(xnsched_cpu(sched)));
>  }
>  #endif
>  
> diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> index e266d5acf..e093676e1 100644
> --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
> @@ -20,10 +20,6 @@
>  
>  #include <linux/xenomai/wrappers.h>
>  
> -#ifdef CONFIG_IPIPE_LEGACY
> -#error "CONFIG_IPIPE_LEGACY must be switched off"
> -#endif
> -
>  #define COBALT_BACKPORT(__sym) __cobalt_backport_ ##__sym
>  
>  /*
> diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
> index b16903bd8..a44109e78 100644
> --- a/kernel/cobalt/sched.c
> +++ b/kernel/cobalt/sched.c
> @@ -235,10 +235,7 @@ void xnsched_init_all(void)
>  	}
>  
>  #ifdef CONFIG_SMP
> -	ipipe_request_irq(&xnsched_realtime_domain,
> -			  IPIPE_RESCHEDULE_IPI,
> -			  (ipipe_irq_handler_t)__xnsched_run_handler,
> -			  NULL, NULL);
> +	pipeline_request_resched_ipi(__xnsched_run_handler);
>  #endif
>  }
>  
> @@ -261,7 +258,7 @@ void xnsched_destroy_all(void)
>  	spl_t s;
>  
>  #ifdef CONFIG_SMP
> -	ipipe_free_irq(&xnsched_realtime_domain, IPIPE_RESCHEDULE_IPI);
> +	pipeline_free_resched_ipi();
>  #endif
>  
>  	xnlock_get_irqsave(&nklock, s);
> @@ -860,7 +857,7 @@ static inline int test_resched(struct xnsched *sched)
>  	/* Send resched IPI to remote CPU(s). */
>  	if (unlikely(!cpumask_empty(&sched->resched))) {
>  		smp_mb();
> -		ipipe_send_ipi(IPIPE_RESCHEDULE_IPI, sched->resched);
> +		pipeline_send_resched_ipi(&sched->resched);
>  		cpumask_clear(&sched->resched);
>  	}
>  #endif
> @@ -1280,7 +1277,7 @@ static int vfile_schedstat_next(struct xnvfile_snapshot_iterator *it,
>  
>  scan_irqs:
>  #ifdef CONFIG_XENO_OPT_STATS_IRQS
> -	if (priv->irq >= IPIPE_NR_IRQS)
> +	if (priv->irq >= PIPELINE_NR_IRQS)
>  		return 0;	/* All done. */
>  
>  	ret = xnintr_query_next(priv->irq, &priv->intr_it, p->name);
> diff --git a/kernel/cobalt/timer.c b/kernel/cobalt/timer.c
> index ccd3c3b70..b8c3f5a11 100644
> --- a/kernel/cobalt/timer.c
> +++ b/kernel/cobalt/timer.c
> @@ -578,15 +578,12 @@ EXPORT_SYMBOL_GPL(__xntimer_set_affinity);
>  
>  int xntimer_setup_ipi(void)
>  {
> -	return ipipe_request_irq(&xnsched_realtime_domain,
> -				 IPIPE_HRTIMER_IPI,
> -				 (ipipe_irq_handler_t)xnintr_core_clock_handler,
> -				 NULL, NULL);
> +	return pipeline_request_timer_ipi(xnintr_core_clock_handler);
>  }
>  
>  void xntimer_release_ipi(void)
>  {
> -	ipipe_free_irq(&xnsched_realtime_domain, IPIPE_HRTIMER_IPI);
> +	pipeline_free_timer_ipi();
>  }
>  
>  #endif /* CONFIG_SMP */
> 

Thanks, applied up to here (with the fixup of patch 1), just waiting for
feedback on my comments on patch 7 and beyond.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux


  reply	other threads:[~2021-01-08  9:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02  9:33 [PATCH Dovetail 00/13] Keep on abstracting the pipeline interface Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 01/13] cobalt/thread: pipeline: abstract threadinfo accessor Philippe Gerum
2021-01-08  9:02   ` Jan Kiszka
2021-01-02  9:33 ` [PATCH Dovetail 02/13] cobalt/apc: pipeline: abstract interface for deferred routine calls Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 03/13] cobalt/trace: pipeline: abstract trace calls Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 04/13] cobalt/lock: pipeline: abstract hard lock API Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 05/13] cobalt/kernel: pipeline: abstract execution stage predicates Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 06/13] cobalt/sched, clock: pipeline: abstract IPI management Philippe Gerum
2021-01-08  9:40   ` Jan Kiszka [this message]
2021-01-02  9:33 ` [PATCH Dovetail 07/13] cobalt/clock: pipeline: make HOSTRT depend on IPIPE Philippe Gerum
2021-01-07 13:52   ` Jan Kiszka
2021-01-09 10:45     ` Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 08/13] cobalt/build: pipeline: select IPIPE layer only if present Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 09/13] cobalt/clock: pipeline: abstract clock, timer access services Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 10/13] cobalt/wrappers: pipeline: abstract pipeline-related bits Philippe Gerum
2021-01-07 13:56   ` Jan Kiszka
2021-01-11 12:59   ` Jan Kiszka
2021-01-02  9:33 ` [PATCH Dovetail 11/13] cobalt/timer: pipeline: abstract tick management Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 12/13] cobalt/debug: pipeline: abstract panic prep call Philippe Gerum
2021-01-02  9:33 ` [PATCH Dovetail 13/13] cobalt/syscall: pipeline: abstract syscall entry points Philippe Gerum
2021-01-07 14:08   ` Jan Kiszka
2021-01-09 10:58     ` Philippe Gerum
2021-01-11 12:11       ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c2e91b7-2cbe-7eb4-56c5-fd9994825af1@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.