From patchwork Fri Apr 14 19:11:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 750941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3w4S6T140sz9s7p for ; Sat, 15 Apr 2017 05:15:29 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="ole6u1pe"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754957AbdDNTLw (ORCPT ); Fri, 14 Apr 2017 15:11:52 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:49160 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754937AbdDNTLt (ORCPT ); Fri, 14 Apr 2017 15:11:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qBLsWfS4DhctxWmQejy4eEfPi9kUBytKMOw7779mn1Y=; b=ole6u1peIyZ6M0WzgCFrJt5IZ WWzWYkaKYPvg9t6l4qCnCahuFftiShvJHjADLhNhTfvaGiNo5hAnY6+qpgufJahbA3Uv/v5mNpwi5 LnwXXIapSyhYjvZHK34z85sCiUOHDXceoD1mDbTjlRIiaNQfS61Xt3hYz6vl4/2YiP1ZgdrQI/Nh+ RROkFYbIB6ChGUABFcss2uwPkOQ7IYFPw664FNbUNq8q4KH9XCDLI3ew7Y4ThTtNA3qroa1YE3aRW qo25cmEtC+EmNpB4e/I2jutTFqk6gJV+CBPZK/eze5IIZZtMvNBmYiXoCvW/SO2dQZ5p0qSkiqCnn Mi75u3Jww==; Received: from 77.117.153.148.wireless.dyn.drei.com ([77.117.153.148] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1cz6dF-0003NT-SY; Fri, 14 Apr 2017 19:11:46 +0000 From: Christoph Hellwig To: Bjorn Helgaas , Giovanni Cabiddu , Salvatore Benedetto , Mike Marciniszyn , Dennis Dalessandro , Derek Chickles , Satanand Burla , Felix Manlunas , Raghu Vatsavayi , Jeff Kirsher Cc: linux-pci@vger.kernel.org, qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] PCI: call pcie_flr from reset_intel_82599_sfp_virtfn Date: Fri, 14 Apr 2017 21:11:26 +0200 Message-Id: <20170414191131.14286-3-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170414191131.14286-1-hch@lst.de> References: <20170414191131.14286-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The 82599 quirk contained an outdated copy of the FLR code. Signed-off-by: Christoph Hellwig Acked-by: Bjorn Helgaas --- drivers/pci/quirks.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 823271b13d12..8195ca294ee5 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3641,19 +3641,11 @@ static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, int probe) * * The 82599 supports FLR on VFs, but FLR support is reported only * in the PF DEVCAP (sec 9.3.10.4), not in the VF DEVCAP (sec 9.5). - * Therefore, we can't use pcie_flr(), which checks the VF DEVCAP. + * Thus we must call pcie_flr directly without first checking if it is + * supported. */ - - if (probe) - return 0; - - if (!pci_wait_for_pending_transaction(dev)) - dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); - - pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); - - msleep(100); - + if (!probe) + pcie_flr(dev); return 0; }