From patchwork Fri Sep 15 10:22: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: 140343 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp944136vqi; Fri, 15 Sep 2023 03:34:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEamBeZSghO8HlizQFvce4Ag069ez/rUmSsbY24usxb6i5gXNtmKhD8C4rHnxpxfs7fVzxO X-Received: by 2002:a17:902:9b8a:b0:1c0:b84d:3f73 with SMTP id y10-20020a1709029b8a00b001c0b84d3f73mr956234plp.53.1694774073297; Fri, 15 Sep 2023 03:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694774073; cv=none; d=google.com; s=arc-20160816; b=CxFqNRnOmri2e1OyTYlqbPEiwyLNd1kb9sJSuQMhURrGkE9XKcmcg+c7r4LQWzpKFd XtBnS/czS3IwC5/hpIWJk0PU6mMyU0a88TZOAcebqKtZubMpSpZadEXk3ZBPtuNjHVOM bxeCSZQv+pczlA8KMICsHMkMZohSNeXQ9wMSc81WtH1xYOPpu+dMRj654+3yyCpTjD69 7n/EPSPRW682ejUvZugt3bOy8UTUAugJR9WG0nyjneqgjje3dE81wFWUvF1V8NkaIFB1 L3qzZhrBg0p7OKbtXaWF94sXkIzQzCU/BDE52kVk50N0cfmVJMzN4ImsLF+B8zZb1U3O 7QFg== 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=lOU3lfmVbgPcpNMsb1f8uuE7+bd0Y9RJFlSTwzPAA08=; fh=y8d0C5dLtGb8zs8KQUIJy2R9+5DBPV29N8a8eZxYvuU=; b=b5TZkjs89zPybhV71ywi9RdxIqkSNoJcRXRDGTeu4B5HQrqcbWx+QfJsKZc1Psrod/ QnQUcO0BvtGf6s6upapGirnd7JAtcOgO2VWyM9AKQqoqpYFDwmOzHOOi3XNpSkdbubCq 0rrSmPD5uCekj1mqRxdKskNEvihapLc4zM7xGv02fGEk8j77M8+C/c+WmbcPxek6HsT/ M6+m7t1iIwjq0f+ssOr4t2i9oeojvJAQMA720MseSs9x0o0H/ZHGh3C+U1AYJc9tTOMK VATwQ/HGpShKRSk16oTWQmpyu6edqFYYl1udzLcY+f6qp8awIvC+W8dIcuCQafLvnPwI +PJQ== 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:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f10-20020a170902ce8a00b001bda93595d9si3364169plg.604.2023.09.15.03.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 03:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 AEB5788D5160; Fri, 15 Sep 2023 03:23:37 -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 S234478AbjIOKXf (ORCPT + 32 others); Fri, 15 Sep 2023 06:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234309AbjIOKXE (ORCPT ); Fri, 15 Sep 2023 06:23:04 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED19E1FE0; Fri, 15 Sep 2023 03:22:58 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 8CB1281BB; Fri, 15 Sep 2023 18:22:56 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 15 Sep 2023 18:22:56 +0800 Received: from ubuntu.localdomain (113.72.144.67) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 15 Sep 2023 18:22:55 +0800 From: Minda Chen To: Daire McNamara , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Emil Renner Berthing CC: , , , , =?utf-8?q?P?= =?utf-8?q?ali_Roh=C3=A1r?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v6 12/19] PCI: microchip: Add INTx and MSI event num to struct plda_event Date: Fri, 15 Sep 2023 18:22:36 +0800 Message-ID: <20230915102243.59775-13-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230915102243.59775-1-minda.chen@starfivetech.com> References: <20230915102243.59775-1-minda.chen@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [113.72.144.67] 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:23:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777099418578773010 X-GMAIL-MSGID: 1777099418578773010 The INTx and MSI interrupt event num is different in Microchip and StarFive platform. Signed-off-by: Minda Chen --- 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 e3c7d5e66150..fb09b6c34e01 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -807,6 +807,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) @@ -947,7 +949,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; @@ -957,7 +959,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 4e0712c9365e..af5e69718342 100644 --- a/drivers/pci/controller/plda/pcie-plda.h +++ b/drivers/pci/controller/plda/pcie-plda.h @@ -156,6 +156,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; }; irqreturn_t plda_event_handler(int irq, void *dev_id);