From patchwork Fri Oct 20 10:43:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 155993 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp963758vqb; Fri, 20 Oct 2023 03:46:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLtDl02hURLE7c0gcciicskwQn70+qylEnwrDy7xBCunTNM6+/OZa0GO1h7CndQYRrJYox X-Received: by 2002:a17:902:e5c3:b0:1c9:aac5:df1a with SMTP id u3-20020a170902e5c300b001c9aac5df1amr1649551plf.51.1697798764623; Fri, 20 Oct 2023 03:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697798764; cv=none; d=google.com; s=arc-20160816; b=BqQpiJDO/lp+zfb0TPQOTip+78TGMZ1P8TuWsYkYZzDNCKJH8jlyEDznsbtzrvFcdH bScBgNtOBDQc9X3k6gcJAm6vWJeQNwx60mUlkQN+0CWNPsK5LrcscKg5B1vlgBBPyajD GgFtjIgdIFAVoKJ8juxHb9sFpk6R7ol2dYhuO0xFNoLhQcKwfj5JrGK+grSNjeTHa6hu z3xBPZ7SmLjMDU8qwDU5oj32KQaO86WudxTIYhzq93g7NTVspzZqDNy8nZskCW2R/Kjw ny/70iAst5ArfVAWZ7PQz/1AeQ6kmyujE+nPJ2t1WPoO18tH8utfsBWF2uo/OXYfnvta HMmQ== ARC-Message-Signature: i=1; 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; bh=W5Gx9b4vDhRsyrxh8GhfZWV2JU2KVLh9qX55Vgk0d1U=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=1JIDzGJ+pV1y1sCq5G9KyNazQLNFqfE7PaSNbtmQwOfoCEBSLd7ToEopWaO8ZPHX0m Vy5VuKvYeCOdlCGEjE9hjI/CMk+GV9JOxZVogdG/R52yxL5R8TOswiTW1UBEcVk8Ekn1 ptYJflxLTU6Bcwb7YjVuye3vbCsUTDpEpAbAWcFyKpERh50ArzFqt7IjMbFr/I/LUcIc FR2ZGU3nxFFG4/U9A9rIMpzwHKdkakkZRRINvaWPGn3t8JC3CtrBLBTpJL4OyrNkVAGC 43ljWB4qmBStK3F2rA9C9UMGaZ1mHXD+O+qdqwURkjVyMWjyCyaUqekmQLMGYnmsuZEA V8Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s12-20020a170902988c00b001c9fe071f2esi1434785plp.128.2023.10.20.03.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 792E780C4D6C; Fri, 20 Oct 2023 03:45:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377141AbjJTKom (ORCPT + 25 others); Fri, 20 Oct 2023 06:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377075AbjJTKn7 (ORCPT ); Fri, 20 Oct 2023 06:43:59 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1347114; Fri, 20 Oct 2023 03:43:56 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id C624D24E374; Fri, 20 Oct 2023 18:43:55 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 20 Oct 2023 18:43:56 +0800 Received: from ubuntu.localdomain (183.27.99.123) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 20 Oct 2023 18:43:54 +0800 From: Minda Chen To: Conor Dooley , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , "Daire McNamara" , Emil Renner Berthing , Krzysztof Kozlowski CC: , , , , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v9 15/20] PCI: microchip: Add event IRQ domain ops to struct plda_event Date: Fri, 20 Oct 2023 18:43:36 +0800 Message-ID: <20231020104341.63157-16-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231020104341.63157-1-minda.chen@starfivetech.com> References: <20231020104341.63157-1-minda.chen@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [183.27.99.123] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 20 Oct 2023 03:45:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780271037418077610 X-GMAIL-MSGID: 1780271037418077610 For PLDA lack of an MSI controller, The new added PCIe interrupts can not be added to MSI.PolarFire event domain ops can not be re-used. PLDA event domain ops instances will be implemented in later patch. Signed-off-by: Minda Chen Acked-by: Conor Dooley --- drivers/pci/controller/plda/pcie-microchip-host.c | 9 ++++++--- drivers/pci/controller/plda/pcie-plda.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index 5a8c134bf643..4765a596a517 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -816,13 +816,15 @@ static const struct plda_event_ops mc_event_ops = { }; static const struct plda_event mc_event = { + .domain_ops = &mc_event_domain_ops, .event_ops = &mc_event_ops, .request_event_irq = mc_request_event_irq, .intx_event = EVENT_LOCAL_PM_MSI_INT_INTX, .msi_event = EVENT_LOCAL_PM_MSI_INT_MSI, }; -static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) +static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port, + const struct irq_domain_ops *ops) { struct device *dev = port->dev; struct device_node *node = dev->of_node; @@ -836,7 +838,8 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) } port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events, - &mc_event_domain_ops, port); + ops, port); + if (!port->event_domain) { dev_err(dev, "failed to get event domain\n"); of_node_put(pcie_intc_node); @@ -935,7 +938,7 @@ static int plda_init_interrupts(struct platform_device *pdev, return -EINVAL; } - ret = plda_pcie_init_irq_domains(port); + ret = plda_pcie_init_irq_domains(port, event->domain_ops); if (ret) { dev_err(dev, "failed creating IRQ domains\n"); return ret; diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h index df1729095952..820ea16855b5 100644 --- a/drivers/pci/controller/plda/pcie-plda.h +++ b/drivers/pci/controller/plda/pcie-plda.h @@ -129,6 +129,7 @@ struct plda_pcie_rp { }; struct plda_event { + const struct irq_domain_ops *domain_ops; const struct plda_event_ops *event_ops; int (*request_event_irq)(struct plda_pcie_rp *pcie, int event_irq, int event);