Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp911682ybv; Thu, 20 Feb 2020 09:25:59 -0800 (PST) X-Google-Smtp-Source: APXvYqy5GMGq2THxg/UsuX58l4V8abacdZAyKGOCqb4yV3GRyZmKFcKw8YkYxrbAidoCzgyfG2vI X-Received: by 2002:a9d:24c8:: with SMTP id z66mr24985742ota.52.1582219559320; Thu, 20 Feb 2020 09:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582219559; cv=none; d=google.com; s=arc-20160816; b=pUkfoh2qH7a29CFnDKbQ3Tn9BzezDr5KHB5+L5jjZCZRsP/rW+fWLSqHWjTxIRpqgu k/xlMj1n03Rv9xtsQIJw9HFwDPuGr/7StI8U60bqELThx/liv+ITILvcy4g28pEkc/m/ 1BrealS3ltrIHimA5l8WIMQ/Kex4ap0I8nsURyUL8PYQbnlzd4EKjkEE5mwR7qY22jGl XvnXAdiKkRhM+rHuJZ4F0S0xvakzE7ZU17cg0+VbrUlQ1vegjbT5cZSiSwUritJo/Aq2 yLUGbxbdxUP1PwKJP5iI8YXww3s67PzLhwFar4NWVW7hJcdNrh/wXs2WBrVPgF+A7O2h v4kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6yo/wEFYTgODGKnbWEUDj+nf8O3PSpjHxesG5sknQ/A=; b=bq5tKiSsDDI7ulGAYdK6oksZpy7rCtkDhzMkkexHuGD1hyibjM82VbI1cd+QOSp3HL hinwNuNH90Tigfi0ps0hO8708fqztzhhb1IOPtaJXHHfzFNKnlvKO5DW2m5KAGiLepPm rULMF+faW94IxgFP2dp0Q4av7JZBGPoQT5zZvmg4LqdWN4R9ReaNYhUWFOcdISCGWdNi Va6OHAh39H6a0f7b8wdGODuUROQCKaUv00uskXmWwlo/d4uqnKCPtjwPjVrl7tANbtQ+ ZRUNnWk9Fwkr6LeOhf716ZP7esTVeGBKJvuXI4MByvStpvoUUTPHqnSc4kcTPFU35QbS nKwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@thegoodpenguin-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=KYzgbjNX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z24si4984otm.135.2020.02.20.09.25.47; Thu, 20 Feb 2020 09:25:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@thegoodpenguin-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=KYzgbjNX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728813AbgBTRZa (ORCPT + 99 others); Thu, 20 Feb 2020 12:25:30 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52092 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728217AbgBTRZa (ORCPT ); Thu, 20 Feb 2020 12:25:30 -0500 Received: by mail-wm1-f65.google.com with SMTP id t23so2892334wmi.1 for ; Thu, 20 Feb 2020 09:25:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thegoodpenguin-co-uk.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6yo/wEFYTgODGKnbWEUDj+nf8O3PSpjHxesG5sknQ/A=; b=KYzgbjNX1K0CzUdOqySZxyADNE1VkZOd+lFmYKJzXNKvDdxhmo4+L5Z+A9zUWAZm6Y MXOaTeHGZYDQeZuL9/XRuAHG6o5QpfwBWIuhIi5k5Fh112a1u4Fy+65475Ko8TjrjHTu FgBtGghky4L0w6i64qMwjwuWxgYOPPL2kH1i7YYoOQOnEglhbyux1AeBVzsvu79Qb9yH cVXsZLya4qevlYaCviYxBRU7Rp93DncQYLGRYjBwiKZSlR8z36kiIve9ZIjVmQdw3uaF Q0wZ0sFjblB5LjlFdl3ZxALrBPX/05fn/MH2oRzRc5ZYx3PmJCjJ7Q8CsgXrKtlI95ne kXwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6yo/wEFYTgODGKnbWEUDj+nf8O3PSpjHxesG5sknQ/A=; b=F3w9UIgUoC9/tl3B9gJZTho2PNFf4BXu+zXcX3B+DNgYMROq4irrqaIXBH7GMbwPTA jzWcvNp5s63ScEZ7L8XrAYU22YpZYjN1bDKzVqGJ8BLSB8u1ZirP3GNS68a1wM6meToH FSS68b0JsFGOjCXM0DFnpbcX8cJILW6B9MG66D2H68b8y4ecKMl/HgOf+6V40JQh0RxL jJne9J/0+D7wenQDkcAM59q67fxuq4sdhch/o0KvEitaULwNbWS4ofYMVEFD8Okh/TdS LIdAIbsBYdnEKyfIwN9xtztmdyJl9Q2z5D16ofFfsD6qAzgLKz4pFGzWbZqSw97QOsT7 EtNw== X-Gm-Message-State: APjAAAUHT3YrkvU4Ehzo2/jiyOKQ3qJYvmbsrGBrm8Qxr81pcCFL3sqL TEC0TltkLx4302PYmbw7aPuR5w== X-Received: by 2002:a7b:c8c5:: with SMTP id f5mr5442945wml.44.1582219528295; Thu, 20 Feb 2020 09:25:28 -0800 (PST) Received: from big-machine ([2a00:23c5:dd80:8400:98d8:49e6:cdcc:25df]) by smtp.gmail.com with ESMTPSA id r1sm267897wrx.11.2020.02.20.09.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 09:25:27 -0800 (PST) Date: Thu, 20 Feb 2020 17:25:25 +0000 From: Andrew Murray To: Zhiqiang Hou Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, robh+dt@kernel.org, andrew.murray@arm.com, arnd@arndb.de, mark.rutland@arm.com, l.subrahmanya@mobiveil.co.in, shawnguo@kernel.org, m.karthikeyan@mobiveil.co.in, leoyang.li@nxp.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, Mingkai.Hu@nxp.com, Minghuan.Lian@nxp.com, Xiaowei.Bao@nxp.com Subject: Re: [PATCHv10 05/13] PCI: mobiveil: Add callback function for interrupt initialization Message-ID: <20200220172525.GG19388@big-machine> References: <20200213040644.45858-1-Zhiqiang.Hou@nxp.com> <20200213040644.45858-6-Zhiqiang.Hou@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200213040644.45858-6-Zhiqiang.Hou@nxp.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 13, 2020 at 12:06:36PM +0800, Zhiqiang Hou wrote: > From: Hou Zhiqiang > > The Mobiveil GPEX internal MSI/INTx controller may not be used > by other platforms in which the Mobiveil GPEX is integrated. > This patch is to allow these platforms to implement their > specific interrupt initialization. > > Signed-off-by: Hou Zhiqiang Reviewed-by: Andrew Murray > --- > V10: > - Introduced a helper function mobiveil_pcie_integrated_interrupt_init(). > > drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 12 +++++++++++- > drivers/pci/controller/mobiveil/pcie-mobiveil.h | 7 +++++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > index ea90d2f8692e..53ab8412a1de 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > @@ -499,7 +499,7 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie) > return 0; > } > > -static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie) > +static int mobiveil_pcie_integrated_interrupt_init(struct mobiveil_pcie *pcie) > { > struct platform_device *pdev = pcie->pdev; > struct device *dev = &pdev->dev; > @@ -539,6 +539,16 @@ static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie) > return 0; > } > > +static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie) > +{ > + struct mobiveil_root_port *rp = &pcie->rp; > + > + if (rp->ops->interrupt_init) > + return rp->ops->interrupt_init(pcie); > + > + return mobiveil_pcie_integrated_interrupt_init(pcie); > +} > + > int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) > { > struct mobiveil_root_port *rp = &pcie->rp; > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > index 81ffbbd48c08..0e6b5468c026 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > @@ -130,10 +130,17 @@ struct mobiveil_msi { /* MSI information */ > DECLARE_BITMAP(msi_irq_in_use, PCI_NUM_MSI); > }; > > +struct mobiveil_pcie; > + > +struct mobiveil_rp_ops { > + int (*interrupt_init)(struct mobiveil_pcie *pcie); > +}; > + > struct mobiveil_root_port { > char root_bus_nr; > void __iomem *config_axi_slave_base; /* endpoint config base */ > struct resource *ob_io_res; > + struct mobiveil_rp_ops *ops; > int irq; > raw_spinlock_t intx_mask_lock; > struct irq_domain *intx_domain; > -- > 2.17.1 >