From: Eric Auger <eauger@redhat.com>
To: Shaoqin Huang <shahuang@redhat.com>, kvmarm@lists.linux.dev
Cc: Andrew Jones <andrew.jones@linux.dev>,
"open list:ARM" <kvm@vger.kernel.org>
Subject: Re: [RESEND kvm-unit-tests 2/3] arm64: timer: Use gic_enable/disable_irq() macro in timer test
Date: Thu, 2 Mar 2023 09:19:46 +0100 [thread overview]
Message-ID: <830e41b7-2e78-caff-7115-81be321bdad9@redhat.com> (raw)
In-Reply-To: <20230302030238.158796-3-shahuang@redhat.com>
On 3/2/23 04:02, Shaoqin Huang wrote:
> Use gic_enable/disable_irq() to clean up the code.
>
> Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Thanks
Eric
> ---
> arm/timer.c | 20 +++-----------------
> 1 file changed, 3 insertions(+), 17 deletions(-)
>
> diff --git a/arm/timer.c b/arm/timer.c
> index c4e7b10..c0a8388 100644
> --- a/arm/timer.c
> +++ b/arm/timer.c
> @@ -14,9 +14,6 @@
> #include <asm/gic.h>
> #include <asm/io.h>
>
> -static void *gic_isenabler;
> -static void *gic_icenabler;
> -
> static bool ptimer_unsupported;
>
> static void ptimer_unsupported_handler(struct pt_regs *regs, unsigned int esr)
> @@ -139,12 +136,12 @@ static struct timer_info ptimer_info = {
>
> static void set_timer_irq_enabled(struct timer_info *info, bool enabled)
> {
> - u32 val = 1 << PPI(info->irq);
> + u32 irq = PPI(info->irq);
>
> if (enabled)
> - writel(val, gic_isenabler);
> + gic_enable_irq(irq);
> else
> - writel(val, gic_icenabler);
> + gic_disable_irq(irq);
> }
>
> static void irq_handler(struct pt_regs *regs)
> @@ -366,17 +363,6 @@ static void test_init(void)
>
> gic_enable_defaults();
>
> - switch (gic_version()) {
> - case 2:
> - gic_isenabler = gicv2_dist_base() + GICD_ISENABLER;
> - gic_icenabler = gicv2_dist_base() + GICD_ICENABLER;
> - break;
> - case 3:
> - gic_isenabler = gicv3_sgi_base() + GICR_ISENABLER0;
> - gic_icenabler = gicv3_sgi_base() + GICR_ICENABLER0;
> - break;
> - }
> -
> install_irq_handler(EL1H_IRQ, irq_handler);
> set_timer_irq_enabled(&ptimer_info, true);
> set_timer_irq_enabled(&vtimer_info, true);
next prev parent reply other threads:[~2023-03-02 8:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-02 3:02 [RESEND kvm-unit-tests 0/3] arm: Use gic_enable/disable_irq() macro to clean up code Shaoqin Huang
2023-03-02 3:02 ` [RESEND kvm-unit-tests 1/3] arm: gic: Write one bit per time in gic_irq_set_clr_enable() Shaoqin Huang
2023-03-02 8:19 ` Eric Auger
2023-03-02 10:10 ` Shaoqin Huang
2023-03-02 3:02 ` [RESEND kvm-unit-tests 2/3] arm64: timer: Use gic_enable/disable_irq() macro in timer test Shaoqin Huang
2023-03-02 8:19 ` Eric Auger [this message]
2023-03-02 3:02 ` [RESEND kvm-unit-tests 3/3] arm64: microbench: Use gic_enable_irq() macro in microbench test Shaoqin Huang
2023-03-02 8:19 ` Eric Auger
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=830e41b7-2e78-caff-7115-81be321bdad9@redhat.com \
--to=eauger@redhat.com \
--cc=andrew.jones@linux.dev \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=shahuang@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox