From patchwork Thu Apr 19 19:56:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 901469 X-Patchwork-Delegate: bhelgaas@google.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=codeaurora.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="ckfMkZnL"; dkim=pass (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="W/gASxxp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40RqW62DTZz9s1t for ; Fri, 20 Apr 2018 05:56:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbeDST4c (ORCPT ); Thu, 19 Apr 2018 15:56:32 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40090 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751876AbeDST4b (ORCPT ); Thu, 19 Apr 2018 15:56:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5B1946081C; Thu, 19 Apr 2018 19:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524167790; bh=1P06fz6XDNPyH4G0A9VcIKYaUHPC5dyeN5/Et+6nQbs=; h=From:To:Cc:Subject:Date:From; b=ckfMkZnL/YT63yg199AHPp3Pg61kCcvpA5HXCIsdVb3FXU/amP3cDXYx0y8Z2HlGm DEYj7SJQdr3GwwI8ZMwnkp50yVaKp5hXNyPEo7MDVO0H29bvET/UXi7dPY4yZsLI22 E9u+4B+YaaqeVGS7/bdJDbn9N8pu3o/0QjB+GMVE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 69C186081C; Thu, 19 Apr 2018 19:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1524167789; bh=1P06fz6XDNPyH4G0A9VcIKYaUHPC5dyeN5/Et+6nQbs=; h=From:To:Cc:Subject:Date:From; b=W/gASxxpXxr3vkxr6OqORHzkzMELutDKHZ+cVPctx1FPpaJpCPiKUyhidnOMMEFYB 25SHOD5QzKdK0WjbZ+tsjhA6CpILsC4QLWtdiHNwqX5EksWG/0yR5j/VlYn0r05CzA CIgiItWzu0ThMWG+5FVxQduvQ1+z9duxECZ0Z7Bg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 69C186081C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, sulrich@codeaurora.org, timur@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org (open list:HFI1 DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] IB/hfi1: Try slot reset before secondary bus reset Date: Thu, 19 Apr 2018 15:56:23 -0400 Message-Id: <1524167784-5911-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- a/drivers/infiniband/hw/hfi1/pcie.c +++ b/drivers/infiniband/hw/hfi1/pcie.c @@ -908,7 +908,8 @@ static int trigger_sbr(struct hfi1_devdata *dd) * delay after a reset is required. Per spec requirements, * the link is either working or not after that point. */ - pci_reset_bridge_secondary_bus(dev->bus->self); + if (pci_reset_slot(dev->slot)) + pci_reset_bridge_secondary_bus(dev->bus->self); return 0; }