From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63C19C433E0 for ; Tue, 4 Aug 2020 19:41:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C9D62076E for ; Tue, 4 Aug 2020 19:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728442AbgHDTl3 (ORCPT ); Tue, 4 Aug 2020 15:41:29 -0400 Received: from mga18.intel.com ([134.134.136.126]:29288 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728473AbgHDTlN (ORCPT ); Tue, 4 Aug 2020 15:41:13 -0400 IronPort-SDR: tuFWOyiSHzbYeLvx3QRqYZ4LFGhV1KmGO1Yr7hiTTIDLagQ6Ywo/o0WBvm2WqFQ+Ol7HFB+GzW UhHapdmCEx/Q== X-IronPort-AV: E=McAfee;i="6000,8403,9703"; a="139991141" X-IronPort-AV: E=Sophos;i="5.75,434,1589266800"; d="scan'208";a="139991141" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2020 12:41:13 -0700 IronPort-SDR: 1Ub9LQoTP5pwzztET/j/TpyqCXVHlcGcKqa7wYZLrpmOJpCquVNla1U5paw+rWOjtzxSrFaTJ+ lBZl1wwg61xQ== X-IronPort-AV: E=Sophos;i="5.75,434,1589266800"; d="scan'208";a="467199286" Received: from viveksh1-mobl.amr.corp.intel.com (HELO arch-ashland-svkelley.intel.com) ([10.255.83.117]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2020 12:41:12 -0700 From: Sean V Kelley To: bhelgaas@google.com, Jonathan.Cameron@huawei.com, rjw@rjwysocki.net, ashok.raj@intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Qiuxu Zhuo , Sean V Kelley Subject: [PATCH V2 9/9] PCI/AER: Add RCEC AER error injection support Date: Tue, 4 Aug 2020 12:40:52 -0700 Message-Id: <20200804194052.193272-10-sean.v.kelley@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200804194052.193272-1-sean.v.kelley@intel.com> References: <20200804194052.193272-1-sean.v.kelley@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Qiuxu Zhuo The Root Complex Event Collectors(RCEC) appear as peers to Root Ports and also have the AER capability. So add RCEC support to the current AER error injection driver. Co-developed-by: Sean V Kelley Signed-off-by: Qiuxu Zhuo Signed-off-by: Sean V Kelley --- drivers/pci/pcie/aer_inject.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c index c2cbf425afc5..2077dc826fdf 100644 --- a/drivers/pci/pcie/aer_inject.c +++ b/drivers/pci/pcie/aer_inject.c @@ -333,8 +333,11 @@ static int aer_inject(struct aer_error_inj *einj) if (!dev) return -ENODEV; rpdev = pcie_find_root_port(dev); + /* If Root port not found, try to find an RCEC */ + if (!rpdev) + rpdev = dev->rcec; if (!rpdev) { - pci_err(dev, "Root port not found\n"); + pci_err(dev, "Root port or RCEC not found\n"); ret = -ENODEV; goto out_put; } -- 2.27.0