From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796116174; b=aAPzGioBCaCouMqRjO522XxM/J/HX7DYgaNOIWc20hc+Yvoh3/Co1YVrHquQsYn+olJe cXc8z+kxFvhtvCuUhpaRNGmnjcJCPXcJCOyeBCLw58AU+J6fxLUkT3ALZbyQON5F6E22K T11R15DX6q2vQupnNOTlO7VI6Dqdrp/FOZkjsJINGfSmO4gwXd7mleseMOfFz7X0PBxW9 t1ELcSB8mstKtWgETFLfdJqycHEBa20+vL6Kp2sWk5Wvl35mTw+ZiETselgm6tEQd1q83 kgeAYXhtZXFwQDGFceg1opSusjh898glydM5BvR/uD7h7KJpnehriBZLQYWpIvfl0ww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796116174; h=DMARC-Filter:Date:DKIM-Signature:DKIM-Signature:From:Sender:Reply-to: To:Subject:Cc:In-Reply-To:References:MIME-Version:Message-ID:Robot-ID: Robot-Unsubscribe:Precedence:Content-Type:Content-Transfer-Encoding; bh=vBxcPrQLis9EcMuRm45XxzH9yIZAYRcmckcKbBPC0oY=; b=GDC6I4Tm1d3mXw7Sy8JimeDweWrT9oHnmJ5qw85SzdxdTrcoKGVF+OrAJuOIVK+aZvL+ TApJyohqIvA/laCt3XI5d+sUGsY6xla256wfCSf7xI2OVRYr/Lu8prTA2xakb+sY3YUEp tpKKWdvAgWChydmdx7CeT9yaCTHgtgxR+HzVYYysD0BE65uqd0H7i0VvbS7eWF5WD+PWI V7k0fBJsa7+FcX5rD1H+9UQr4lhiftJSFbnsnEibQG864aAz0ydInD4UxSfa2n0gAjZZ8 J43FGyHjKc8Px4v3TTuo06iPWn+fS0hrw7nWs4dTyHhKv0lx4jMQ0M+NKJfSziIDu4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=sBeVJ4lh; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b="PDehBl/h"; arc=none smtp.remote-ip=193.142.43.55 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2524606A327; Tue, 1 Dec 2026 09:09:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A2524606A327 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.a=rsa-sha256 header.s=2020 header.b=sBeVJ4lh; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=PDehBl/h Date: Tue, 01 Dec 2026 09:09:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1796116172; 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=vBxcPrQLis9EcMuRm45XxzH9yIZAYRcmckcKbBPC0oY=; b=sBeVJ4lhBQXhhNY9JcVrEDy5/LkIjfaKBQKGs9v3OBSYvPZTwEz+xdkMNCsk7UI4r5CTUA IsiYG1MEUrVpr+K9sxcSOb6Dj1+9hM1Tnz4ozz9G7RkP924QBB5hApvOKHoMFqYS0vIN8K kM8EkvhUBjbVdqmyatoZueSGxxSJ6BTojV0ceje8Vg7fxHa4z6IRw9Egm4tLa4vQykaGF+ vriaO8X94snPHfhBTMa+04pO0dYc114zuIzR5BD5x8//TmaoiXOiVQCR2SOBeFW6B2m/wN MHy65udlkoSatP+M3lwGoWCHBcNdX42jlU5c2xnm51JVyPDorJmqoEW3TgFoBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1796116172; 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=vBxcPrQLis9EcMuRm45XxzH9yIZAYRcmckcKbBPC0oY=; b=PDehBl/hOu49e31tet9YKJUCTpLj8nmOqtfksBAri+hf8TtmYKaEHZz3Ar9XBblizjpE2S duZx7jHu3ZMfW/Bg== From: "tip-bot2 for Peng Fan" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: irq/drivers] irqchip/imx-mu-msi: Fix PM domain teardown on probe errors Cc: Peng Fan , Thomas Gleixner , Frank Li , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20261115-imx-mu-msi-v1-2-8beb58854ca4@nxp.com> References: <20261115-imx-mu-msi-v1-2-8beb58854ca4@nxp.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-ID: <179611617026.1190409.6932480696964898460.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: a6a5715e837b821c2a6c86f2bb7d4d225e2540d3 Gitweb: https://git.kernel.org/tip/a6a5715e837b821c2a6c86f2bb7d4d225e2= 540d3 Author: Peng Fan AuthorDate: Sun, 15 Nov 2026 22:11:26 +08:00 Committer: Thomas Gleixner CommitterDate: Tue, 01 Dec 2026 10:05:24 +01:00 irqchip/imx-mu-msi: Fix PM domain teardown on probe errors dev_pm_domain_attach_by_name() creates a virtual device for each attached PM domain, which must be released with dev_pm_domain_detach(). The probe error paths only remove the device links, leaking both virtual devices. They also return -EINVAL instead of the actual error from imx_mu_msi_domains_init() and logs the wrong domain name when the link for the second domain cannot be created. Detach the PM domains on every failure path and propagate the real error code. Since the power-domains property is optional in the fsl,mu-msi binding, treat a NULL domain as "not present" and skip the corresponding device link rather than failing the probe. Fixes: 70afdab904d2 ("irqchip: Add IMX MU MSI controller driver") Signed-off-by: Peng Fan Signed-off-by: Thomas Gleixner Reviewed-by: Frank Li Link: https://patch.msgid.link/20261115-imx-mu-msi-v1-2-8beb58854ca4@nxp.com --- drivers/irqchip/irq-imx-mu-msi.c | 69 ++++++++++++++++++------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/drivers/irqchip/irq-imx-mu-msi.c b/drivers/irqchip/irq-imx-mu-ms= i.c index 3366fc4..2388f79 100644 --- a/drivers/irqchip/irq-imx-mu-msi.c +++ b/drivers/irqchip/irq-imx-mu-msi.c @@ -299,8 +299,8 @@ static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp =3D { static int imx_mu_probe(struct platform_device *pdev, struct device_node *pa= rent, const struct imx_mu_dcfg *cfg) { - struct device_link *pd_link_a; - struct device_link *pd_link_b; + struct device_link *pd_link_a =3D NULL; + struct device_link *pd_link_b =3D NULL; struct imx_mu_msi *msi_data; struct resource *res; struct device *pd_a; @@ -344,33 +344,38 @@ static int imx_mu_probe(struct platform_device *pdev, s= truct device_node *parent return PTR_ERR(pd_a); =20 pd_b =3D dev_pm_domain_attach_by_name(dev, "processor-b-side"); - if (IS_ERR(pd_b)) - return PTR_ERR(pd_b); - - pd_link_a =3D device_link_add(dev, pd_a, - DL_FLAG_STATELESS | - DL_FLAG_PM_RUNTIME | - DL_FLAG_RPM_ACTIVE); - - if (!pd_link_a) { - dev_err(dev, "Failed to add device_link to mu a.\n"); - goto err_pd_a; + if (IS_ERR(pd_b)) { + ret =3D PTR_ERR(pd_b); + goto err_detach_a; } =20 - pd_link_b =3D device_link_add(dev, pd_b, - DL_FLAG_STATELESS | - DL_FLAG_PM_RUNTIME | - DL_FLAG_RPM_ACTIVE); - + if (pd_a) { + pd_link_a =3D device_link_add(dev, pd_a, + DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | + DL_FLAG_RPM_ACTIVE); + if (!pd_link_a) { + dev_err(dev, "Failed to add device_link to mu a.\n"); + ret =3D -ENODEV; + goto err_detach; + } + } =20 - if (!pd_link_b) { - dev_err(dev, "Failed to add device_link to mu a.\n"); - goto err_pd_b; + if (pd_b) { + pd_link_b =3D device_link_add(dev, pd_b, + DL_FLAG_STATELESS | + DL_FLAG_PM_RUNTIME | + DL_FLAG_RPM_ACTIVE); + if (!pd_link_b) { + dev_err(dev, "Failed to add device_link to mu b.\n"); + ret =3D -ENODEV; + goto err_remove_link_a; + } } =20 ret =3D imx_mu_msi_domains_init(msi_data, dev); if (ret) - goto err_dm_init; + goto err_remove_links; =20 pm_runtime_enable(dev); =20 @@ -380,12 +385,20 @@ static int imx_mu_probe(struct platform_device *pdev, s= truct device_node *parent =20 return 0; =20 -err_dm_init: - device_link_remove(dev, pd_b); -err_pd_b: - device_link_remove(dev, pd_a); -err_pd_a: - return -EINVAL; +err_remove_links: + if (pd_link_b) + device_link_remove(dev, pd_b); +err_remove_link_a: + if (pd_link_a) + device_link_remove(dev, pd_a); +err_detach: + if (pd_b) + dev_pm_domain_detach(pd_b, true); +err_detach_a: + if (pd_a) + dev_pm_domain_detach(pd_a, true); + + return ret; } =20 static int __maybe_unused imx_mu_runtime_suspend(struct device *dev)