Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4518C64ED6 for ; Thu, 9 Feb 2023 13:30:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230221AbjBINar (ORCPT ); Thu, 9 Feb 2023 08:30:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbjBINao (ORCPT ); Thu, 9 Feb 2023 08:30:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D456A23C66; Thu, 9 Feb 2023 05:30:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5E37861A51; Thu, 9 Feb 2023 13:30:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC8A9C433EF; Thu, 9 Feb 2023 13:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675949442; bh=m6miDDXDPE0i8gfLkqlExqia0yJKU93vQt0xdTn6QTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sa/KsdyjZtn4lNGlYVyABiISMRaa4wwQBRmFtr+M+MjPvP8y+PRzLXqo89kivIomd S/PCuMrHmTTouqFOVc51sYPzkBJAh1CO89W1KzQu+w33SmAmW0PJ0+aHDsv0d4PRIb POhLEV8bZceaHkWq1M1Jl1P1xV+UEelGyBJFWe3XIspLbOqyhP7frvAjajH46LDiPi ObKuQb4r08H88CaO5GAFSC4Tx9igwxJcaE6yhq/+OYeIJeDpy9ldfhIeNXvAa6zog6 X8cGet21q1o9Of7xfeIVLhj6vsJg4PDJcN77OFOI26NWCu/aM5WeY9WuYpi48SqMk3 V2Rq26Ho7O1Fg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pQ71G-0001Kl-B0; Thu, 09 Feb 2023 14:31:22 +0100 From: Johan Hovold To: Marc Zyngier , Thomas Gleixner Cc: x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org, Hsin-Yi Wang , Mark-PK Tsai Subject: [PATCH v5 03/19] irqdomain: Drop bogus fwspec-mapping error handling Date: Thu, 9 Feb 2023 14:23:07 +0100 Message-Id: <20230209132323.4599-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230209132323.4599-1-johan+linaro@kernel.org> References: <20230209132323.4599-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case a newly allocated IRQ ever ends up not having any associated struct irq_data it would not even be possible to dispose the mapping. Replace the bogus disposal with a WARN_ON(). This will also be used to fix a shared-interrupt mapping race, hence the CC-stable tag. Fixes: 1e2a7d78499e ("irqdomain: Don't set type when mapping an IRQ") Cc: stable@vger.kernel.org # 4.8 Tested-by: Hsin-Yi Wang Tested-by: Mark-PK Tsai Signed-off-by: Johan Hovold --- kernel/irq/irqdomain.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 981cd636275e..b4326c364ae7 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -847,13 +847,8 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) } irq_data = irq_get_irq_data(virq); - if (!irq_data) { - if (irq_domain_is_hierarchy(domain)) - irq_domain_free_irqs(virq, 1); - else - irq_dispose_mapping(virq); + if (WARN_ON(!irq_data)) return 0; - } /* Store trigger type */ irqd_set_trigger_type(irq_data, type); -- 2.39.1