From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Alexander Sverdlin <alexander.sverdlin@nokia.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Sasha Levin <sashal@kernel.org>,
maz@kernel.org, mikelley@microsoft.com, samuel@sholland.org,
Julia.Lawall@inria.fr, rikard.falkeborn@gmail.com,
mark.rutland@arm.com, linux-mips@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 11/12] MIPS: OCTEON: irq: Fix octeon_irq_force_ciu_mapping()
Date: Wed, 14 Sep 2022 05:04:04 -0400 [thread overview]
Message-ID: <20220914090407.471328-11-sashal@kernel.org> (raw)
In-Reply-To: <20220914090407.471328-1-sashal@kernel.org>
From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
[ Upstream commit ba912afbd611d3a5f22af247721a071ad1d5b9e0 ]
For irq_domain_associate() to work the virq descriptor has to be
pre-allocated in advance. Otherwise the following happens:
WARNING: CPU: 0 PID: 0 at .../kernel/irq/irqdomain.c:527 irq_domain_associate+0x298/0x2e8
error: virq128 is not allocated
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.78-... #1
...
Call Trace:
[<ffffffff801344c4>] show_stack+0x9c/0x130
[<ffffffff80769550>] dump_stack+0x90/0xd0
[<ffffffff801576d0>] __warn+0x118/0x130
[<ffffffff80157734>] warn_slowpath_fmt+0x4c/0x70
[<ffffffff801b83c0>] irq_domain_associate+0x298/0x2e8
[<ffffffff80a43bb8>] octeon_irq_init_ciu+0x4c8/0x53c
[<ffffffff80a76cbc>] of_irq_init+0x1e0/0x388
[<ffffffff80a452cc>] init_IRQ+0x4c/0xf4
[<ffffffff80a3cc00>] start_kernel+0x404/0x698
Use irq_alloc_desc_at() to avoid the above problem.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/cavium-octeon/octeon-irq.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 3ad1f76c063a9..2d5e7b21d9600 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -127,6 +127,16 @@ static void octeon_irq_free_cd(struct irq_domain *d, unsigned int irq)
static int octeon_irq_force_ciu_mapping(struct irq_domain *domain,
int irq, int line, int bit)
{
+ struct device_node *of_node;
+ int ret;
+
+ of_node = irq_domain_get_of_node(domain);
+ if (!of_node)
+ return -EINVAL;
+ ret = irq_alloc_desc_at(irq, of_node_to_nid(of_node));
+ if (ret < 0)
+ return ret;
+
return irq_domain_associate(domain, irq, line << 6 | bit);
}
--
2.35.1
next prev parent reply other threads:[~2022-09-14 9:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 9:03 [PATCH AUTOSEL 5.4 01/12] ASoC: nau8824: Fix semaphore unbalance at error paths Sasha Levin
2022-09-14 9:03 ` Sasha Levin
2022-09-14 9:03 ` [PATCH AUTOSEL 5.4 02/12] regulator: pfuze100: Fix the global-out-of-bounds access in pfuze100_regulator_probe() Sasha Levin
2022-09-14 9:03 ` [PATCH AUTOSEL 5.4 03/12] rxrpc: Fix local destruction being repeated Sasha Levin
2022-09-14 9:03 ` [PATCH AUTOSEL 5.4 04/12] rxrpc: Fix calc of resend age Sasha Levin
2022-09-14 9:03 ` [PATCH AUTOSEL 5.4 05/12] ALSA: hda/sigmatel: Keep power up while beep is enabled Sasha Levin
2022-09-14 9:03 ` Sasha Levin
2022-09-14 9:03 ` [PATCH AUTOSEL 5.4 06/12] ALSA: hda/tegra: Align BDL entry to 4KB boundary Sasha Levin
2022-09-14 9:03 ` Sasha Levin
2022-09-14 9:04 ` [PATCH AUTOSEL 5.4 07/12] ALSA: usb-audio: Fix an out-of-bounds bug in __snd_usb_parse_audio_interface() Sasha Levin
2022-09-14 9:04 ` Sasha Levin
2022-09-14 9:04 ` [PATCH AUTOSEL 5.4 08/12] net: usb: qmi_wwan: add Quectel RM520N Sasha Levin
2022-09-14 9:04 ` [PATCH AUTOSEL 5.4 09/12] afs: Return -EAGAIN, not -EREMOTEIO, when a file already locked Sasha Levin
2022-09-14 9:04 ` [PATCH AUTOSEL 5.4 10/12] scsi: mpt3sas: Fix use-after-free warning Sasha Levin
2022-09-14 9:04 ` Sasha Levin [this message]
2022-09-14 9:04 ` [PATCH AUTOSEL 5.4 12/12] mksysmap: Fix the mismatch of 'L0' symbols in System.map Sasha Levin
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=20220914090407.471328-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Julia.Lawall@inria.fr \
--cc=alexander.sverdlin@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=mikelley@microsoft.com \
--cc=rikard.falkeborn@gmail.com \
--cc=samuel@sholland.org \
--cc=stable@vger.kernel.org \
--cc=tsbogend@alpha.franken.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 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.