From patchwork Fri Oct 20 10:43:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 156010 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp974464vqb; Fri, 20 Oct 2023 04:07:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkUjAnLZP8rzCJWpA1Qjt7hChO3cVDNQtMn0nEQWAnwSonkNef4u+3014xRTT/ca0nNXut X-Received: by 2002:a17:90a:b88c:b0:27d:3296:b3e with SMTP id o12-20020a17090ab88c00b0027d32960b3emr1412275pjr.41.1697800052120; Fri, 20 Oct 2023 04:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697800052; cv=none; d=google.com; s=arc-20160816; b=HYC4otEmpjb7qNbKH4fh7qFoN+W9DJyQEA5Z5yPuzKhPFlXfxpy116gVYaYqmJS75F ElGmHeHY8tP0VOwE02wIPIuvhzQmjvi2Y6NPoFoVTobApP46x+2g4iBtmF8jkiD1Ddst aGbfvp5l/vEpx/3k+MuW+GCadaGbB19cQ10+wXCA9cdduDlmfw+0eOytBGKVO31KJ11E jLXtw+zXsxVi60qNT7+d7A4u5EBi/+zr56tgSqas2Fv0JYl3QWvb5kDtcuPFx5N/9Uz6 19XbhmjandW0D3rG1F54UxHUJOaSQUf7TyX8FcUNoLhoBxJEn5C8zH2I/SMSZ9Ayy5iu cX0g== 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=0Vh9ugF/ECad3M7YfnWkeTHrzjhkMvA4gFwd7dyOtqY=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=tGqu/Q2SOTeARYTjZfWjFdAlIAmQJd2jtDp/2VGLEnzNxwpEpCWE1J6LyPbbUWf7LR plpAA0kbJ4rxZ3GFZK7jrVoYhVznCTycHNJIzn9J2C5n/DZCHmNkAqYO3AN2TZEKbMd8 95m59H0kP9OUbEdCn1N6yzjSuYlSJJfIxb92uCoiWbsmWtp2MLQxVwIAa/eZT+Ikgl83 9sTrWA9rHDlfzhBtlAMWVGchsavYBagjuyA1KqIWjnkpP8euog8mhs4Wt/Mhp15Rfj6P EmY7odREC+oXBvl10V2w57YBs+6LPzn48UAzgbrsoX6R551G4KrmWfIHNfKVwuU8ycjl o3OQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 19-20020a17090a031300b0027491bac826si1628735pje.140.2023.10.20.04.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 04:07:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 90EBF8093433; Fri, 20 Oct 2023 04:06:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377022AbjJTLF6 (ORCPT + 25 others); Fri, 20 Oct 2023 07:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377057AbjJTKn5 (ORCPT ); Fri, 20 Oct 2023 06:43:57 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6897DD52; Fri, 20 Oct 2023 03:43:55 -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 fd01.gateway.ufhost.com (Postfix) with ESMTP id 2E0AC24E1BB; Fri, 20 Oct 2023 18:43:54 +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:54 +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:52 +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 13/20] PCI: microchip: Add INTx and MSI event num to struct plda_event Date: Fri, 20 Oct 2023 18:43:34 +0800 Message-ID: <20231020104341.63157-14-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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 04:06:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780272387382245297 X-GMAIL-MSGID: 1780272387382245297 The INTx and MSI interrupt event num is different in Microchip and StarFive platform. Signed-off-by: Minda Chen Acked-by: Conor Dooley --- drivers/pci/controller/plda/pcie-microchip-host.c | 6 ++++-- drivers/pci/controller/plda/pcie-plda.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index c95ef4679fc5..e57827bdb4b3 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -813,6 +813,8 @@ static int mc_request_event_irq(struct plda_pcie_rp *plda, int event_irq, static const struct plda_event mc_event = { .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) @@ -953,7 +955,7 @@ static int plda_init_interrupts(struct platform_device *pdev, } intx_irq = irq_create_mapping(port->event_domain, - EVENT_LOCAL_PM_MSI_INT_INTX); + event->intx_event); if (!intx_irq) { dev_err(dev, "failed to map INTx interrupt\n"); return -ENXIO; @@ -963,7 +965,7 @@ static int plda_init_interrupts(struct platform_device *pdev, irq_set_chained_handler_and_data(intx_irq, plda_handle_intx, port); msi_irq = irq_create_mapping(port->event_domain, - EVENT_LOCAL_PM_MSI_INT_MSI); + event->msi_event); if (!msi_irq) return -ENXIO; diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h index 28ed1374e1de..fba7343f9a96 100644 --- a/drivers/pci/controller/plda/pcie-plda.h +++ b/drivers/pci/controller/plda/pcie-plda.h @@ -124,6 +124,8 @@ struct plda_pcie_rp { struct plda_event { int (*request_event_irq)(struct plda_pcie_rp *pcie, int event_irq, int event); + int intx_event; + int msi_event; }; void plda_pcie_setup_window(void __iomem *bridge_base_addr, u32 index,