All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xu Qiang <xuqiang36@huawei.com>
To: <maz@kernel.org>, <tglx@linutronix.de>
Cc: <linux-kernel@vger.kernel.org>, <xuqiang36@huawei.com>,
	<weiyongjun1@huawei.com>, <guohanjun@huawei.com>
Subject: [PATCH v2 -next 1/2] irqdomain: Fix an issue where the Linux IRQ number is not stored
Date: Tue, 19 Jul 2022 06:36:40 +0000	[thread overview]
Message-ID: <20220719063641.56541-2-xuqiang36@huawei.com> (raw)
In-Reply-To: <20220719063641.56541-1-xuqiang36@huawei.com>

When using a NOMAP domain, __irq_resolve_mapping() doesn't store
the Linux IRQ number at the address optionally provided by the caller.
While this isn't a huge deal (the returned value is guaranteed
to the hwirq that was passed as a parameter), let's honour the letter
of the API by writing the expected value.

Fixes: d22558dd0a6c (“irqdomain: Introduce irq_resolve_mapping()”)
Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
---
 kernel/irq/irqdomain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index d5ce96510549..481abb885d61 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -910,6 +910,8 @@ struct irq_desc *__irq_resolve_mapping(struct irq_domain *domain,
 			data = irq_domain_get_irq_data(domain, hwirq);
 			if (data && data->hwirq == hwirq)
 				desc = irq_data_to_desc(data);
+			if (irq && desc)
+				*irq = hwirq;
 		}
 
 		return desc;
-- 
2.17.1


  reply	other threads:[~2022-07-19  6:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19  6:36 [PATCH v2 -next 0/2] Fix a bug and commit a code optimization Xu Qiang
2022-07-19  6:36 ` Xu Qiang [this message]
2022-07-19 13:55   ` [irqchip: irq/irqchip-next] irqdomain: Report irq number for NOMAP domains irqchip-bot for Xu Qiang
2022-07-19  6:36 ` [PATCH v2 -next 2/2] irqdomain: Replace revmap_direct_max_irq field with hwirq_max field Xu Qiang
2022-07-19 10:23   ` Marc Zyngier
2022-07-19 13:44     ` xuqiang (M)
2022-07-19 13:55   ` [irqchip: irq/irqchip-next] irqdomain: Use hwirq_max instead of revmap_size for NOMAP domains irqchip-bot for Xu Qiang

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=20220719063641.56541-2-xuqiang36@huawei.com \
    --to=xuqiang36@huawei.com \
    --cc=guohanjun@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=weiyongjun1@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.