From patchwork Tue May 16 14:21:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9729251 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 21C0060386 for ; Tue, 16 May 2017 14:21:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14C74285F1 for ; Tue, 16 May 2017 14:21:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 082B628A2C; Tue, 16 May 2017 14:21:18 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 87433285F1 for ; Tue, 16 May 2017 14:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752542AbdEPOVQ (ORCPT ); Tue, 16 May 2017 10:21:16 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:55155 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752287AbdEPOVQ (ORCPT ); Tue, 16 May 2017 10:21:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=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:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=i8YsOks2f9cc1sRiTLyuiixvTowHq44K2/uv6SGVBzk=; b=mY/z5NPta5UsOMbWE31Z+AO2B +TcWBigGYVboQofZMlRbteCI7Mk/qKeHNJIhVLjdmV+YigRrF3sn8eUjAn1h5TJY72ebT8fix+/t+ UExq3ujXe41uOWSH3GIRvEQMOmJPLCYBc+QMKybSmUhTsE4fpQ5ybim61lI+oaKMtAs5W72hICJhe AIbFGwr9DVDGMrl4jaiWgUsoE/IKjc8q9tbHXQSfBHgCfuRb0SNsKUM9BW7n8gzFfxeb9jiq+VI5o 1AnweAi9qfYbNbdTnP3iszTKDVb1Z1gEeJshv8KSu5ZOEzySO8FYxiKjstnWm5TWe6nwD7fib5w/e J9pGcGetg==; Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dAdLY-0000pL-VA; Tue, 16 May 2017 14:21:09 +0000 From: Christoph Hellwig To: giovanni.cabiddu@intel.com, salvatore.benedetto@intel.com Cc: herbert@gondor.apana.org.au, qat-linux@intel.com, linux-crypto@vger.kernel.org Subject: [PATCH] crypto: qat: use pcie_flr instead of duplicating it Date: Tue, 16 May 2017 16:21:05 +0200 Message-Id: <20170516142105.21686-1-hch@lst.de> X-Mailer: git-send-email 2.11.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Christoph Hellwig --- drivers/crypto/qat/qat_common/adf_aer.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/crypto/qat/qat_common/adf_aer.c b/drivers/crypto/qat/qat_common/adf_aer.c index 2839fccdd84b..d3e25c37dc33 100644 --- a/drivers/crypto/qat/qat_common/adf_aer.c +++ b/drivers/crypto/qat/qat_common/adf_aer.c @@ -109,20 +109,7 @@ EXPORT_SYMBOL_GPL(adf_reset_sbr); void adf_reset_flr(struct adf_accel_dev *accel_dev) { - struct pci_dev *pdev = accel_to_pci_dev(accel_dev); - u16 control = 0; - int pos = 0; - - dev_info(&GET_DEV(accel_dev), "Function level reset\n"); - pos = pci_pcie_cap(pdev); - if (!pos) { - dev_err(&GET_DEV(accel_dev), "Restart device failed\n"); - return; - } - pci_read_config_word(pdev, pos + PCI_EXP_DEVCTL, &control); - control |= PCI_EXP_DEVCTL_BCR_FLR; - pci_write_config_word(pdev, pos + PCI_EXP_DEVCTL, control); - msleep(100); + pcie_flr(accel_to_pci_dev(accel_dev)); } EXPORT_SYMBOL_GPL(adf_reset_flr);