Received: by 10.192.165.148 with SMTP id m20csp22028imm; Thu, 19 Apr 2018 15:13:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx48uzu5i9+kmE9Amzpf5wZqTa7CHie7aq+GJ7j0JylJOpxjWTyAP7dGucKM9hst+7KZGDx5o X-Received: by 2002:a17:902:9890:: with SMTP id s16-v6mr7747351plp.132.1524176029667; Thu, 19 Apr 2018 15:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524176029; cv=none; d=google.com; s=arc-20160816; b=xOKbbYSY85VWhF2D24G8x+X/kIWqeesUHmyzHciI/J3Rcqsy3ChMK8JzQPGX6gpxBZ S/9+RxrUhBhAy6noLfDnssfN4gTfca1U2mcgWiLekxgt/B31g1Q7DMGYFkJdfLXTqNf2 IntYMHNkZJhuUcsyQLp3tAWbYExXKW9dyd0OYFbu1nM3Vu2P/OgoD93YU15RkKTZTiPQ JuYrLQeBUbiu0jMBQhmBQ9m+v1uOYXiCr5d9QbSygELHSvwzMXNESIthrCNUkTnOj1ES z7SbyLsA16y6ssWpCE3qrkklAyrM7VTbCkwvxIbX4P2x6Np+v2mAn3DaHojFIgJVe9xH xvXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=lEJS5zedSNK4eJ92lhk4o/p44TLWfKP/EoQ0Rm7FKjw=; b=0hlO7eMMASNf4gEaQ1S+WNhTUcVeScyBODB9lbB/4nvYFLtx8i7kLn76j0/lK8JOo9 wK81N/Rxe4iAhRbU6nl35/0HjIZvt+56QO7REPVf+2ym4QlGD9ihnu4j9OuaNdNu6urA acYCP6tjkVBXoX4q1m/MRmEIB1G176haLoXAorBWKEddnFMtk6Xe6FS+Sw5ZTq0+jYb2 SdJIyTDtib6sAT2bphLPsWl1nglWt8vmDGrsQW6wzvlu/L40MCuLjilr//InH/5dLMYk ccQFx8yqW8N5V3OpuxbglJtKFa5li/LpFptz14TVJeMo/F6zq6bBSPM7M7qKCewsav7f xyMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=jFucEj+0; 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 p2si3844545pff.253.2018.04.19.15.13.35; Thu, 19 Apr 2018 15:13:49 -0700 (PDT) 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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=jFucEj+0; 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 S1753694AbeDSWLd (ORCPT + 99 others); Thu, 19 Apr 2018 18:11:33 -0400 Received: from mail-cys01nam02on0064.outbound.protection.outlook.com ([104.47.37.64]:19630 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753657AbeDSWLa (ORCPT ); Thu, 19 Apr 2018 18:11:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lEJS5zedSNK4eJ92lhk4o/p44TLWfKP/EoQ0Rm7FKjw=; b=jFucEj+0dyevIYQ9KnMq8OR7W4fn9bioADi1f1JcQNeaSsKV7O2Yu95xFh3G1Jxjxdelkrly0FFlLyhtNuApk65BZiT7zCzAmIuuknE4is2bol0A3ACJ8ty7SSO+hc9vvLpp5fh68tt7L6jHH2z+8jITP18P998FvLOK4zPLMdc= Received: from BN6PR12MB1809.namprd12.prod.outlook.com (10.175.101.146) by BN6PR12MB1585.namprd12.prod.outlook.com (10.172.18.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.675.9; Thu, 19 Apr 2018 22:11:28 +0000 Received: from BN6PR12MB1809.namprd12.prod.outlook.com ([fe80::e81a:e42f:6a90:ed1a]) by BN6PR12MB1809.namprd12.prod.outlook.com ([fe80::e81a:e42f:6a90:ed1a%4]) with mapi id 15.20.0696.011; Thu, 19 Apr 2018 22:11:28 +0000 From: "Deucher, Alexander" To: Bjorn Helgaas , Jason Gunthorpe CC: Sinan Kaya , Bjorn Helgaas , "linux-pci@vger.kernel.org" , "sulrich@codeaurora.org" , "timur@codeaurora.org" , "linux-arm-msm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , "open list:HFI1 DRIVER" , open list Subject: RE: [PATCH 1/2] IB/hfi1: Try slot reset before secondary bus reset Thread-Topic: [PATCH 1/2] IB/hfi1: Try slot reset before secondary bus reset Thread-Index: AQHT2CgIK7x1hOYyNUildm+N/6H94aQIpOWg Date: Thu, 19 Apr 2018 22:11:27 +0000 Message-ID: References: <1524167784-5911-1-git-send-email-okaya@codeaurora.org> <20180419202632.GE14063@ziepe.ca> <20180419214722.GO28657@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <20180419214722.GO28657@bhelgaas-glaptop.roam.corp.google.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=amd.com; x-originating-ip: [76.1.164.143] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR12MB1585;7:rX7JZ8uCbLptbWayeWGeikNGVaAm1HUrbat/o7xKYkrzH9pxHcE5PAO+KCERpu9Vdju9CKK6QU3u+UXT81KHuLLubi9L673bb+YzFCaKVUCzcnMaAPShv8dj43W3D3EDaRFQEGUzRdI5WX9o0udBjm5zsHQ+3GnmhPgVNfpZ5EIhYYIBZf4OFnCvbLhfWlCMYCqv2vqFWw+4fXKYRhzgYCQVrBGDJSVydrsHayvGEhzDQf2aix93oE7MeMh078Ny;20:QLxbyq3giIK9/flehuCf9gynzvgh1125n2ti3HwaIy6NgN2pBCaxatTShQvxHc8wL2MqLYzGzY4Qfnhd3odapwJDn7QA2QTF/BAFxYYKXEjUmo75k0O/iEvUw4ua0n5NlnVWvF3jkGInNTgEYZPBTbMButpqYOXTg5VaPT17NNbbJ1GlC2Ufp5hZD3JWygUDaNCuWkLGtb4MnUUQ5WKoBMXPz9HoJob81GLyEUUbTzQKeJfyMhyvrNKVwh7dYy4V x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020);SRVR:BN6PR12MB1585; x-ms-traffictypediagnostic: BN6PR12MB1585: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(767451399110)(258649278758335)(211936372134217)(153496737603132)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231232)(944501327)(52105095)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011);SRVR:BN6PR12MB1585;BCL:0;PCL:0;RULEID:;SRVR:BN6PR12MB1585; x-forefront-prvs: 0647963F84 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(39380400002)(39860400002)(376002)(366004)(13464003)(3846002)(110136005)(102836004)(478600001)(76176011)(26005)(11346002)(305945005)(7416002)(316002)(72206003)(2906002)(7736002)(2900100001)(86362001)(53936002)(59450400001)(7696005)(5250100002)(9686003)(25786009)(6506007)(3660700001)(6246003)(33656002)(66066001)(3280700002)(4326008)(6436002)(6116002)(186003)(446003)(229853002)(74316002)(5660300001)(8676002)(53546011)(55016002)(54906003)(81166006)(8936002)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1585;H:BN6PR12MB1809.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;MLV:sfv; x-microsoft-antispam-message-info: FLsO8PeX2BSI0nYfcRojho6cD1ObCMoXTrjzjD5DnP261ZuHZ1CGze1SKbtHK3FTzHto1K97GYN6BsNm5mpqduJlVwuAvM3OaqdRvUWZBKVGkIi/07nghsAW9awq2KBo2mF9B53wuodaCQGrvhRF6QUa2CwNdHIh5uurrwrLVmF7hO+xiGCAGDF+LT+azN4r spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: a0a62472-34ed-47d7-1729-08d5a6427f9e X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0a62472-34ed-47d7-1729-08d5a6427f9e X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2018 22:11:28.0975 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1585 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > Sent: Thursday, April 19, 2018 5:47 PM > To: Jason Gunthorpe > Cc: Sinan Kaya ; Bjorn Helgaas > ; linux-pci@vger.kernel.org; > sulrich@codeaurora.org; timur@codeaurora.org; linux-arm- > msm@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Mike > Marciniszyn ; Dennis Dalessandro > ; Doug Ledford ; > open list:HFI1 DRIVER ; open list kernel@vger.kernel.org>; Deucher, Alexander > > Subject: Re: [PATCH 1/2] IB/hfi1: Try slot reset before secondary bus res= et >=20 > [+cc Alex, who might know why DRM drivers have their own PCIe Gen3 > code] >=20 > On Thu, Apr 19, 2018 at 02:26:32PM -0600, Jason Gunthorpe wrote: > > On Thu, Apr 19, 2018 at 03:56:23PM -0400, Sinan Kaya wrote: > > > The infiniband adapter might be connected to a PCI hotplug slot. > > > Performing secondary bus reset on a hotplug slot causes PCI link > up/down interrupts. > > > > > > Hotplug driver removes the device from system when a link down > > > interrupt is observed and performs re-enumeration when link up > interrupt is observed. > > > > > > This conflicts with what this code is trying to do. Try secondary > > > bus reset only if pci_reset_slot() fails/unsupported. > > > > > > Signed-off-by: Sinan Kaya > > > drivers/infiniband/hw/hfi1/pcie.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/infiniband/hw/hfi1/pcie.c > > > b/drivers/infiniband/hw/hfi1/pcie.c > > > index 83d66e8..75f49e3 100644 > > > +++ b/drivers/infiniband/hw/hfi1/pcie.c > > > @@ -908,7 +908,8 @@ static int trigger_sbr(struct hfi1_devdata *dd) > > > > The code above this hunk is: > > > > /* > > * Trigger a secondary bus reset (SBR) on ourselves using our parent. > > * > > * Based on pci_parent_bus_reset() which is not exported by the > > * kernel core. > > */ > > static int trigger_sbr(struct hfi1_devdata *dd) { > > > > [..] > > > > This really seems like something the PCI core should be helping with, > > drivers shouldn't be doing stuff like this. I get the feeling this > > should be a common need if drivers support various error recovery > > schemes? > > > > Bjorn, would be appropriate to export pci_parent_bus_reset() or some > > variation therin?? >=20 > I agree it would be really nice if the PCI core could help out somehow so= we > could get some of this code out of individual drivers. >=20 > If fact, stepping back a few paces, this HFI reset path is part of a tran= sition to > PCIe gen3 signaling, and I'm not sure why *that* is in the driver either. >=20 > There's an ongoing discussion [1] about why this gen3 code is in the driv= er. > Several DRM drivers include similar code (cik_pcie_gen3_enable(), > si_pcie_gen3_enable()). >=20 > I *thought* the hardware was supposed to automatically negotiate to the > highest rate supported by both sides without any help at all from softwar= e. > But since several drivers have code to do it themselves, I wonder if I'm > missing something, or maybe there's something the PCI core should be doin= g > that it isn't, and the driver code is basically working around that PCI c= ore > deficiency. My understanding was that some platfoms only bring up the link in gen 1 mod= e for compatibility reasons. TBH, I'm not that familiar with how the links= come up on different platforms. Alex