Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755498AbdDNTMe (ORCPT ); Fri, 14 Apr 2017 15:12:34 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:60582 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755240AbdDNTMH (ORCPT ); Fri, 14 Apr 2017 15:12:07 -0400 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 7/7] liquidio: use pcie_flr instead of duplicating it Date: Fri, 14 Apr 2017 21:11:31 +0200 Message-Id: <20170414191131.14286-8-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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1288 Lines: 33 Signed-off-by: Christoph Hellwig --- drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c index 9d5e03502c76..afdbf7fa016e 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c @@ -869,20 +869,7 @@ static void octeon_pci_flr(struct octeon_device *oct) pci_write_config_word(oct->pci_dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE); - /* Wait for Transaction Pending bit clean */ - msleep(100); - pcie_capability_read_word(oct->pci_dev, PCI_EXP_DEVSTA, &status); - if (status & PCI_EXP_DEVSTA_TRPND) { - dev_info(&oct->pci_dev->dev, "Function reset incomplete after 100ms, sleeping for 5 seconds\n"); - ssleep(5); - pcie_capability_read_word(oct->pci_dev, PCI_EXP_DEVSTA, - &status); - if (status & PCI_EXP_DEVSTA_TRPND) - dev_info(&oct->pci_dev->dev, "Function reset still incomplete after 5s, reset anyway\n"); - } - pcie_capability_set_word(oct->pci_dev, PCI_EXP_DEVCTL, - PCI_EXP_DEVCTL_BCR_FLR); - mdelay(100); + pcie_flr(oct->pci_dev); pci_cfg_access_unlock(oct->pci_dev); -- 2.11.0