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 96BCE427A14; Mon, 29 Jun 2026 15:19:54 +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=1782746396; cv=none; b=Hn/TdP2RXP4UWuwuHp+iFpIfjyitU/IWBSXCulWL2qk3buqm2LFPCVbPjag3v9lp81OuPpRqbR502lKanActQiNRe06pyH+t7V89OydOtr2qtmGjlAW0GLwfIkbhwAcq1TzlRs6VpXDJbXo3uQ7amvUqA24OiNHU3zlR9oO9i44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782746396; c=relaxed/simple; bh=8wBWSfEY82l9CcG6kd+F2IVo7og+LCLueF5ZSI8e+70=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=g7mg7OCORx6axORw1CCXnpmduKkIT3I2T+FnBlymhyL3jl5pGjTsobvlgYkQ4E3aadiE4GT48YhBYUWDODRxZ3823kyvh9V9Aga8c7dNTDeb6FvaBtYm1w/FlQUS54NBk7UJLBXl/x4teVld5hpDAopuvT6afraZi0av0TUZvfw= 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=HZ2NnpVm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=60r0uGhq; 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="HZ2NnpVm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="60r0uGhq" Date: Mon, 29 Jun 2026 15:19:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1782746393; 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=WDSSU158Y2yktyt05PKg6z1GVDHxA+jzAswMGnuXTbU=; b=HZ2NnpVme5T21PtwiNERbvRK5Ya//OCL7RvXhnWnWRr3akuRL1qHfcriI4fHV0XB8+Z2X+ NLQ4/d9z/Do1qDSvPUYfSmTdI7Dwiq+JkxTIne9ET/8IwWYaYgzatEJfl/9wjd53VhYb7m tE4Z/5ZBkhulLiHsZ3f/NvZBKFhQYmnh45cKZvnGgp/8tD6ylhYT5stJx7b3Zwa+LzIPRE 4PslwwRPLcAoZufIBT3Dl2ZGFLRm8XCi7mrL7VhMqj2YkrSkN8dJdmX99Z6g6bVozvRyW7 cl3u0ayX50NJbtewNxtwZtwyK482UTr831WEV4jcP0TljxCkIDtuEvzv2/J0+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1782746393; 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=WDSSU158Y2yktyt05PKg6z1GVDHxA+jzAswMGnuXTbU=; b=60r0uGhquD2ckQMWtVfTXztK+Z6kCMIVQvo4FIS2c/9m4Xcb3xCl7QRv1ABXfIyD5yFUvw ttGGKhflL+hyuICA== 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: Add interrupt data structure Cc: Markus Stockhausen , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260605211646.2101652-4-markus.stockhausen@gmx.de> References: <20260605211646.2101652-4-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: <178274639167.3843924.17339598138811147227.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: 2568f6926c667e0b4ecf523cb4015acefc40409a Gitweb: https://git.kernel.org/tip/2568f6926c667e0b4ecf523cb4015acefc4= 0409a Author: Markus Stockhausen AuthorDate: Fri, 05 Jun 2026 23:16:42 +02:00 Committer: Thomas Gleixner CommitterDate: Mon, 29 Jun 2026 17:19:06 +02:00 irqchip/irq-realtek-rtl: Add interrupt data structure To prepare for multiple parent interrupt domains add an intermediate data structure. For now this will only host the link to the domain. Additionally adapt a deviating variable name to driver standard "hw_irq". Signed-off-by: Markus Stockhausen Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260605211646.2101652-4-markus.stockhausen@gm= x.de --- drivers/irqchip/irq-realtek-rtl.c | 48 +++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-realtek-rtl.c b/drivers/irqchip/irq-realtek-= rtl.c index 3b4508e..547f21d 100644 --- a/drivers/irqchip/irq-realtek-rtl.c +++ b/drivers/irqchip/irq-realtek-rtl.c @@ -25,6 +25,10 @@ =20 #define REG(cpu, x) (realtek_ictl_base[cpu] + x) =20 +struct realtek_ictl_output { + struct irq_domain *domain; +}; + static DEFINE_RAW_SPINLOCK(irq_lock); static void __iomem *realtek_ictl_base[NR_CPUS]; =20 @@ -125,11 +129,11 @@ static const struct irq_domain_ops irq_domain_ops =3D { =20 static void realtek_irq_dispatch(struct irq_desc *desc) { + struct realtek_ictl_output *output =3D irq_desc_get_handler_data(desc); struct irq_chip *chip =3D irq_desc_get_chip(desc); unsigned int cpu =3D smp_processor_id(); - struct irq_domain *domain; unsigned long pending; - unsigned int soc_int; + unsigned int hw_irq; =20 chained_irq_enter(chip, desc); pending =3D readl(REG(cpu, RTL_ICTL_GIMR)) & readl(REG(cpu, RTL_ICTL_GISR)); @@ -139,9 +143,8 @@ static void realtek_irq_dispatch(struct irq_desc *desc) goto out; } =20 - domain =3D irq_desc_get_handler_data(desc); - for_each_set_bit(soc_int, &pending, RTL_ICTL_NUM_INPUTS) - generic_handle_domain_irq(domain, soc_int); + for_each_set_bit(hw_irq, &pending, RTL_ICTL_NUM_INPUTS) + generic_handle_domain_irq(output->domain, hw_irq); =20 out: chained_irq_exit(chip, desc); @@ -149,10 +152,15 @@ out: =20 static int __init realtek_setup_parents(struct device_node *node) { - int parent_irq, num_parents =3D of_irq_count(node); + int err, parent_irq, num_parents =3D of_irq_count(node); + struct realtek_ictl_output *output; struct of_phandle_args oirq; struct irq_domain *domain; =20 + output =3D kcalloc(1, sizeof(*output), GFP_KERNEL); + if (!output) + return -ENOMEM; + if (WARN_ON(!num_parents)) { /* * If DT contains no parent interrupts, assume MIPS IRQ 2 (HW0) is @@ -160,8 +168,10 @@ static int __init realtek_setup_parents(struct device_no= de *node) */ oirq.np =3D of_find_compatible_node(NULL, NULL, "mti,cpu-interrupt-controller"); - if (!oirq.np) - return -EINVAL; + if (!oirq.np) { + err =3D -EINVAL; + goto err_out; + } =20 oirq.args_count =3D 1; oirq.args[0] =3D 2; @@ -171,17 +181,27 @@ static int __init realtek_setup_parents(struct device_n= ode *node) parent_irq =3D of_irq_get(node, 0); } =20 - if (parent_irq <=3D 0) - return parent_irq ? parent_irq : -ENODEV; + if (parent_irq <=3D 0) { + err =3D parent_irq ? parent_irq : -ENODEV; + goto err_out; + } =20 domain =3D irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_IN= PUTS, - &irq_domain_ops, NULL); - if (!domain) - return -ENOMEM; + &irq_domain_ops, output); + if (!domain) { + err =3D -ENOMEM; + goto err_out; + } =20 - irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, domain); + output->domain =3D domain; + irq_set_chained_handler_and_data(parent_irq, realtek_irq_dispatch, output); =20 return 0; + +err_out: + kfree(output); + + return err; } =20 static int __init realtek_rtl_of_init(struct device_node *node, struct devic= e_node *parent)