Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4258935pxk; Tue, 22 Sep 2020 14:47:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxVI70eL9gjCrMJ0urqYKJQdj5TNqPhZ6GxKquFgWYLUW2LEpwyYvTjLEVqIqMQFYANGqe X-Received: by 2002:a50:f28b:: with SMTP id f11mr6186090edm.44.1600811267744; Tue, 22 Sep 2020 14:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600811267; cv=none; d=google.com; s=arc-20160816; b=ZZdfF1d/E8Q0hTcAyC/3Bm0h/N5slT5kGbsq3DjJhF8p9kGOAahx7aY+Js0jvMqi34 ytEGEqQDxDh8EAKg8xxvauV+NO6JGJsetI0R0zyLuo2jU5sslov/cYEtPoLpLx2xK12X FEx02VHR9YVtv1motpnU2aYXywDBZRtnR4+XdqLI46wTJ9euYH5B6TJgL+svu9QuhIM0 US5q3zzDaFVmJTWFcbCb9AKpYDz1n8XMdxbk7HZ/YNK2WKZwAVO08t9PW3WhVZQrZ7iF 9AlMWiM2+QVyFBo/nPq+2CQ3GhDqcMeCapj9Se+qMssyKl+4MNeAjlrOddvCRKeBsjwe iFCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=+sr537zUzkNZ08T7g6GAZ8QzpLM3Aku5oaznajxJOXQ=; b=afB5WCSnCLMAwTt0m1wM5wKADGuEleW9EBwePFBQWyulvJ6p4flycZgs+TUd+/Ha4z EdkRV7LSji9VxRenahOQ2J3UpCsbWT68pU4jpBwoLGdZq/49SHIWxdBSnr/Nfijyj1hV SGWzn6Xt7fQ6Fr8jtO0MktwHj+ofEoad9wQBBbyJjvZ7Oe03MfukagJMmaQAE5H+vKnu fvSauVeDeIg6s7aEaGmp0hYeu+5Fjb8qF5YrqV6EJgFBnJ8RvS9iMcj5Ps81W5jZzkdL OSYFf/L4u4EeV25ujetrVvb7ZPRlZx/POudetEG5GObRduUD92KD+puNELbx7Wenqoj5 yCdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b=Skh6LqOf; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=jq+hKRKz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si11048366edu.534.2020.09.22.14.47.24; Tue, 22 Sep 2020 14:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@oregontracks.org header.s=fm1 header.b=Skh6LqOf; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=jq+hKRKz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbgIVVqC (ORCPT + 99 others); Tue, 22 Sep 2020 17:46:02 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37515 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726766AbgIVVpu (ORCPT ); Tue, 22 Sep 2020 17:45:50 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 06E735C019B; Tue, 22 Sep 2020 17:39:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 22 Sep 2020 17:39:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= oregontracks.org; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=fm1; bh=+sr537zUzkNZ08T7g6GAZ8QzpLM3Aku5oaznajxJOXQ=; b=Skh6L qOf0JrUgVAQ66CNYW/C+XXnUW+d1ZfElX9PqoyRGUSL0bOnfKxB8yhtIIQCyOieq wYrOI6UOvaCWbILzYs3cXLrsh0+7sPVDPbDed2TgaZdJFDn9jVJ4NahqZXWF07O3 DXI3ZOVC/ErgTXt9VaA2LMUrJ5rgU0pIbOxJyF1bfTDVECE2zzLeXFb+4pcYWLde QZ6hpmjOdOcfifbeCWOE/0ZRnzAnQboBEOQnIQvIGVFo9SdqfTDOEbv1BrYJvKim l8cO8J65k/xBM7KgjTWsAsSuU4oo4uWlEbaM10mhyJb6tMWeHkUvoxz7k2HX26+j pfGUy1A4DT4JwnyNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=+sr537zUzkNZ08T7g6GAZ8QzpLM3Aku5oaznajxJOXQ=; b=jq+hKRKz kKbHOjZhqgVR6kvJ723am0JnT3ErI+lQ++3pBe0ffJCk+8ar1fP4Afd8bLzqjyXN YPEURZ1IMlY/EM1jNKM7vAlALU/XQrntYXKaR1vo2Ldqz3Zxq/G5kbVWBwGa/NHc 956yX56moFon2sp9yUVQjIfq92w+/CMH0hVoZImdCKkJznDmkRM6Mfc9//7VU3g7 pK6nAGFAzXCzvdpEeAAI3fIVMwKQuEOizY9rzXfS0gfg9xvinwUhrELBu3KOqoYD Dn8Ymb4xp7t0LhPGn5EyTTdpN8V5NvuHFbjfKoLrrB1/4I9aHPK5bLbonFswial7 UK5EgBXiM2Ywjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeggdduieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepufgvrghnucggucfmvghllhgvhicuoehsvggrnhhvkhdruggv vhesohhrvghgohhnthhrrggtkhhsrdhorhhgqeenucggtffrrghtthgvrhhnpeehkeffte eiudeiffelkeelvefftdelhfeitdeigeffleeufedvgfegvdefvedtteenucfkphepvdeg rddvtddrudegkedrgeelnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrg hilhhfrhhomhepshgvrghnvhhkrdguvghvsehorhgvghhonhhtrhgrtghkshdrohhrgh X-ME-Proxy: Received: from arch-ashland-svkelley.hsd1.or.comcast.net (c-24-20-148-49.hsd1.or.comcast.net [24.20.148.49]) by mail.messagingengine.com (Postfix) with ESMTPA id 9B85F3064610; Tue, 22 Sep 2020 17:39:07 -0400 (EDT) From: Sean V Kelley To: bhelgaas@google.com, Jonathan.Cameron@huawei.com, rafael.j.wysocki@intel.com, ashok.raj@intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@intel.com, qiuxu.zhuo@intel.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Sean V Kelley Subject: [PATCH v6 02/10] PCI/RCEC: Bind RCEC devices to the Root Port driver Date: Tue, 22 Sep 2020 14:38:51 -0700 Message-Id: <20200922213859.108826-3-seanvk.dev@oregontracks.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200922213859.108826-1-seanvk.dev@oregontracks.org> References: <20200922213859.108826-1-seanvk.dev@oregontracks.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiuxu Zhuo If a Root Complex Integrated Endpoint (RCiEP) is implemented, errors may optionally be sent to a corresponding Root Complex Event Collector (RCEC). Each RCiEP must be associated with no more than one RCEC. Interface errors are reported to the OS by RCECs. For an RCEC (technically not a Bridge), error messages "received" from associated RCiEPs must be enabled for "transmission" in order to cause a System Error via the Root Control register or (when the Advanced Error Reporting Capability is present) reporting via the Root Error Command register and logging in the Root Error Status register and Error Source Identification register. Given the commonality with Root Ports and the need to also support AER and PME services for RCECs, extend the Root Port driver to support RCEC devices through the addition of the RCEC Class ID to the driver structure. Co-developed-by: Sean V Kelley Signed-off-by: Sean V Kelley Signed-off-by: Qiuxu Zhuo Reviewed-by: Jonathan Cameron --- drivers/pci/pcie/portdrv_core.c | 8 ++++---- drivers/pci/pcie/portdrv_pci.c | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 50a9522ab07d..99769c636775 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -234,11 +234,11 @@ static int get_port_device_capability(struct pci_dev *dev) #endif /* - * Root ports are capable of generating PME too. Root Complex - * Event Collectors can also generate PMEs, but we don't handle - * those yet. + * Root ports and Root Complex Event Collectors are capable + * of generating PME. */ - if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT && + if ((pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT || + pci_pcie_type(dev) == PCI_EXP_TYPE_RC_EC) && (pcie_ports_native || host->native_pme)) { services |= PCIE_PORT_SERVICE_PME; diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 3a3ce40ae1ab..4d880679b9b1 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c @@ -106,7 +106,8 @@ static int pcie_portdrv_probe(struct pci_dev *dev, if (!pci_is_pcie(dev) || ((pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) && (pci_pcie_type(dev) != PCI_EXP_TYPE_UPSTREAM) && - (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM))) + (pci_pcie_type(dev) != PCI_EXP_TYPE_DOWNSTREAM) && + (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_EC))) return -ENODEV; status = pcie_port_device_register(dev); @@ -195,6 +196,8 @@ static const struct pci_device_id port_pci_ids[] = { { PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x00), ~0) }, /* subtractive decode PCI-to-PCI bridge, class type is 060401h */ { PCI_DEVICE_CLASS(((PCI_CLASS_BRIDGE_PCI << 8) | 0x01), ~0) }, + /* handle any Root Complex Event Collector */ + { PCI_DEVICE_CLASS(((PCI_CLASS_SYSTEM_RCEC << 8) | 0x00), ~0) }, { }, }; -- 2.28.0