mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Huacai Chen" <chenhuacai@loongson.cn>,
	"Thomas Gleixner" <tglx@linutronix.de>
Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
	"Xuefeng Li" <lixuefeng@loongson.cn>,
	"Huacai Chen" <chenhuacai@gmail.com>,
	"Miao Wang" <shankerwangmiao@gmail.com>
Subject: Re: [PATCH] irqchip/loongarch-cpu: Fix return value of lpic_gsi_to_irq()
Date: Tue, 23 Jul 2024 14:46:47 +0800	[thread overview]
Message-ID: <46775654-4c2c-4048-9f1d-bd464bbca25e@app.fastmail.com> (raw)
In-Reply-To: <20240723064508.35560-1-chenhuacai@loongson.cn>



在2024年7月23日七月 下午2:45,Huacai Chen写道:
> lpic_gsi_to_irq() should return a valid irq if acpi_register_gsi()
> succeed, and return 0 otherwise. But now lpic_gsi_to_irq() converts
> a negative return value of acpi_register_gsi() to a positive value
> silently, so fix it.
>
> Reported-by: Miao Wang <shankerwangmiao@gmail.com>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>

> ---
>  drivers/irqchip/irq-loongarch-cpu.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-loongarch-cpu.c 
> b/drivers/irqchip/irq-loongarch-cpu.c
> index 9d8f2c406043..b35903a06902 100644
> --- a/drivers/irqchip/irq-loongarch-cpu.c
> +++ b/drivers/irqchip/irq-loongarch-cpu.c
> @@ -18,11 +18,13 @@ struct fwnode_handle *cpuintc_handle;
> 
>  static u32 lpic_gsi_to_irq(u32 gsi)
>  {
> +	int irq = 0;
> +
>  	/* Only pch irqdomain transferring is required for LoongArch. */
>  	if (gsi >= GSI_MIN_PCH_IRQ && gsi <= GSI_MAX_PCH_IRQ)
> -		return acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH);
> +		irq = acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH);
> 
> -	return 0;
> +	return (irq > 0) ? irq : 0;
>  }
> 
>  static struct fwnode_handle *lpic_get_gsi_domain_id(u32 gsi)
> -- 
> 2.43.5

-- 
- Jiaxun

  reply	other threads:[~2024-07-23  6:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23  6:45 Huacai Chen
2024-07-23  6:46 ` Jiaxun Yang [this message]
2024-07-26 19:17 ` [tip: irq/urgent] " tip-bot2 for Huacai Chen

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=46775654-4c2c-4048-9f1d-bd464bbca25e@app.fastmail.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhuacai@gmail.com \
    --cc=chenhuacai@loongson.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=shankerwangmiao@gmail.com \
    --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

all inboxes | Powered by JetHome®