From patchwork Wed Sep 5 16:08:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10589171 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AC3C5A4 for ; Wed, 5 Sep 2018 16:08:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8237F28AE8 for ; Wed, 5 Sep 2018 16:08:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7646E2A19D; Wed, 5 Sep 2018 16:08:16 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EF5928AE8 for ; Wed, 5 Sep 2018 16:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbeIEUjG (ORCPT ); Wed, 5 Sep 2018 16:39:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727494AbeIEUjG (ORCPT ); Wed, 5 Sep 2018 16:39:06 -0400 Received: from sinanubuntu1604.mkjiurmyylmellclgttazegk5f.bx.internal.cloudapp.net (unknown [40.76.78.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E08C2077C; Wed, 5 Sep 2018 16:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536163695; bh=d3FQljuFgvKpQy9DsCCyDlOXmcWIlUZwYSkAbu3BhMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFjsKq5d1bqb0otkxofe6LfQNDapklolLcekGphPumHjhWh3xwYWcDsVdiEBFKAGS 8gmKbC3h2/8gFyyrIP/uIVuhfXAHC+gOcUVAB4ntJYNb0KDk2ZuFvkDIUlOWeLLG3B 9d8OPJeWWAtgoKmuHDiHduR9rgn1OXfRvA64VDsU= From: Sinan Kaya To: linux-pci@vger.kernel.org Cc: Sinan Kaya , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Jason Gunthorpe Subject: [PATCH for-rc v2 3/3] IB/hfi1: Prefer new __pci_reset_function_locked() API with reset type Date: Wed, 5 Sep 2018 16:08:05 +0000 Message-Id: <20180905160805.5680-3-okaya@kernel.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180905160805.5680-1-okaya@kernel.org> References: <20180905160805.5680-1-okaya@kernel.org> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pci_reset_bus() is being called from the probe context and causes a deadlock since pci_reset_bus() also tries to obtain kernel lock. Use __pci_reset_function_locked() that provides locking guarantees. Fixes: 811c5cb37df4 ("PCI: Unify try slot and bus reset API") Link: https://bugzilla.kernel.org/show_bug.cgi?id=200985 Signed-off-by: Sinan Kaya Acked-by: Doug Ledford Tested-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/pcie.c b/drivers/infiniband/hw/hfi1/pcie.c index eec83757d55f..13162289b748 100644 --- a/drivers/infiniband/hw/hfi1/pcie.c +++ b/drivers/infiniband/hw/hfi1/pcie.c @@ -900,7 +900,7 @@ 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. */ - return pci_reset_bus(dev); + return __pci_reset_function_locked(dev, PCI_RESET_LINK); } /*