Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp539736imu; Fri, 7 Dec 2018 05:13:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wy3HS2t5IQPR9jOdo+/wexBXf3vOomY+TMyMnJizT3U6hwK7SAgV81XypxvKqVpDS2gYfu X-Received: by 2002:a62:53c5:: with SMTP id h188mr2173710pfb.190.1544188439752; Fri, 07 Dec 2018 05:13:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544188439; cv=none; d=google.com; s=arc-20160816; b=HGOyiBEvQMrFB2umHRsMUdj0hJEHFJgYbIPOfdg3M7GFGbPzTfbsv/duKeCa3byKWD 7RfezybMhjXdCXQTXYFeoLqA/eplEPnn8fBW4/hyqIbjMY8NwoZ52YV1TNkAxK0pztA1 SK7xAMmOC8Ac7dSmZuKwukYXr7Ho5pryzQmNA0QWgz32xI8yJEWBPXmiVqtfe87+jug5 icJ8n5Vd+z/AF61whK3dCW4nlhMm7u4nuckEJYEUJjRwE60ANJZCGDndHVq+FJd1WbU8 8S5XGCPRAsXdKf3D0fjXHttxV+p355ydeWGXlwOeJSefDMRCBTRj1+8iIaLVc+BusXeS cl6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EFj9X/innvkpACYNCTtZcY37pslKCk2J0+kVrFHIYOI=; b=sc3eY739y8R0JiZ13ee+Uy+iJTFqYhjKMv81glYLb9+5XaFwP1ufPoKfjcXHLR1Sow CV5LEwukvyCVgaJ2BPVfXFHPGb2xpY+OU27fpz6g3YTRX5rTP4c32BXduiCyTaMmUE1+ mocjgJukz2cJtMLMRdlPCS7zSo8h0ddEgutOoOW0I5egsJ63bPINUvPOlBQ8qJDpHKw/ yclbBDS6ZomfzRqjL1W4eOghXKw9ex9qxu9k2BY2x/6ENDoHOxCc4CKUCKkocv5xyVrj QuKg4c6QafDCpCs6iaAxF2JPIvDcWnNFHYJWJKODh+74ln7nRIu5jSHFWbgu74FAsedm cwGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LmCipauO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b60si2950794plc.95.2018.12.07.05.13.44; Fri, 07 Dec 2018 05:13: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=@linaro.org header.s=google header.b=LmCipauO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726179AbeLGNLT (ORCPT + 99 others); Fri, 7 Dec 2018 08:11:19 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:33860 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726030AbeLGNLS (ORCPT ); Fri, 7 Dec 2018 08:11:18 -0500 Received: by mail-lf1-f65.google.com with SMTP id p6so3011409lfc.1 for ; Fri, 07 Dec 2018 05:11:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EFj9X/innvkpACYNCTtZcY37pslKCk2J0+kVrFHIYOI=; b=LmCipauOb1yLA1CNjfxYn4Q7iy7tl70uGlFvAgMt74FNEpfLA2CjVMLuKDLmyxf9P9 vaVmbpOIrI+S6dfKTq9sX/snFic79x2CqMlbxsMCJI1hHSf+subIIkVQuOXv2+B+LXjn xa+GDgGu0JMtiGoaSGSsjQTHibBTehXtos3U8= 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:user-agent; bh=EFj9X/innvkpACYNCTtZcY37pslKCk2J0+kVrFHIYOI=; b=GzxNNhp6JmvzPBVUyQqzoOqDpvESU3tO6FJv5hCZ+vLaotQ9Tbr5N8jwCR03HOPjRG c23SkSjh5U5/DNkU2K0yFHLDV5GZwoVJCMWRMFSGsC5/aLs/SAzaYXx2ZcYuC9S408fC 8fVoQv0Qoi1YgXs4q+wCjQh/epZm61StWMkIL26htSP7HrJU8p1R8/h9udep9Nw+PLqu qZaNdL6A37AZUKjUr6NAPzoat9+qORvuaIFSwAnJNNwm2W4wnMZhA3wsysceY8SGiYxt RF5mMsXeWUHlKSzi2zxQwMT/VTnguCpeBHy0pOYehLhUs3sm1cMCGvyuW0WO7wJtgqSq wnEQ== X-Gm-Message-State: AA+aEWa4E8FF1sTjnfiFBqnWKF/vAw4CrbfQqBVvdfs+81vjRJxIj4PI Jl3leFHQMxJWyfjfRCN/gQ02xQ== X-Received: by 2002:a19:8f45:: with SMTP id r66mr1413285lfd.9.1544188276612; Fri, 07 Dec 2018 05:11:16 -0800 (PST) Received: from centauri.lan (h-229-118.A785.priv.bahnhof.se. [5.150.229.118]) by smtp.gmail.com with ESMTPSA id i143sm604609lfg.74.2018.12.07.05.11.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Dec 2018 05:11:15 -0800 (PST) Date: Fri, 7 Dec 2018 14:11:13 +0100 From: Niklas Cassel To: Andrey Smirnov Cc: Lucas Stach , linux-pci@vger.kernel.org, Bjorn Helgaas , Chris Healy , Leonard Crestez , Dong Aisheng , Richard Zhu , linux-imx@nxp.com, linux-arm-kernel , linux-kernel Subject: Re: [PATCH] PCI: controller: dwc: Make PCI_IMX6 depend on PCIEPORTBUS Message-ID: <20181207131113.GA427@centauri.lan> References: <20181206074555.19579-1-andrew.smirnov@gmail.com> <1544092136.3709.57.camel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 06, 2018 at 08:55:13PM -0800, Andrey Smirnov wrote: > On Thu, Dec 6, 2018 at 2:28 AM Lucas Stach wrote: > > > > Am Mittwoch, den 05.12.2018, 23:45 -0800 schrieb Andrey Smirnov: > > > Building a kernel with CONFIG_PCI_IMX6=y, but CONFIG_PCIEPORTBUS=n > > > produces a system where built-in PCIE bridge (16c3:abcd) isn't bound > > > to pcieport driver. This, in turn, results in a PCIE bus that is > > > capable of enumerating attached PCIE device, but lacks functional > > > interrupt support. > > > > This is odd. AFAIK PCI port services are a totally optional thing and > > them being absent should not lead to a non-functional PCI bus. So I > > would really like to see some deeper analysis what is going on here. > > > > AFAICT, this is due to pcieport driver enabling MSI of the bridge > device (16c3:abcd) via pcie_port_device_register() -> > pcie_init_service_irqs() -> pcie_port_enable_irq_vec() -> etc. > > I did an experiment on a i.MX8MQ/PCIE -> i210 setup I have: I disabled > CONFIG_PCIEPORTBUS and hacked igb_main.c enough to make the i210 > driver believe it should fall back onto legacy interrupts. Even > without pcieport present in the system, i210 worked as expected via > legacy interrupts, which seems to collaborate my conjecture above. > > Thanks, > Andrey Smirnov IIUC PCIEPORTBUS should not be needed for MSIs to work, it is only needed if you want e.g. PME or AER. The difference is that if PCIEPORTBUS is enabled, a MSI irq vector will be allocated for the Root Complex itself, so that it can send an irq when e.g. AER has detected an error. If we disregard that MSI handling is currently broken on DWC PCIe: https://marc.info/?l=linux-pci&m=154214986924244&w=2 It is very possible to have MSIs on dragonboard 820c, which also uses the DWC PCIe controller, without having PCIEPORTBUS selected: # zcat /proc/config.gz | grep -E "PCIE_QCOM|PCIEPORTBUS" # CONFIG_PCIEPORTBUS is not set CONFIG_PCIE_QCOM=y # lspci -v -s 0000:00:00.0 0000:00:00.0 PCI bridge: Qualcomm Device 0104 (prog-if 00 [Normal decode]) ... Capabilities: [50] MSI: Enable- Count=1/32 Maskable+ 64bit+ # lspci -v -s 0000:01:00.0 0000:01:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32) ... Capabilities: [50] MSI: Enable+ Count=1/8 Maskable+ 64bit- # cat /proc/interrupts | grep MSI 70: 5620 0 0 0 PCI-MSI 524288 Edge ath10k_pci So perhaps this is a bug specific to imx6? Kind regards, Niklas