Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1594232

Re: [PATCH 07/17] arm64: arch_timer: Rework the set_next_event workarounds

From Hanjun Guo <hanjun.guo@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 07/17] arm64: arch_timer: Rework the set_next_event workarounds
Date 2017-03-07 14:30 +0100
Message-ID <tinlD-83G-5@gated-at.bofh.it> (permalink)
References <thYZX-7uY-5@gated-at.bofh.it> <thZ9F-7yu-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2017/3/6 19:26, Marc Zyngier wrote:
> The way we work around errata affecting set_next_event is not very
> nice, at it imposes this workaround on errata that do not need it.
>
> Add new workaround hooks and let the existing workarounds use them.
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm64/include/asm/arch_timer.h  |  4 ++++
>  drivers/clocksource/arm_arch_timer.c | 32 ++++++++++++++++++++++++++------
>  2 files changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
> index f841e08a0dfc..a5ed4cd2e972 100644
> --- a/arch/arm64/include/asm/arch_timer.h
> +++ b/arch/arm64/include/asm/arch_timer.h
> @@ -43,6 +43,8 @@ enum arch_timer_erratum_match_type {
>  	ate_match_local_cap_id,
>  };
>
> +struct clock_event_device;
> +
>  struct arch_timer_erratum_workaround {
>  	enum arch_timer_erratum_match_type match_type;
>  	const void *id;		/* Indicate the Erratum ID */
> @@ -50,6 +52,8 @@ struct arch_timer_erratum_workaround {
>  	u32 (*read_cntp_tval_el0)(void);
>  	u32 (*read_cntv_tval_el0)(void);
>  	u64 (*read_cntvct_el0)(void);
> +	int (*set_next_event_phys)(unsigned long, struct clock_event_device *);
> +	int (*set_next_event_virt)(unsigned long, struct clock_event_device *);
>  };
>
>  extern const struct arch_timer_erratum_workaround *timer_unstable_counter_workaround;
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index 3e5f9539c0c0..ac0ddb380d3a 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -282,6 +282,8 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
>  		.read_cntp_tval_el0 = fsl_a008585_read_cntp_tval_el0,
>  		.read_cntv_tval_el0 = fsl_a008585_read_cntv_tval_el0,
>  		.read_cntvct_el0 = fsl_a008585_read_cntvct_el0,
> +		.set_next_event_phys = erratum_set_next_event_tval_phys,
> +		.set_next_event_virt = erratum_set_next_event_tval_virt,
>  	},
>  #endif
>  #ifdef CONFIG_HISILICON_ERRATUM_161010101
> @@ -292,6 +294,8 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = {
>  		.read_cntp_tval_el0 = hisi_161010101_read_cntp_tval_el0,
>  		.read_cntv_tval_el0 = hisi_161010101_read_cntv_tval_el0,
>  		.read_cntvct_el0 = hisi_161010101_read_cntvct_el0,
> +		.set_next_event_phys = erratum_set_next_event_tval_phys,
> +		.set_next_event_virt = erratum_set_next_event_tval_virt,
>  	},
>  #endif
>  };
> @@ -384,10 +388,22 @@ static void arch_timer_check_ool_workaround(enum arch_timer_erratum_match_type t
>  		local ? "local" : "global", wa->desc_str);
>  }
>
> +#define erratum_handler(fn, r, ...)					\
> +({									\
> +  	bool __val;		

Just noticed spaces before bool.

Thanks
Hanjun

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/17] clocksource/arch_timer: Errara workaround infrastructure rework Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
  [PATCH 05/17] arm64: arch_timer: Move arch_timer_reg_read/write around Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
  [PATCH 01/17] arm64: arch_timer: Add infrastructure for multiple erratum detection methods Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
    Re: [PATCH 01/17] arm64: arch_timer: Add infrastructure for multiple  erratum detection methods Hanjun Guo <hanjun.guo@linaro.org> - 2017-03-07 18:00 +0100
  [PATCH 04/17] arm64: arch_timer: Add erratum handler for CPU-specific capability Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
  [PATCH 07/17] arm64: arch_timer: Rework the set_next_event workarounds Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
    Re: [PATCH 07/17] arm64: arch_timer: Rework the set_next_event  workarounds Hanjun Guo <hanjun.guo@linaro.org> - 2017-03-07 14:30 +0100
  [PATCH 06/17] arm64: arch_timer: Get rid of erratum_workaround_set_sne Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
  [PATCH 13/17] arm64: cpu_errata: Allow an erratum to be match for all revisions of a core Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
  [PATCH 08/17] arm64: arch_timer: Make workaround methods optional Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
  [PATCH 02/17] arm64: arch_timer: Add erratum handler for globally defined capability Marc Zyngier <marc.zyngier@arm.com> - 2017-03-06 12:40 +0100
  Re: [PATCH 00/17] clocksource/arch_timer: Errara workaround  infrastructure rework dann frazier <dann.frazier@canonical.com> - 2017-03-06 23:10 +0100
  Re: [PATCH 00/17] clocksource/arch_timer: Errara workaround  infrastructure rework Hanjun Guo <hanjun.guo@linaro.org> - 2017-03-07 14:30 +0100

csiph-web