From patchwork Mon Jan 16 13:50:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 44159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1202690wrn; Mon, 16 Jan 2023 05:53:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXsumzqr14RLJMrpv34waPGcP816iO8lM1T7CMtAOfpcYwLw/w9w6FLUpT41w9oWQE0nd2NF X-Received: by 2002:aa7:cb51:0:b0:498:8c60:d7d9 with SMTP id w17-20020aa7cb51000000b004988c60d7d9mr28979142edt.12.1673877235662; Mon, 16 Jan 2023 05:53:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673877235; cv=none; d=google.com; s=arc-20160816; b=BBxOXA65yNAMiTgd+FSvlUnHYXlqDnW4Mt+yVPKD5E4fB2waHnzAg+lkMIyhteMzxM YK7VE2xlhmK+x0u28KwAIXgg6J9Y1J1iVCEl9T/vhHb4zY7I/epq4ih7aRXqmPlTA/N2 ycjpBML7lQ2I+uUkFXQTHqR6BjllI2vDuOH/8oPK1TjCMfGAJVC8kklRL/e2Lf3hBjiT SniP2wu6QdchNrbIeUjMEhiEpmPuMfi4plUVeS4byFYzEJCctpWDUS3PJwPVeqYTdAU3 Up3cT2Jdw6WuhV8wtTrUY3/mNnM/PnTcmq4xaynn3fUpy/dtDShcusCVduN7o6y6+xq8 he9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V1zQysgpdSLCuvYLh+EosEX3Tiy3cO1wQ56i54jJfhY=; b=H56MQWqF6cEEaOuaJSK2xdBEsaP2YzqwIIgyYke50CqVrgawcE//7fIRGZEmqVi212 XhC6JS5NmsSxMkPm1/LIcVHFPjTMsY6y6qaCbkj9olIlZ9Ir1FjWQcJQMvVIb+bV199R NEn1OO0Wm4hATRxXBZ8OkfTRlPjhcYLgt13lqNEDF27UIRr26Y3JNi2uE3lBY6tHHDcJ coNByWimYiRILDQguLhe2BQeFw8KNR320UFGi3nu+D5leeP4UVu+CiSunWoPekfwV7wH +zMQIlyD2sj3Jnj1MlX+Sy1sCAxZCg8c4NN24ZMu+5WGbhmWULZBCHACByLaJJyzej7G Qalw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gZ284EJZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a0564020f0600b0046351fa4ae2si5975003eda.99.2023.01.16.05.53.31; Mon, 16 Jan 2023 05:53:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gZ284EJZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231640AbjAPNvQ (ORCPT + 99 others); Mon, 16 Jan 2023 08:51:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbjAPNuo (ORCPT ); Mon, 16 Jan 2023 08:50:44 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46AA22197B; Mon, 16 Jan 2023 05:50: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 ams.source.kernel.org (Postfix) with ESMTPS id DE726B80F1A; Mon, 16 Jan 2023 13:50:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80150C433EF; Mon, 16 Jan 2023 13:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673877040; bh=heMSyTjPVavJ2Aad43hH/VAIkwpBj4Ge9/GVRzLpwHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gZ284EJZSZP2qsSjGnp5CKWQdPPkhVemAo44H1WSr+Yvra3KkzKEtNsKeqhRGpEa0 QkAZ2Xd9foHia2QJ8jv33WVY8EnvFYUniKtytP4BeqHlXcjcDs1DNTXLNHZUkSednx jkfsz8/1w9GUyQHGBwjZ6v3bIsqGmeWHHhivSjPrt3jzHAaqW0x5zBFU/lqy25fVyZ Z139nsEmuiK/ALPdUMVly8F0A/ruO0sZlsiJaPr67DsELzlAjGSZQYoMM6opNjGiyf sSyg4daW0Bhy+kQE2mM3vtGgM4xk8N0Jvh29ilFqRoOuLE6Yt+OxzanmFc1+PCXtZA 8fEcOGZOv8ukg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pHPt5-0003uk-IO; Mon, 16 Jan 2023 14:50:59 +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 , Hsin-Yi Wang , Mark-PK Tsai Subject: [PATCH v4 01/19] irqdomain: Drop bogus fwspec-mapping error handling Date: Mon, 16 Jan 2023 14:50:26 +0100 Message-Id: <20230116135044.14998-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.38.2 In-Reply-To: <20230116135044.14998-1-johan+linaro@kernel.org> References: <20230116135044.14998-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755187496184662114?= X-GMAIL-MSGID: =?utf-8?q?1755187496184662114?= 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(). 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 8fe1da9614ee..bf67de1733ee 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -833,13 +833,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);