Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2652378rwo; Thu, 3 Aug 2023 12:41:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlGAViX53z1uVQZwTtBCuaTCEHT46iK2zUCqlc153SblL5RcfWC6i46BapkLCRQxWyQ7WQ0k X-Received: by 2002:a17:906:2250:b0:993:e695:b589 with SMTP id 16-20020a170906225000b00993e695b589mr8128266ejr.20.1691091706157; Thu, 03 Aug 2023 12:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691091706; cv=none; d=google.com; s=arc-20160816; b=lAns8Y2Q7ULMj1rqwfO7PuwRhf15lK8b1b6oEfGfhGh+GHf3/JEMMU+KtZo8t2S58J dQ8S3QcUahbSX3yrQznry3SqnG7QLqB93GBWxeSzZf/2HdBLNn3pZ3VRvsLa55nSBfdO G5+1FTHaAMpv+fs6BIZ6TnuBdtml2ByG9c+oMCYPDPTpM4BFN4SRWAvnLI5beh4yYZAx b0Iv8/YCmlvK4pNGxTDpIUcTfh9HfSAIcr82BMie85atgeQnW+inR813eDTdFBdyQgBr +bZL1kaJlb4pokgmo+cwsNsNoFrwQAbRqnk7s1Y5UNWjYu/KKUJm1MOn4qMRpO3dtQCJ AAOg== 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=F92frfK1dVqJ4xjy+nPCRdMbjnNZ2BaLZfo5RMrgYGc=; fh=dzn7FZXuyjRD/SsADoLVmv8ajN6bypv0shpvYBNDmUc=; b=XGB7byinq0Ycwh8j+PQ82IxUYmwVmDmFTjSKswyNB48eN2PBrKwJY+GM7DZVz06xut jy3iXHqJD7VDjPZsZKTaN+ZdtaaCHcK8JYj03QrPxPe9AxV3Z6+rBrXMVdl8tWrG2GrA kro5kzjYx6ArfQFIE2xKnD95Q0GWGKIKumKWn/CMlYOU5Pro+r3b92TavlHHR6/7jdQX 8CEeycLKgI4t4jrr5Pyi+UaQlNRstAMnFZK6yPtScwp2d2oYcRedxV6oPkkVeu1bl57Q 7pxgXqxXsBR3rUNjvEbInzYMjOYdx8W845BZ9euN/ehPVSqi0Tn8VJx/v7D+TmZ8KV8G wTHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=nb8MJ8Fx; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020a1709063a4a00b0098cf3eaee4esi376320ejf.57.2023.08.03.12.41.20; Thu, 03 Aug 2023 12:41:46 -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=@ventanamicro.com header.s=google header.b=nb8MJ8Fx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232315AbjHCSDr (ORCPT + 99 others); Thu, 3 Aug 2023 14:03:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235701AbjHCSDK (ORCPT ); Thu, 3 Aug 2023 14:03:10 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DC554221 for ; Thu, 3 Aug 2023 11:01:58 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-686f8614ce5so1119541b3a.3 for ; Thu, 03 Aug 2023 11:01:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1691085709; x=1691690509; 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=F92frfK1dVqJ4xjy+nPCRdMbjnNZ2BaLZfo5RMrgYGc=; b=nb8MJ8FxfTXSyHfmc46NJ78oznoJARBEyZYQLu78F886UEH05u96pGX7PrrDE+ABPy g7Q9FL6hPeKgIvk1x1g1QIiXUI+eSCTn4U5OllRWdrxcoVajrrjHY50vfrwXSfjJ56rj kDL+iKNMiAcr3+BY7DKMcKwbrcyTolBMjohszwHk8Iqo0oHT6OJUhtHPMDjrZMpsSVf8 do6JnoL+oBRfutMZgfrvxiD/OLmiQhPDP+a9oLSuKJQQ+mEjyNMxYQbZ5QXaBFSdRNqr cB+pEseV+eVkFLVS2cVDEpQHb3FQjnP4sNhw8f1RnohhupWYwX5f1MNKLJwhFIFeh8bb Vzmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691085709; x=1691690509; 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=F92frfK1dVqJ4xjy+nPCRdMbjnNZ2BaLZfo5RMrgYGc=; b=fhvjriz++IYfpfaA2HhKSBfhb8k7gY54/lPjqB9jje3Vi7QlAB0wotwU6nJLqui1Hp KGBZf7uSkoOhXEWf3BKYD8VdyBe4Sz1OMPiJbA0YWJUEfaJs8yMghizTxZk9V5TFzfll MGBKRst5tJnI8pNzv0G/EgUvOAZ4OkAiEDntd7ihOAb8BXMX9EJVyt773DStLB5HqThZ 63iIo0Fz5OKWWFmv62s/hhIzyyt0ErsNE/ifcUk2zIEv7ECTpPvO1VdhGTze6l3QK7vY kTmPYmQOiovu7fOVnb2IMqLaEfY58oIzl57AidQpyenAqeJoUFkhsW7IEngjwITumaeT yMiA== X-Gm-Message-State: ABy/qLYRakBkviFgp2TBk2//37+mkDUh09RpLFfgjGYZ3jiWSV4ZTyEA JSN/twV/apOXL0bqlFDP0EfYTA== X-Received: by 2002:a05:6a00:1887:b0:687:7a30:deb with SMTP id x7-20020a056a00188700b006877a300debmr6591488pfh.15.1691085709034; Thu, 03 Aug 2023 11:01:49 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.190.143]) by smtp.gmail.com with ESMTPSA id s8-20020aa78d48000000b0065a1b05193asm134952pfe.185.2023.08.03.11.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 11:01:48 -0700 (PDT) From: Sunil V L To: linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Catalin Marinas , Will Deacon , "Rafael J . Wysocki" , Len Brown , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , Daniel Lezcano , Thomas Gleixner , Anup Patel , Marc Zyngier , Bjorn Helgaas , Robert Moore , Haibo Xu , Andrew Jones , Conor Dooley , Atish Kumar Patra , Sunil V L Subject: [RFC PATCH v1 18/21] irqchip/irq-riscv-aplic-msi: Add ACPI support Date: Thu, 3 Aug 2023 23:29:13 +0530 Message-Id: <20230803175916.3174453-19-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230803175916.3174453-1-sunilvl@ventanamicro.com> References: <20230803175916.3174453-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Search and configure the MSI domain for the APLIC on ACPI based systems. Signed-off-by: Sunil V L --- drivers/irqchip/irq-riscv-aplic-msi.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-riscv-aplic-msi.c b/drivers/irqchip/irq-riscv-aplic-msi.c index 086d00e0429e..1948444c9e0c 100644 --- a/drivers/irqchip/irq-riscv-aplic-msi.c +++ b/drivers/irqchip/irq-riscv-aplic-msi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "irq-riscv-aplic-main.h" @@ -178,6 +179,8 @@ static void aplic_msi_write_msg(struct msi_desc *desc, struct msi_msg *msg) int aplic_msi_setup(struct device *dev, void __iomem *regs) { const struct imsic_global_config *imsic_global; + struct irq_domain *msi_domain = NULL; + struct fwnode_handle *msi_fwnode; struct irq_domain *irqdomain; struct aplic_priv *priv; struct aplic_msicfg *mc; @@ -261,8 +264,17 @@ int aplic_msi_setup(struct device *dev, void __iomem *regs) * IMSIC and the IMSIC MSI domains are created later through * the platform driver probing so we set it explicitly here. */ - if (is_of_node(dev->fwnode)) + if (is_of_node(dev->fwnode)) { of_msi_configure(dev, to_of_node(dev->fwnode)); + } else { + msi_fwnode = acpi_riscv_get_msi_fwnode(dev); + if (msi_fwnode) + msi_domain = irq_find_matching_fwnode(msi_fwnode, + DOMAIN_BUS_PLATFORM_MSI); + + if (msi_domain) + dev_set_msi_domain(dev, msi_domain); + } } /* Create irq domain instance for the APLIC MSI-mode */ -- 2.39.2