public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaoqin Huang <shahuang@redhat.com>
To: eric.auger@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 1/3] arm: gic: Write one bit per time in gic_irq_set_clr_enable()
Date: Thu, 2 Mar 2023 18:10:37 +0800	[thread overview]
Message-ID: <ba22acfd-b1a5-626b-c1e7-e1268dc5ab7d@redhat.com> (raw)
In-Reply-To: <a9799d3b-e7c5-89fd-a910-b574cff67913@redhat.com>

Hi Eric,

On 3/2/23 16:19, Eric Auger wrote:
> Hi Shaoqin,
> 
> On 3/2/23 04:02, Shaoqin Huang wrote:
>> When use gic_irq_set_clr_enable() to disable an interrupt, it will
>> disable all interrupt since it first read from Interrupt Clear-Enable
>> Registers and then write this value with a mask back.
> 
> nit: it first read from Interrupt Clear-Enable Registers where '1' indicates that forwarding of the corresponding interrupt is enabled
> 

Thanks for your advice.

>>
>> So diretly write one bit per time to enable or disable interrupt.
> directly

I will fix it in v2.

Thanks,

>> Fixes: cb573c2 ("arm: gic: Introduce gic_irq_set_clr_enable() helper")
>> Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> 
> Thanks
> 
> Eirc
>> ---
>>   lib/arm/gic.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/lib/arm/gic.c b/lib/arm/gic.c
>> index 1bfcfcf..89a15fe 100644
>> --- a/lib/arm/gic.c
>> +++ b/lib/arm/gic.c
>> @@ -176,7 +176,6 @@ void gic_ipi_send_mask(int irq, const cpumask_t *dest)
>>   void gic_irq_set_clr_enable(int irq, bool enable)
>>   {
>>   	u32 offset, split = 32, shift = (irq % 32);
>> -	u32 reg, mask = BIT(shift);
>>   	void *base;
>>   
>>   	assert(irq < 1020);
>> @@ -199,8 +198,7 @@ void gic_irq_set_clr_enable(int irq, bool enable)
>>   		assert(0);
>>   	}
>>   	base += offset + (irq / split) * 4;
>> -	reg = readl(base);
>> -	writel(reg | mask, base);
>> +	writel(BIT(shift), base);
>>   }
>>   
>>   enum gic_irq_state gic_irq_state(int irq)
> 

-- 
Shaoqin


  reply	other threads:[~2023-03-02 10:11 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 [this message]
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
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=ba22acfd-b1a5-626b-c1e7-e1268dc5ab7d@redhat.com \
    --to=shahuang@redhat.com \
    --cc=andrew.jones@linux.dev \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    /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