From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69EE0428852; Mon, 29 Jun 2026 15:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782746397; cv=none; b=VPLc7vbkVsCqQu41npM7/5KQgWz098kiC6Ebbkia5X7Df/Odype62bkRKVTkGS8lmaPMbf8+NEXYC1VzfM972pOfvFRxlyeTjHDl2dORPwfErBh3kqqNmNU02W+DYlNYhk/QGlRo39ghrr9IVp12CxQ4oCGlbFmBDATqHGtbXGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782746397; c=relaxed/simple; bh=EsCVQwjHOxObuyHj4hTqeGV+vKSQzg5tXQMVpdAk94k=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=pWhf+2NlrZx3zC54UHyf0YHZ2TeGwv0Ros7cWCmzcCgXgVGLQEU2Nj/qIuG7fKGOn1wpP6BJ6A231ULRdVOCFVfO0k8/p1PCb44iTjstp2NdIAp98MqMcYUfehO9UbxIs8GelD9kXC3zRWq4PdqwV0J61nw88K4z/2kv+ucKzGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Ml4u7wSv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Fqy8m4ZY; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ml4u7wSv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Fqy8m4ZY" Date: Mon, 29 Jun 2026 15:19:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1782746394; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pMbcuaARKATwGFkrn1SHpkO+CfesrjnF86h6P5+vTzY=; b=Ml4u7wSvZhAne2LOrpQiOKYR+ttAd8aOW6j/YX/4aeVa4I4/5h6njWr4J4l5LPxNzLD5HF yvZDYwDWAbUXTThAafowugs+usub7Qvp1ePapzMMShLrf1Mhry4SSD4Rv2Z0BQJXANiLIe 3DfV8heeTmmGIfviBPclzCSjspB/wxRAKqNkSn0o6qWPV/TzFGR4P1RahOaJLP2PihutM9 mixD1nAnNEKEsNA3gNZUjN/g4iWstP45WsCmngXImyOQIUn9EbQyY6G0CbOvYeJ1vosJLe YME1vNSCzZgFB6WLnM9GJuGifGJEaeotyJRoEEq6CJydPsyhGUdO7BYfwT05SQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1782746394; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pMbcuaARKATwGFkrn1SHpkO+CfesrjnF86h6P5+vTzY=; b=Fqy8m4ZYR1UnIn9zFMsrlUpdp/biJq9SmFj8Ssry4DkOOA28tsZAfqiGjRU9kMHrzpdF6e RlGZiwqrYkm0gjBw== From: "tip-bot2 for Markus Stockhausen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/drivers] irqchip/irq-realtek-rtl: Split out parent setup code Cc: Markus Stockhausen , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260605211646.2101652-3-markus.stockhausen@gmx.de> References: <20260605211646.2101652-3-markus.stockhausen@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178274639290.3843924.5225402144517229325.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the irq/drivers branch of tip: Commit-ID: d36c1d1657113fcf442c50e074593d7b712bada1 Gitweb: https://git.kernel.org/tip/d36c1d1657113fcf442c50e074593d7b712= bada1 Author: Markus Stockhausen AuthorDate: Fri, 05 Jun 2026 23:16:41 +02:00 Committer: Thomas Gleixner CommitterDate: Mon, 29 Jun 2026 17:19:06 +02:00 irqchip/irq-realtek-rtl: Split out parent setup code The parent interrupt setup will be extended to support multiple parents. To prepare for that, relocate the code into a separate helper. Although it still works only for a single interrupt prepare the coding so it can be easily extended with a loop for multi parent support. For this reduce the line lengths so that the upcoming indentation still leaves the width below 100 characters. Signed-off-by: Markus Stockhausen Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260605211646.2101652-3-markus.stockhausen@gm= x.de --- drivers/irqchip/irq-realtek-rtl.c | 60 ++++++++++++++++-------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/drivers/irqchip/irq-realtek-rtl.c b/drivers/irqchip/irq-realtek-= rtl.c index 2ae3be7..3b4508e 100644 --- a/drivers/irqchip/irq-realtek-rtl.c +++ b/drivers/irqchip/irq-realtek-rtl.c @@ -147,48 +147,35 @@ out: chained_irq_exit(chip, desc); } =20 -static int __init realtek_rtl_of_init(struct device_node *node, struct devic= e_node *parent) +static int __init realtek_setup_parents(struct device_node *node) { + int parent_irq, num_parents =3D of_irq_count(node); struct of_phandle_args oirq; struct irq_domain *domain; - int cpu, parent_irq; =20 - for_each_present_cpu(cpu) { - realtek_ictl_base[cpu] =3D of_iomap(node, cpu); - if (!realtek_ictl_base[cpu]) - return -ENXIO; - - /* Disable all cascaded interrupts and clear routing */ - for (unsigned int hw_irq =3D 0; hw_irq < RTL_ICTL_NUM_INPUTS; hw_irq++) { - disable_gimr(cpu, hw_irq); - write_irr(cpu, hw_irq, 0); - } - } - - if (WARN_ON(!of_irq_count(node))) { + if (WARN_ON(!num_parents)) { /* - * If DT contains no parent interrupts, assume MIPS CPU IRQ 2 - * (HW0) is connected to the first output. This is the case for - * all known hardware anyway. "interrupt-map" is deprecated, so - * don't bother trying to parse that. + * If DT contains no parent interrupts, assume MIPS IRQ 2 (HW0) is + * connected to the first output. This is the case for all known hardware. */ - oirq.np =3D of_find_compatible_node(NULL, NULL, "mti,cpu-interrupt-control= ler"); + oirq.np =3D of_find_compatible_node(NULL, NULL, + "mti,cpu-interrupt-controller"); + if (!oirq.np) + return -EINVAL; + oirq.args_count =3D 1; oirq.args[0] =3D 2; - parent_irq =3D irq_create_of_mapping(&oirq); - of_node_put(oirq.np); } else { parent_irq =3D of_irq_get(node, 0); } =20 - if (parent_irq < 0) - return parent_irq; - else if (!parent_irq) - return -ENODEV; + if (parent_irq <=3D 0) + return parent_irq ? parent_irq : -ENODEV; =20 - domain =3D irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_IN= PUTS, &irq_domain_ops, NULL); + domain =3D irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_IN= PUTS, + &irq_domain_ops, NULL); if (!domain) return -ENOMEM; =20 @@ -197,4 +184,23 @@ static int __init realtek_rtl_of_init(struct device_node= *node, struct device_no return 0; } =20 +static int __init realtek_rtl_of_init(struct device_node *node, struct devic= e_node *parent) +{ + unsigned int cpu; + + for_each_present_cpu(cpu) { + realtek_ictl_base[cpu] =3D of_iomap(node, cpu); + if (!realtek_ictl_base[cpu]) + return -ENXIO; + + /* Disable all cascaded interrupts and clear routing */ + for (unsigned int hw_irq =3D 0; hw_irq < RTL_ICTL_NUM_INPUTS; hw_irq++) { + disable_gimr(cpu, hw_irq); + write_irr(cpu, hw_irq, 0); + } + } + + return realtek_setup_parents(node); +} + IRQCHIP_DECLARE(realtek_rtl_intc, "realtek,rtl-intc", realtek_rtl_of_init);