Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4146950rwb; Tue, 6 Sep 2022 03:21:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SFR0uqtyWq3gDZd3EDBEwy/mgmHAqLv0XQfla50wz35EJZra/HOARfglU/0ukNY0Boniy X-Received: by 2002:a17:90b:17ce:b0:1f4:d068:5722 with SMTP id me14-20020a17090b17ce00b001f4d0685722mr23595428pjb.28.1662459702956; Tue, 06 Sep 2022 03:21:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662459702; cv=pass; d=google.com; s=arc-20160816; b=ONubAsnxbKr+Y9jB6zyGAxvL8xM0fpEZRLHgdu8guXHu8APn5rjw7PgqLejQAulyj3 KptrQHwD2Kk77Gu58vduEcXr3IVP9HvxwhHnurSNjt/IwWOgD79skj+tfeJUbwx1BkVS pOJuizquLU0l6gE71SkHSzDgVagYc09UZPOf72ne9vfZ0QniU5I/NvI0HAc+Km0Ax35F TmfUIaqdtO+1y+nSQA2CZryESRDbaPhhad++7UrSfXouUOioLsComsKuYvWM/2zu6enf r9pf+l8fwlVXNtkFwDbpySQQ+lbuLVBgU3kwRPuVRmtbWcZuh6OTPvq7llN6VV1SimUV Ecvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=siILthPCZV4eQZTy3fTdzvlg3xwLeZZkKfDceVYYys0=; b=qba7XSpERrxZPx1YYHkcO8sXMlC5RItRUdv1cTYY+XzBY4rDmHg6zdKgfBrOOEJ49k GBybhEsDEXR0S3FBWc4uEAV/pf2rt9KdsIaBr1XSdNNqe6tCXsg1jLdY/JXRISMgB51V Nuue3/0o6LbLqs8UFpoIE7TEupQzvXywMViU9PS8TNHOXs3xAQTjBtHeZQ3Q8atyMA+o VTrJQtYUMtJ4BpZ03Y2ZpkGuV3CzXBq6CiSToFnuOyRhF69wiDsc+5r78aJ0IYMksxsN OjtQzkYu9B1FgK/yy6qDWIUNrPKTLxsDyAl7RBOTZGE6vnODvOyPtSCxtH6vIGXDmv1H er2w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b=KLihXTeb; arc=pass (i=1 spf=pass spfdomain=nokia.com dmarc=pass fromdomain=nokia.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a63a30a000000b0042b32127ed1si9307475pge.534.2022.09.06.03.21.31; Tue, 06 Sep 2022 03:21:42 -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=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b=KLihXTeb; arc=pass (i=1 spf=pass spfdomain=nokia.com dmarc=pass fromdomain=nokia.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239333AbiIFKA3 (ORCPT + 99 others); Tue, 6 Sep 2022 06:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239293AbiIFKAM (ORCPT ); Tue, 6 Sep 2022 06:00:12 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2118.outbound.protection.outlook.com [40.107.22.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855786F577; Tue, 6 Sep 2022 03:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rrk1YbMWP7djUdNYzauuZoXFyB6KPDKHrxJc1xcq3lZUU81xmpUQIY7znC7Og9/hU+sIkjEIzONbvAtlBO9PJ0NPFP3G7qYTunjzd/HCbt16BmYeqQ3AQiapZPlgF0bFYWXw3O0UxNAxPQXX3Ax0ILwZUa+z0nnwxjnOMB7ghpAZyBGumPoBuy2i1qEpKIqGAzPsAW0LBYP+/8ehbi1vlNhTpKkcTSRB93+ROi6/AnEurwto/CwE5jVDo1la/CTD+D9l20kSVU46x0wDHrYWCDBlFUoZf/+fva/qxevrgKuDJdWssE9isDMzELhDxt0wTZpEJ8nj7UVBlcjkWn2jqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=siILthPCZV4eQZTy3fTdzvlg3xwLeZZkKfDceVYYys0=; b=BkQhkWgDQfjTv1kHQZOkrnhF06necD7pd2B8FYc+MuSHmFyPwuAiJFAOOaJYWmBrqmQO2UH2LKg2RyXW+zj8iE1zKrv9vNDYyy56IeHyyfikPqabwEgP94eFb8Xcq7Sc7eYSkTPDnxCH8Qxc1hNw/CNRiDrsOEEvSaKl4cOQkr86GzGQCcxtL7wpktdoKDJT8iKlbDN5lgLKD6GK69P9Q6/cIZrWGUg5GcXgNuibHVcuHga1K6oU+PSJPx0ecPIvrlR28x3x+qy5WpDAOMS5ZePv/N9axinl/C/O+I5SXfaLF2Es4ajw03WZkIItE/9BNwAPVDRr4s40zmKMdCYRiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.2.8) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nokia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nokia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=siILthPCZV4eQZTy3fTdzvlg3xwLeZZkKfDceVYYys0=; b=KLihXTebEK+VetBo8XFQsW/Z1TZopmr1WqLze8ySNrrjr6s97wwuBOWIsymk47xdlsvTGNouqyVNQL1smwBabAPTokniXEEY8GNXGXU2QQ4pRr2KF2Ut7MI0wprsBrtHeFmfjy0K2LcmPjjNioddI0zPnJmzLNfDiXLn5B0sNAU= Received: from AS9PR06CA0758.eurprd06.prod.outlook.com (2603:10a6:20b:484::14) by VI1PR0701MB2733.eurprd07.prod.outlook.com (2603:10a6:801:7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Tue, 6 Sep 2022 10:00:08 +0000 Received: from VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:484:cafe::20) by AS9PR06CA0758.outlook.office365.com (2603:10a6:20b:484::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.12 via Frontend Transport; Tue, 6 Sep 2022 10:00:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.2.8) smtp.mailfrom=nokia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nokia.com; Received-SPF: Pass (protection.outlook.com: domain of nokia.com designates 131.228.2.8 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.8; helo=fihe3nok0734.emea.nsn-net.net; pr=C Received: from fihe3nok0734.emea.nsn-net.net (131.228.2.8) by VE1EUR03FT050.mail.protection.outlook.com (10.152.19.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10 via Frontend Transport; Tue, 6 Sep 2022 10:00:08 +0000 Received: from ulegcparamis.emea.nsn-net.net (ulegcparamis.emea.nsn-net.net [10.151.74.146]) by fihe3nok0734.emea.nsn-net.net (GMO) with ESMTP id 2869xo1u000637; Tue, 6 Sep 2022 10:00:05 GMT From: Alexander A Sverdlin To: linux-mips@vger.kernel.org Cc: Alexander Sverdlin , Thomas Bogendoerfer , linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: OCTEON: irq: Fix octeon_irq_force_ciu_mapping() Date: Tue, 6 Sep 2022 11:59:43 +0200 Message-Id: <20220906095943.60296-3-alexander.sverdlin@nokia.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20220906095943.60296-1-alexander.sverdlin@nokia.com> References: <20220906095943.60296-1-alexander.sverdlin@nokia.com> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 25abee05-a95b-4767-f6d4-08da8fee9463 X-MS-TrafficTypeDiagnostic: VI1PR0701MB2733:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xJe4apyZ+UNaDLHsgla/4YP/q5lRpRnS0dNN3sM5zggaZ5HlE0Y6H4G6nmUpSiDJXFTWqFFUwOIyPjwyJ4VXnUUArcjU8BnRlC11wdnw3aFSSIhFPaXwIlKBbqwFC5r0FDerevSbHf9Gazvp/0u8V+ZVNeDb9w0WtMeVuNwKpA3GATa3Su/nWxF4ssPz8HUzOQRFuLORk8SOI/yTaFSAM2mnZv2xRwULKhIynXgK9AHrMiGQgnGIuap0vGhLIZJUrewcavPTTAa9R3FJWt9Mrg6ZnYBbKlB6xu0Ezvv0+ksYlns8DsoiCTBl2Ir0+NDoai8buMROIxcUpxQ62ljPuzZRqk/av275t9JmU4LeGdO34GCSuMUfxl41e2wR+1Pw3XqYPQxsd1nxQFb3cnCqmxrCx9GmmyDgCephm0Z5CpM2K+eudOxrdX9kkCcpffkRnAfPF5zy+SYMCpnjGIb1ziPvUSWGfvMy5qRyKasZDqydDOGfqWw9/Je5E80cVtR6Itpy0odcUxfzsHeMuvp7tzYf2J15JllrFhwj5P72oMiQQNwYepuvCSH+CG9m+zYSQbzluRLeveKXGBnF/pu6wZTgyGlfmued64UHR6IqG3bdJUa2rYu2+VyldjJVbppo1a3lo6c0oAtmjqb9wgukN3gamcqzRaJY7RN841r9aUkOhEYkmwQXQpatr8Qy+UY72mwv7PAU6t0fb3XYkNacpz9bL2QoXGkIgD8dXYeiRuZwOjAbsmpCSuGwNiZAsOLEJGVMBDHVDo73bYcoyelJgduRqoglK2tit5LTyVLHiBESrAiF/2Kkqxa+OkV9xBDl X-Forefront-Antispam-Report: CIP:131.228.2.8;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fihe3nok0734.emea.nsn-net.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(136003)(346002)(376002)(396003)(39860400002)(36840700001)(46966006)(40470700004)(1076003)(186003)(2616005)(8936002)(83380400001)(40480700001)(54906003)(2906002)(5660300002)(26005)(6666004)(86362001)(36756003)(47076005)(336012)(478600001)(41300700001)(356005)(82960400001)(81166007)(4326008)(70206006)(8676002)(70586007)(82310400005)(316002)(6916009)(45080400002)(82740400003)(36860700001)(40460700003)(36900700001);DIR:OUT;SFP:1102; X-OriginatorOrg: nokia.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB2733 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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 --- 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 9cb9ed4..fd8043f 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.10.2