From patchwork Wed Oct 11 11:05:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 151277 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp454602vqb; Wed, 11 Oct 2023 04:07:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERqEpuAB4TdBhST5is7NuYfkO7qaVm3zBK/dUojXftWFsMB0reLyrjOKQvRupn8/ScyED+ X-Received: by 2002:a05:6359:639d:b0:14d:2d2a:97f9 with SMTP id sg29-20020a056359639d00b0014d2d2a97f9mr16437979rwb.1.1697022433701; Wed, 11 Oct 2023 04:07:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697022433; cv=none; d=google.com; s=arc-20160816; b=KENV3wMRhjGUy0D6MzQ6cAMqwEgDwT9T+xBVqOOdQZZAZLYQKZSjnWuP9auSMmZ97S XgI3TmJM6GBTdQUb4YhAa9KMIva/c8uFO6pg3N86RRyMd5AAjorCa4UaXYnHnMnbFPK7 bjetuXR325jABUMLBvSZLbOJ8GIuszWGfDbicA1RoYVDLsa7k504IwXAPL4i+IcJbHo/ 11TG05iKp4Qvqend8g6Qo4xav6k5Vb1o4rzqGSVfvDp4+jjG9ilOzfAv4E7gUN6XTEaT E7m0GbF+56+nwbUDguPmzz7SMqKpTVeuVMvR/nuHWQXhDcHCMs5hB6IpnteRrFJsOWZs BVFA== 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=lLhCm0Dn9jUw15nWxnpnNgxgOseAjfWvzes6P54FrR0=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=xmMKGqRCrKHNZJxT9LKmz/79/DiA75tzJ5T5/tSqUNSX+Bf48g+jh3E1JBMuyLtizr KRDVnOF/qrUCkMUysI5+wZetu6TfB9C/lpUNXybgLtZ98c60tN52dugVwNT0VLF7CDM1 F5rYZsY+LCpVrpF5ZEzCw9ivzPekmQdEEeRS6MewRsiLNzN3oJBr0D6f2QUSbmyugT43 x7Urc6WU1mumpVyd8v+6LKxiKFCYe8yp3okMU/iGjysoy50WdPtgmWOsjszeW9Ct75bT fJ+hDSvfmfuXvHBirYPdIO5jNPJYzCJYdI0DWbbwZQtlTb1FkAIzfsiU62yU0ApEoz4+ D+CQ== 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:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id y18-20020a056a001c9200b0067ff1a1ccbcsi11377946pfw.63.2023.10.11.04.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 7829381F3318; Wed, 11 Oct 2023 04:07:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346808AbjJKLGv (ORCPT + 18 others); Wed, 11 Oct 2023 07:06:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346082AbjJKLFc (ORCPT ); Wed, 11 Oct 2023 07:05:32 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E732C9; Wed, 11 Oct 2023 04:05:30 -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 ex01.ufhost.com (Postfix) with ESMTP id 9469524E37D; Wed, 11 Oct 2023 19:05:28 +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; Wed, 11 Oct 2023 19:05:28 +0800 Received: from ubuntu.localdomain (183.27.96.95) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 11 Oct 2023 19:05:27 +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 v8 14/22] PCI: microchip: Add INTx and MSI event num to struct plda_event Date: Wed, 11 Oct 2023 19:05:06 +0800 Message-ID: <20231011110514.107528-15-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231011110514.107528-1-minda.chen@starfivetech.com> References: <20231011110514.107528-1-minda.chen@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [183.27.96.95] 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=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:07:09 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779456995021055999 X-GMAIL-MSGID: 1779456995021055999 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 104332603e25..e99498b5b563 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -808,6 +808,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) @@ -948,7 +950,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; @@ -958,7 +960,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 907ad40f3188..5ad1b81c0086 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; }; irqreturn_t plda_event_handler(int irq, void *dev_id);