Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5590530rwb; Wed, 21 Sep 2022 09:42:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4KeAhHqQcefE8J6b4sf7pJ92AMvq8PW5ti/GnRQLbN55TAIM7SmAmopOJONAzeehz3uBgz X-Received: by 2002:a17:907:96a1:b0:773:c47a:ae35 with SMTP id hd33-20020a17090796a100b00773c47aae35mr21907311ejc.368.1663778563823; Wed, 21 Sep 2022 09:42:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663778563; cv=none; d=google.com; s=arc-20160816; b=nOppSnyETIrjDj3fdJ3smr6GAseW0AUoDvhG7rnhe30rVyxAgwQpugZG7fY8tYSrJo +TWYG7W8LEZaR1quYLHrEpg3ddF6UAPAY7HpIRHg2DRgSLuvdRZRyBurufDx4TDyZv4t laKRUjNad/CfDJfniN4G8LkJDUsMOvyHTFqbkBZgDMWwoSsgXF4PkSBnPRnOa0xK6k2Z 7rkxEZQ7cJXWvEMaNL2z+0CAemspdGYMIazSNNTa+owaHsDOTTjQ5LculHHsh4ofEPmR ntc5DMuRwcW2XM77t6f7gddGeforo1YHfg+EH/7vH12KOgsVsxdGUesV2HGkjejSLuhC TzEg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rEzWJF2KgimkH3aqdrPneNeGT0eekIqzgTSy92lYz6I=; b=TGk1uQtdyfSFEsJWAi9oLXwCAkKuMfzZIpLaEka1IOuUgz/DlHfVqREiMJtVqNQvDD Mylb9fcfgAUAN5Vw+Ncv8V/VHEE+OOlI2hT9S+vsjb3sL13Ht3ZzBwz87njeMBcKfarp W9KcNOzTjWsZWx+3Y9pZp0Cl4SXCzSsueIdZFGbo6UA5DhUcxnubSnOIV5BO1/VFfEDa XLYsgDvM6fV+/3ZI9ftZNSo9oRRVXh+0SIv/9D5IR4jpc5ZsFLEumH0uEXWMDXf4PRzs MNjYEw/G10F9Wb+fKhNwioLmJWZZ7zYhrrr/AMT4bHQLOe6DTiDnqeMYkX6sZCoQWLfc GOlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LHHQLoi2; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw27-20020a1709066a1b00b0077bb3c728c5si3336280ejc.20.2022.09.21.09.42.17; Wed, 21 Sep 2022 09:42:43 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=LHHQLoi2; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231962AbiIUPzd (ORCPT + 99 others); Wed, 21 Sep 2022 11:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232029AbiIUPx7 (ORCPT ); Wed, 21 Sep 2022 11:53:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DD179DF89; Wed, 21 Sep 2022 08:50:24 -0700 (PDT) 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 01C66B830B7; Wed, 21 Sep 2022 15:49:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6632CC433C1; Wed, 21 Sep 2022 15:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663775391; bh=twmucRWLWBA5JA6EpwBqMb0aNPgZceHCV2b5nbdmFUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LHHQLoi2delNFp+D+8moE6oM3sKu2HEYPurjjCP/mWaul7A2BffcjLmqcCsmhMddr gSmHoOckrSjdjo8zYuETGz8JoDjOgYdxxhx5LfPTH6NSdzqbctDAj4PlD2+q0hkDAM 228C7vEJBFAnaFxDrBpUOaZsW7UDq34FRSat46Zs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Sverdlin , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.15 38/45] MIPS: OCTEON: irq: Fix octeon_irq_force_ciu_mapping() Date: Wed, 21 Sep 2022 17:46:28 +0200 Message-Id: <20220921153648.216170861@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220921153646.931277075@linuxfoundation.org> References: <20220921153646.931277075@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Alexander Sverdlin [ Upstream commit ba912afbd611d3a5f22af247721a071ad1d5b9e0 ] For irq_domain_associate() to work the virq descriptor has to be pre-allocated in advance. Otherwise the following happens: WARNING: CPU: 0 PID: 0 at .../kernel/irq/irqdomain.c:527 irq_domain_associate+0x298/0x2e8 error: virq128 is not allocated Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.78-... #1 ... Call Trace: [] show_stack+0x9c/0x130 [] dump_stack+0x90/0xd0 [] __warn+0x118/0x130 [] warn_slowpath_fmt+0x4c/0x70 [] irq_domain_associate+0x298/0x2e8 [] octeon_irq_init_ciu+0x4c8/0x53c [] of_irq_init+0x1e0/0x388 [] init_IRQ+0x4c/0xf4 [] start_kernel+0x404/0x698 Use irq_alloc_desc_at() to avoid the above problem. Signed-off-by: Alexander Sverdlin Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/cavium-octeon/octeon-irq.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index be5d4afcd30f..353dfeee0a6d 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c @@ -127,6 +127,16 @@ static void octeon_irq_free_cd(struct irq_domain *d, unsigned int irq) static int octeon_irq_force_ciu_mapping(struct irq_domain *domain, int irq, int line, int bit) { + struct device_node *of_node; + int ret; + + of_node = irq_domain_get_of_node(domain); + if (!of_node) + return -EINVAL; + ret = irq_alloc_desc_at(irq, of_node_to_nid(of_node)); + if (ret < 0) + return ret; + return irq_domain_associate(domain, irq, line << 6 | bit); } -- 2.35.1