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: 10351517 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EFF8E60231 for ; Thu, 19 Apr 2018 19:56:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E15AD284C9 for ; Thu, 19 Apr 2018 19:56:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D60FB28515; Thu, 19 Apr 2018 19:56:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6EC08284C9 for ; Thu, 19 Apr 2018 19:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=23pnQGwBKucUD6Z7asstXFghdRsacXekDs+DFDxHdoY=; b=c7VeesCjMlijHt hHZ8InamFH/+9JmLrrsMMiysYL52piBXyk3Lw+pjAeX/1emJgQsxQ4fujW60aqet8bZ/bTqOr+fcQ 4327CUSl/yFliYNYZc1o1xnsLyc3ibh/vU2nE762UFRUESJRST5vC6GaY+sD/6fLNIQ7Ny4YfNxuR 1DTF79bsjtGlojZbDCwKnYaP3ZyZ4esTmLEir2KTFWDr2sLSwZfo8X4O8bLYxH/m3rItI/XFWobGp ITfwXILAPzZGP49mixu0V6sINIjj7DfQO33BHwNNH6l42G5Tnz9r2DA/T5321iqNXV97HklzQTEyZ XZ0BP3hlnABhc1Lz29bA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9Ffh-0005AH-9P; Thu, 19 Apr 2018 19:56:45 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9Ffc-00058d-Ko for linux-arm-kernel@lists.infradead.org; Thu, 19 Apr 2018 19:56:42 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0BE1860C55; 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= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180419_125640_743129_36F56E58 X-CRM114-Status: GOOD ( 13.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Marciniszyn , "open list:HFI1 DRIVER" , linux-arm-msm@vger.kernel.org, Dennis Dalessandro , open list , Sinan Kaya , Jason Gunthorpe , Doug Ledford , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }