Linux-MIPS Archive mirror
 help / color / mirror / Atom feed
From: maobibo <maobibo@loongson.cn>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	lvjianmin@loongson.cn
Subject: Re: [PATCH v4 2/3] irqchip/loongson-eiointc: Skip handling if there is no pending irq
Date: Tue, 30 Jan 2024 11:23:29 +0800	[thread overview]
Message-ID: <3d8cdc3a-415c-0f5a-d8d5-3fd2084926fc@loongson.cn> (raw)
In-Reply-To: <CAAhV-H7wBBx-8fVfRoujMUJuLbQWW2oKDbW6A52G2S_pqmTK6A@mail.gmail.com>



On 2024/1/29 下午8:27, Huacai Chen wrote:
> Hi, Bibo,
> 
> As commented in another patch, you can use eiointc_irq_dispatch(),
> iocsr_read64() to describe functions, and it is better to use
> Loongson-3A5000, Loongson-2K2000, Loongson-2K0500 rather than 3A5000,
> 2K2000, 2K0500. Besides, please always use IRQs rather than IRQS.
Huacai,

Thanks for reviewing.

Will do in next patch.

Regards
Bibo Mao
> 
> With these modifications,
> 
> Acked-by: Huacai Chen <chenhuacai@loongson.cn>
> 
> On Thu, Jan 25, 2024 at 7:36 PM Bibo Mao <maobibo@loongson.cn> wrote:
>>
>> It is one simple optimization in the interrupt dispatch function
>> eiointc_irq_dispatch. There are 256 IRQs supported for eiointc on
>> 3A5000 and 2K2000 platform, 128 IRQS on 2K0500 platform, eiointc irq
>> handler reads the bitmap and find pending irqs when irq happens. So
>> there are several consecutive iocsr_read64 operations for the all
>> bits to find all pending irqs. If the pending bitmap is zero, it
>> means that there is no pending irq for the this irq bitmap range,
>> we can skip handling to avoid some useless operations such as
>> clearing hw ISR.
>>
>> Signed-off-by: Bibo Mao <maobibo@loongson.cn>
>> ---
>>   drivers/irqchip/irq-loongson-eiointc.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c
>> index b3736bdd4b9f..6a71a8c29ac7 100644
>> --- a/drivers/irqchip/irq-loongson-eiointc.c
>> +++ b/drivers/irqchip/irq-loongson-eiointc.c
>> @@ -198,6 +198,12 @@ static void eiointc_irq_dispatch(struct irq_desc *desc)
>>
>>          for (i = 0; i < eiointc_priv[0]->vec_count / VEC_COUNT_PER_REG; i++) {
>>                  pending = iocsr_read64(EIOINTC_REG_ISR + (i << 3));
>> +
>> +               /* Skip handling if pending bitmap is zero */
>> +               if (!pending)
>> +                       continue;
>> +
>> +               /* Clear the IRQs */
>>                  iocsr_write64(pending, EIOINTC_REG_ISR + (i << 3));
>>                  while (pending) {
>>                          int bit = __ffs(pending);
>> --
>> 2.39.3
>>


  reply	other threads:[~2024-01-30  3:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 11:36 [PATCH v4 0/3] irqchip/loongson-eiointc: Refine irq affinity setting during resume Bibo Mao
2024-01-25 11:36 ` [PATCH v4 1/3] irqchip/loongson-eiointc: Typo fix in function eiointc_domain_alloc Bibo Mao
2024-01-29 12:23   ` Huacai Chen
2024-01-30  3:22     ` maobibo
2024-01-25 11:36 ` [PATCH v4 2/3] irqchip/loongson-eiointc: Skip handling if there is no pending irq Bibo Mao
2024-01-29 12:27   ` Huacai Chen
2024-01-30  3:23     ` maobibo [this message]
2024-01-25 11:36 ` [PATCH v4 3/3] irqchip/loongson-eiointc: Refine irq affinity setting during resume Bibo Mao

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=3d8cdc3a-415c-0f5a-d8d5-3fd2084926fc@loongson.cn \
    --to=maobibo@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=lvjianmin@loongson.cn \
    --cc=s.shtylyov@omp.ru \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).