Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S979869AbdDYByo (ORCPT ); Mon, 24 Apr 2017 21:54:44 -0400 Received: from mail-cys01nam02on0074.outbound.protection.outlook.com ([104.47.37.74]:23232 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936387AbdDYBxU (ORCPT ); Mon, 24 Apr 2017 21:53:20 -0400 Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=cavium.com; Date: Mon, 24 Apr 2017 18:53:11 -0700 From: Felix Manlunas To: Christoph Hellwig Cc: Bjorn Helgaas , Giovanni Cabiddu , Salvatore Benedetto , Mike Marciniszyn , Dennis Dalessandro , Derek Chickles , Satanand Burla , Felix Manlunas , Raghu Vatsavayi , Jeff Kirsher , 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: Re: [PATCH 7/7] liquidio: use pcie_flr instead of duplicating it Message-ID: <20170425015311.GA1020@felix-thinkpad.cavium.com> References: <20170414191131.14286-1-hch@lst.de> <20170414191131.14286-8-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170414191131.14286-8-hch@lst.de> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [73.71.186.126] X-ClientProxiedBy: CY4PR06CA0042.namprd06.prod.outlook.com (10.173.44.28) To CY4PR07MB3176.namprd07.prod.outlook.com (10.172.115.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67eb5612-6f39-4da7-f6e0-08d48b7dd819 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:CY4PR07MB3176; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3176;3:iplLfXA2rE+7MiqdnEMpr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;20:sduai9BAVDUoDzPVdTFtaF8RY5PusO2y5rwI7NM/U+00URwZU64AqmLT0ygwML1NnJfXf0XtkIMpwIj5+4urEdy9Ru2futUOWaX6ayppXWwLZBl4CZazrit92vxYJLAU6+j8EZSzxTvOPkGbPIArRp5ylXRvlaGMW1AR8XcinTPxEfc1wjcr0rkeaNU+QbK/8r5sX1d96uIO5OZu+yD33NjuGXEllwaUUgQPmokCkO3YsKmkExv9nLxd98sFIfaFLhLWcLlBvv3lSAXKWTF0VkWxEaEZPjr15F1Qo9VyoCX8xp6eD3QWFDjl/5AAVl9d1xfh0ZhABnasE3hGKs0ulijjBc8x9YBVgNjAoFknn35hL5wflA1iQjykc+yW0tXV4GkStgqe2fhofLBuwzqMyYlBcGIXADuF7uBI9gywR9i08dayiddgG4yOMiS8s4kpxEg3P7E02zOmCITuybigXtUSRCyzNJRYK3O2NAqRDjTIyD7/6tt3RkeHqUSu2VAB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(6072148);SRVR:CY4PR07MB3176;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3176; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3176;4:Um0wHfwp1+l5i8UrfH7THEXTgLVAUdXHAhuZzL5JcgOZ1XLF/lERBlnEiu9CD6RVn4TAgBnV0Um9AAwhWyqPp6fw1aNwtFDDhKhTWeCBAhZWroeVba1LLlerT+PweYHwokRGWufzU4zR8/6WX9i2ceo0n9s+9VxSE7u8/+f+iInzNtTxf7QboTBWE/fiB0hrWnYSZ/TeWH/uCT2YLeAKGbes8kYHAxGOZa/no0uuhIZGyDrEFJFgpdzq3JUWv3KbB3X0x3JHXfRyWpUYXKepylG7sxK5CGgKEFPv7ahY4zoXQneZWNQATMwA/JlQM47wN8rFaBfPm/PPzLUJd8J/2NyXIuq0waRGxHDKslNpTS3z70QbIGB+9Nao8IdDERHGb/zyYZLa4znjrIT54cJEoJUD2ntkvwm6loc9NJFjVte+/Dk5X6q+CDZXqSWEvHYDcABD9U+bX6Er405/P1VkO88xDoVfaLTAj15WCpMD+elMVEjceIAL1+KnM0WjlsLNzCi6xVHuQa/M3FAGtk173WVf+WUZ7Wz3+eVObDiEmJROE5+tKNLVqhaiwepVSiMHET5v8ZwQJwx0Kokj4EvzSEKtF8kxc7hVJgYKNBufnFdku+9m6jbjoON3rDmZORUIFs/z2MVJcZIS/ZJ2B7GPd7SeEjeYBxTZZXWpIHPinURjQx8y3eIw0QoP/EGeS0DK6rDJwBGGoX5G/wxhnINSXg== X-Forefront-PRVS: 0288CD37D9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6069001)(39410400002)(39450400003)(39400400002)(39850400002)(39840400002)(3846002)(7416002)(23726003)(83506001)(229853002)(2906002)(305945005)(6496005)(7736002)(38730400002)(4001350100001)(6246003)(53936002)(110136004)(5660300001)(1076002)(66066001)(2950100002)(6916009)(4326008)(47776003)(81166006)(189998001)(25786009)(551934003)(6666003)(76176999)(54356999)(86362001)(50986999)(42186005)(8676002)(6486002)(33656002)(50466002)(76506005)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3176;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR07MB3176;23:NMPyDB1BTzarQx0W5eRsZRfTboLMOt/1TX6j73b4b?= =?us-ascii?Q?RApi2PEVDsn1CpZbgChJo3B+k0V0CcP4WO1buBtIJxkJrNhGQ47WMqZ2/mXV?= =?us-ascii?Q?PMhPswDKIkbW0TmWX9PqXyq6XUV6QPo0FBlisOILeBHCtdCEVN+40720JwdP?= =?us-ascii?Q?NPPKfBBtL0iFwg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1Isxl?= =?us-ascii?Q?P+UOMX3AHlRqvzU1/BQW9cREbDUKBMKio3UZF7E0FGnI0w5lwqtHO5c4uNrp?= =?us-ascii?Q?ATR/P3JxdEtINJwoNtU2/cDq/37f2O/?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3176;6:ar/9nuCBM2+dCS3eSqv+5WXuHY9vKSKGdC3ssJmfedYNklYEFJ53wHjhB58xAsrY2C7XEegf1EkjD25lusmXen1n7S2XyANoxruRZUJycvmhAJUKvi9kzgp29rCwUKDAO2UbSH4z5I5rtEsXTQrutoWiS4/2lSX6M8SjpwyLBddG7d1PFZScC+GLJrgmkgpxATkxfqnhiujhUDUzyH/gDWoBePHljMIb0Oo1C7yMfl0JR3MBDMfcnnWA3Kb3iufBCvja05ewLUx0aYGt6mBv5xxtSunzItRI+7UjOylKl5uUqZecsUX91ksWX6pP7DtBjJnvAZRXFFc/tXYhgHgfxdBRp47wGC9a38LrWV/wG6+9no0ri5JcTI6nlni4XrFGUaI7xpteSN05ZEnmq3TIkxKfxiKKuTp230Ql2xyLIzfYInR/uW5iNpIBkuFZdulwkDaTCSdzLFqLpCJ62355HE1JidLr5nOw13AGJKYtzDyZUzfYs5FW4WvMLR6EAWmA9E+y9ERg1J04MU4wMYb6dA==;5:yON/HjykSLiVe8zk+JFrbBw7VVDuf8yR6JxjQNjijMan1kTIjtra+ETxi+S01O4FOw/BJJ46cWnEm9kFbnvrcpGEKxl3OogG8+y45zsabysw0R+oa0b8NA/KB02x0cekXTzzMykOJvSASBI80mntweX/W9ixyNag1hCLcKhaA20=;24:tf0kTzkbUSE9u0aM2PgX5CT/7Tc3QzNlJFhvztcFZiHX0oR+Mqo3tlaabmy2XF8YnnVQweuCCR4S5T0EzN0lIrryQ0ypbEqwNr1urqRlc90= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3176;7:FPuEIh1CY0fNOtd92lJApkQxXIpdyhE/V8I4tLIsMusm5V4pOVJMKaQcZ1khmQJQyq8Lw08MZN6QotEIWqSkyVcwY6m2nlB+K4DC1gko1w5YYIi8aF3fQN85ObC2qWrB9XZ4B9cR5ZM8ZQbmD5Mo3TqojKGcQxFKOwVxAQZ1ErzttvE6i7zylR1ufCZn2TBnT3v6KLRDOTWB5N8Br/ho4tsWiL/QK8vmfPvsTJlelGzgTsgXwnU/Z8/sY8jQMrciXX9BVRaVh6LzmGDZQyFreVZK2kEPmJfwRj6T66G4vP0Ch6NKSE7hokJwX+kjacqInpoTBR22TxgnBe92+/1h1g== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2017 01:53:17.6523 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3176 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1763 Lines: 47 From: Christoph Hellwig Date: Fri, 14 Apr 2017 21:11:31 +0200 > 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 > This patch works. I tested it on a LiquidIO NIC and the "next" branch of the PCI git tree. But the patch causes a gcc warning: .../lio_vf_main.c: In function 'octeon_pci_flr': .../lio_vf_main.c:862:6: warning: unused variable 'status' [-Wunused-variable] Can you rework the patch to get rid of the warning? Thanks.