From patchwork Tue Dec 19 17:45:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil V L X-Patchwork-Id: 13498789 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62B03C41535 for ; Tue, 19 Dec 2023 17:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cc0APUoPYW27UrvfQ3XTOtaDuygqTilvOkF6VCQeytk=; b=JiKaFekjpDJzKw KZzSS493rCNLLh0/wGmqUM+17za3J+jHCT+TYKIzRqR8LQpQmRWCwaXrl3yviv+8iUSmh/5k42YJT hcVl3Gb27X2MfS72Qdb1f4wh8E/c9uG5mlsPe8ofb++VwGMiCp4mWCbu/zPLK6qceSoenYJGKrbgV +N8J0F1wtE0Gt3t9+Up8fK/bjE0S+XD3oaBQmud53KcDekcBJZu28z/ZIKsd87L+bGyjA6GNG65QQ B66cHKcQVTOrQ7E1flnV+e9Qr7EEhEIO8mJ/KerkPHz95v9j7dZk77ZGpu6R96+RlGYVrapaHUZnw 5Y4ynUIrc3vRxU++JvlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFeCq-00F2qJ-3A; Tue, 19 Dec 2023 17:48:36 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rFeBU-00F1fv-0H for linux-arm-kernel@lists.infradead.org; Tue, 19 Dec 2023 17:47:15 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1d3ac28ae81so24267105ad.0 for ; Tue, 19 Dec 2023 09:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1703008031; x=1703612831; darn=lists.infradead.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=eiwIpb7xuTq5TPRrwpmxnXk+wGzqHEHNo03fDZVsc7I=; b=Jrk8rZnsncI6n9qbUvCpgsCExNWnTLYD7ozdFJtQPk+zCWi4ftBED5nNnJypY4Wkts 0Icu4giPHuIL2sde3A3SftNJ+vBfT3bVtM+bnHv0+gdFEvejbkebZOhKaKuHYQxTgr2P M5XXJ/3Eh/emwZCiufKuJTmoU9FeYzW1xV9W0UeQGh5tXsebV+fvGcG7O/j+0qGymAYm jyqQYBuhkEyHE+26o35j3Gly2RreSAOwT0yZEi1dJ4N002vj1YLM/Di4rCJUCoH9Qrf8 NLdwUB36mUaRBuRF8fbgycwoEI9EYnUle/CgDNlg/rg6kM+Urgy7yUh65BhgHVLX+h7n j+sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703008031; x=1703612831; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eiwIpb7xuTq5TPRrwpmxnXk+wGzqHEHNo03fDZVsc7I=; b=QtKEXuyjSHcipnd5YRjYTsGwu2y2AtxpEGEdzMbZpiyFdFkMFWISDDCIz6J97xzZz7 vxqVP+Cuer9gLiuGviGPXW+8HLrVPqe6eOoAPOwdu4lrEsMSun3cw4/89eTQNg7nZFfH t5QZxE9CIN7AHzkvkkukG/1+LIsKh8JnzuWQ8xtTE7+rooRcD60STXLoS21NatAxypv7 zLFFl2Tihi1U2LROXFqVMPSO6h70HxRwrwhliNlqJE+UGDSKjqkCzHP7LYzyt9Xo8HZN MZEMl3+XPc6O1TAqDfwGay/MUzdbXoHDo0XSrkpG+PdKm0mr65PCJRFyNH7LvBVjvn/O 1+cQ== X-Gm-Message-State: AOJu0YzTN5qyfUjqCYSNgE+hvGjx59YuoytmpMeoRxusq6dgcArjf/Bu 8xvyMIw0ZYfuXxuoy4okhAaQ/I34p30+yj7uSfM= X-Google-Smtp-Source: AGHT+IEpUAW94l/bQ8GlpoYTs7IixfBFrUs4h8FHwGSRGLIfpQTk5UlG5GMDzC6dri1oqSEP3DUUjQ== X-Received: by 2002:a17:902:ec85:b0:1d3:ab39:abe2 with SMTP id x5-20020a170902ec8500b001d3ab39abe2mr5002223plg.14.1703008030730; Tue, 19 Dec 2023 09:47:10 -0800 (PST) Received: from sunil-pc.Dlink ([106.51.188.200]) by smtp.gmail.com with ESMTPSA id n16-20020a170903111000b001d3320f6143sm14453015plh.269.2023.12.19.09.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:47:10 -0800 (PST) From: Sunil V L To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org Cc: Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Anup Patel , Thomas Gleixner , Bjorn Helgaas , Haibo Xu , Conor Dooley , Andrew Jones , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , Marc Zyngier , Sunil V L Subject: [RFC PATCH v3 17/17] irqchip: riscv-intc: Set ACPI irqmodel Date: Tue, 19 Dec 2023 23:15:26 +0530 Message-Id: <20231219174526.2235150-18-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231219174526.2235150-1-sunilvl@ventanamicro.com> References: <20231219174526.2235150-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231219_094712_284737_66755E87 X-CRM114-Status: GOOD ( 12.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org INTC being the root interrupt controller, set the ACPI irqmodel with callback function to get the GSI domain id. Signed-off-by: Sunil V L --- arch/riscv/include/asm/irq.h | 13 +------------ drivers/irqchip/irq-riscv-intc.c | 1 + 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/riscv/include/asm/irq.h b/arch/riscv/include/asm/irq.h index 7b14f3ebe242..9c2bdf4bd880 100644 --- a/arch/riscv/include/asm/irq.h +++ b/arch/riscv/include/asm/irq.h @@ -22,18 +22,7 @@ #define APLIC_PLIC_ID(x) ((x) >> 24) #define IDC_CONTEXT_ID(x) ((x) & 0x0000ffff) -#ifdef CONFIG_RISCV_APLIC -struct fwnode_handle *aplic_get_gsi_domain_id(u32 gsi); -#else -static inline struct fwnode_handle *aplic_get_gsi_domain_id(u32 gsi) { return NULL; } -#endif - -#ifdef CONFIG_SIFIVE_PLIC -struct fwnode_handle *plic_get_gsi_domain_id(u32 gsi); -#else -static inline struct fwnode_handle *plic_get_gsi_domain_id(u32 gsi) { return NULL; } -#endif - +struct fwnode_handle *ext_entc_get_gsi_domain_id(u32 gsi); int __init acpi_get_intc_index_hartid(u32 index, unsigned long *hartid); int acpi_get_ext_intc_parent_hartid(u8 id, u32 idx, unsigned long *hartid); void acpi_get_plic_nr_contexts(u8 id, int *nr_contexts); diff --git a/drivers/irqchip/irq-riscv-intc.c b/drivers/irqchip/irq-riscv-intc.c index 24bbc5bfc30f..bddfe47df27b 100644 --- a/drivers/irqchip/irq-riscv-intc.c +++ b/drivers/irqchip/irq-riscv-intc.c @@ -311,6 +311,7 @@ static int __init riscv_intc_acpi_init(union acpi_subtable_headers *header, return rc; } + acpi_set_irq_model(ACPI_IRQ_MODEL_RINTC, ext_entc_get_gsi_domain_id); return 0; }