From patchwork Thu Oct 25 02:47:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 988894 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42gWwk1hhXz9sDX for ; Thu, 25 Oct 2018 13:56:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726308AbeJYL0r (ORCPT ); Thu, 25 Oct 2018 07:26:47 -0400 Received: from lucky1.263xmail.com ([211.157.147.133]:45412 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbeJYL0r (ORCPT ); Thu, 25 Oct 2018 07:26:47 -0400 X-Greylist: delayed 499 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Oct 2018 07:26:46 EDT Received: from shawn.lin?rock-chips.com (unknown [192.168.167.179]) by lucky1.263xmail.com (Postfix) with ESMTP id B89333B6; Thu, 25 Oct 2018 10:47:41 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id F33E936E; Thu, 25 Oct 2018 10:47:39 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: jingoohan1@gmail.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <9efe88e7a5b847f61d547553b314457a> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 29507P92VUN; Thu, 25 Oct 2018 10:47:40 +0800 (CST) From: Shawn Lin To: Jingoo Han , Gustavo Pimentel Cc: Lorenzo Pieralisi , linux-pci@vger.kernel.org, Marc Zyngier , Shawn Lin Subject: [RFC PATCH] PCI: designware: Skip allocating own MSI domain if using external MSI domain Date: Thu, 25 Oct 2018 10:47:27 +0800 Message-Id: <1540435647-134674-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On some platform, external MSI domain is using instead of the one created by designware driver. For instance, if using GIC-V3-ITS as a MSI domain, we only need set msi-map in the devicetree but never need any bit in the designware driver to handle MSI stuff. So skip allocating its own MSI domain for that case. Signed-off-by: Shawn Lin --- drivers/pci/controller/dwc/pcie-designware-host.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 29a0575..39254b1 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -278,6 +278,10 @@ int dw_pcie_allocate_domains(struct pcie_port *pp) return -ENOMEM; } + /* Rely on the external MSI domain */ + if (device_property_read_bool(dev, "msi-map")) + return 0; + pp->msi_domain = pci_msi_create_irq_domain(fwnode, &dw_pcie_msi_domain_info, pp->irq_domain); @@ -433,7 +437,8 @@ int dw_pcie_host_init(struct pcie_port *pp) if (ret) pci->num_viewport = 2; - if (IS_ENABLED(CONFIG_PCI_MSI)) { + if (IS_ENABLED(CONFIG_PCI_MSI) && + !device_property_read_bool(dev, "msi-map")) { /* * If a specific SoC driver needs to change the * default number of vectors, it needs to implement