From nobody Thu Apr 2 15:44:01 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C115A33D6D6 for ; Sat, 28 Mar 2026 15:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774712389; cv=none; b=DWG/luDe7jlpF3zhxHl0Eqqi1W2qlxorpXEDRuYIevRhxXamJYnWwsbEuM05u4XCr1sqbMUBB4EtWKj9ejlCwx8ne7DrMxQzN0oQfOWSbR1AhUDqjQLY+aGsrvr/JyG82Lp3Exrw1Q9tI6rg5f8pkbdBJahXbmhz4KkisNLuBeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774712389; c=relaxed/simple; bh=zIXN1eOSFxHm08xg/0aS9h67G1NP0b1qZaBd3UKNS2c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NrMt744sml7Y4P6x7qkWrn7mtXPRRy9UwAzq69q3WGpddeZcpfxGvsQTIJ1HiMoo/QbLYlSdxQcavcrzIItQNk1K7Ccm6NsLS10rtZkXsD3oYmrg/u91w6Ddp+8BIASWoP9baKyOSrS8jOdaJynsOGLVe1mFaYmTCJnIV+ySzHw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OitaHm9F; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OitaHm9F" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-48540d21f7dso35299685e9.0 for ; Sat, 28 Mar 2026 08:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774712386; x=1775317186; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5/W97cpYOeY9DEXDRzpvu8BXZnfFoUWnEBDpZGzN5QQ=; b=OitaHm9FEuVQg63ZUlUIZnsL37ikiKGUNcfsVUJZg++bdiY9Gal2+lF5p5Y1nv9ztW 1D+UpIgL2PTROuWjTJmhN0nJnNDD3KdwU90BWsHAsiBhMKAb4K6LXdjO6zyZHywBdm7w SXGLNd4Q/Vt/5+55/tRVGq7lXuuHpu1nfS49EF2Y2hofC4f2ZAAX9aClf/gL7rgJvMlj 6YXi7U9gr4tlEhyIllsne/j/sMJgNEB+ru92vuck55YbBdhjxft3JSfnhEDupzjjDEUV WSKY6bSlgqv5O8PafQlEJWtQXAw3OSRE+sa04c/MurpQrLB+lzWO6VcVWPrf8R4g5vrv iBlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774712386; x=1775317186; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5/W97cpYOeY9DEXDRzpvu8BXZnfFoUWnEBDpZGzN5QQ=; b=FAGUC+SMhI1h2TEeRw/nM8ysWZqyfQpDms2bj0i4TZT31sUhXJgLrrk7wmDH1Ks5Wt 1z6IFcoS3xd/agjoNpZbFfD43zzQC0GYAPenwHdqgYyjs712je6aZD8JALT31lEZDbGu LUAKjm7mEBnulLi+5P2zrKZ6GqIs7uy5TFO19PXcU+tKBwK+m7mywB64ix1CMxlJUSxa rSJXKptNhQoKUjgQax228mCqwfJDu7D+M2gLegmUw0ZAzd2mnUDkmwOwG4dUWEn5o+uA VVTilFVmnPeWpNOH0WLW8s33UhK75Sfs+GdkfhUwW2V0xkheW9h8+vdTjmTFRzf3dYbk SZ2Q== X-Forwarded-Encrypted: i=1; AJvYcCXWxZg8NCUXRXF8oUrjyR3pQXXrhMC03anypbbKBPkNlIWCGqTQzitMKQtzObb8v/Q41DEjU6T2kQWKA48=@vger.kernel.org X-Gm-Message-State: AOJu0YyymkLSaxBmRv42l7lRP2sAFh6IZ5BeuxgDi2H6+gz71fJ35Uf2 LtFNL+woGwR/fFkaSzqALA0Dd5Gl7OhB2upMN/j2Ty+NQBfBhtW0aujCzlHgrQ== X-Gm-Gg: ATEYQzwKEyjpUH2gxvkDy+24oiByBf+QjRZwbvG7dC5JkW2oHL22T8AUmYQ1MjvtW8j mvJ5phFNZCDM5E74u7bEx1JoHStunu2VM94KI0+kkMbXlAmSJLW4vAkWzXvRlhpeYRzQTG69+P7 DAXwjqdggF6yE7iLgOCBIT4ZxgWtSMwVC9g997se2KXmuKYFWz4BkjiMx9RuPNmKen+loRNieiq OCdIJKCvjgmZhmNdvpYoYct+dg9M5SJ6z5M/SCuV8p97EalTI3xbe+bqJMld0K3rFCZ6+WnRYqt 9rx1FFemHbNrjf4AzAYDWc/cQ9z4YSSLuQ7yEHPT524R5vL7ze2huQSNIENZ2aSz6fzbIfZ1E8C l8dCbps5j//EOEErCPlISN3wHLp4i8SvnAFITbHsjI5ARbHAwp0jq0gs31/F7oTm3rpzt+unIMt yHOheC5xxeeR3GTJ+MVdm52KUyJMIGZWW/8TSEVkrudmaGhGu9 X-Received: by 2002:a05:600c:1d15:b0:483:703e:4ad9 with SMTP id 5b1f17b1804b1-48727ee9b10mr91444565e9.19.1774694007925; Sat, 28 Mar 2026 03:33:27 -0700 (PDT) Received: from localhost.localdomain ([2a00:23c4:a758:8a01:8a55:5310:98fe:930d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-487270fd880sm42270035e9.8.2026.03.28.03.33.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2026 03:33:27 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Thomas Gleixner Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 1/3] irqchip/renesas-rzg2l: Fix shared IRQ bit not cleared on free Date: Sat, 28 Mar 2026 10:33:18 +0000 Message-ID: <20260328103324.134131-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260328103324.134131-1-biju.das.jz@bp.renesas.com> References: <20260328103324.134131-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Calling irq_domain_free_irqs_common() internally calls irq_domain_reset_irq_data(), which explicitly sets irq_data->hwirq to 0. Consequently, irqd_to_hwirq(d) returns 0 when called after it. Since 0 falls outside the valid shared IRQ ranges, rzg2l_irqc_is_shared_and_get_irq_num() evaluates to false, completely bypassing the test_and_clear_bit() operation. This leaves the bit set in priv->used_irqs, causing future allocations to fail with -EBUSY. Fix this by retrieving irq_data and caching hwirq before calling irq_domain_free_irqs_common(). Signed-off-by: Biju Das --- drivers/irqchip/irq-renesas-rzg2l.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-rene= sas-rzg2l.c index f5c4d7e0aec3..3cc1efd8d914 100644 --- a/drivers/irqchip/irq-renesas-rzg2l.c +++ b/drivers/irqchip/irq-renesas-rzg2l.c @@ -699,15 +699,14 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain= , unsigned int virq, =20 static void rzg2l_irqc_free(struct irq_domain *domain, unsigned int virq, = unsigned int nr_irqs) { + struct irq_data *d =3D irq_domain_get_irq_data(domain, virq); struct rzg2l_irqc_priv *priv =3D domain->host_data; + irq_hw_number_t hwirq =3D irqd_to_hwirq(d); =20 irq_domain_free_irqs_common(domain, virq, nr_irqs); =20 - if (priv->info.shared_irq_cnt) { - struct irq_data *d =3D irq_domain_get_irq_data(domain, virq); - - rzg2l_irqc_shared_irq_free(priv, irqd_to_hwirq(d)); - } + if (priv->info.shared_irq_cnt) + rzg2l_irqc_shared_irq_free(priv, hwirq); } =20 static const struct irq_domain_ops rzg2l_irqc_domain_ops =3D { --=20 2.43.0