Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3063120ybt; Mon, 29 Jun 2020 14:18:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXMSfPfdI53dC70FYrjhLJWbVB+2scDgFH/8J/8cejKnbiilarOpcuYdOYEX0VBqvfokXC X-Received: by 2002:a17:906:240d:: with SMTP id z13mr14050058eja.346.1593465485597; Mon, 29 Jun 2020 14:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593465485; cv=none; d=google.com; s=arc-20160816; b=OBOPAgOBX0znofiZOBRlCP4ZcFIJv9GdmU7khme1vCjvCsaWoYn7/SujXlt1hlHmOm 9LyR+Cbz4Cx2TyxiCPOaoD7n1ISeyUIdfSMQKYlEd0mYFICsi4qIRRgxM02i7U81mEXo v1Johsu0w6fwx2ovVH/iv/RhH7GrcxieOxyY4c4CDQOe/IQSflH7IwHeCNoSBjKvfeP9 l41ovLnOmXybi97uoelcHJxTexrA4uT2HmQIDgXTGFR03XtLl9hp4lgcn/AeriCs1/EK 7tvEJCcs+BfjvYQkGMZKf7D/sCHMHvkvLv9ClC3NoAzX25yRzNDQU+Lq7oTc/J+g3eRq WpaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=e4TPm4B2lUlm1EIw5y0TaQcdaOcfjc9TLw81C+RByjw=; b=hk35co3rM5mv0LV5SS0jCz3LutNf2+4sDzgAbBDVU6PDibnVxL+R5F5+JirDKB5HVM fHY2OguezHkxbHkOjRGr9QmD/bAvlJ7kUfjKjQZgmJe8UeanG9Q4zDAflqEPNTxR1Jh/ 70Ixy56EL2iISsxphStHyXJ+i703iPj4uHllwGgq83PVpTb8zr5YTfpohHYtJmFndc+8 eifvXv4DXNBMwDUq6ZrXYbWVzXLPqAZwDtHpzRXqdN+Wd33Isa444DhwTK48jdKyY6WI les8/1YI4PXdki+asrO4pn40/QA9OFlGhDVSM9l0+EyjOd+Sh6JFCszSKpQZHpUJRDx8 IfKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si363231eds.221.2020.06.29.14.17.42; Mon, 29 Jun 2020 14:18:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388120AbgF2VOr (ORCPT + 99 others); Mon, 29 Jun 2020 17:14:47 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59524 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730076AbgF2S5D (ORCPT ); Mon, 29 Jun 2020 14:57:03 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 32AA9DD8EA924FDB0A4E; Mon, 29 Jun 2020 19:10:58 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 29 Jun 2020 19:10:46 +0800 From: Yang Shen To: , CC: , , Subject: [PATCH 7/9] crypto: hisilicon/qm - fix VF not available after PF FLR Date: Mon, 29 Jun 2020 19:09:06 +0800 Message-ID: <1593428948-64634-8-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593428948-64634-1-git-send-email-shenyang39@huawei.com> References: <1593428948-64634-1-git-send-email-shenyang39@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Shukun Tan When PF FLR, the hardware will actively trigger the VF FLR. Configuration space of VF needs to be saved and restored to ensure that it is available after the PF FLR. Fixes: 7ce396fa12a9("crypto: hisilicon - add FLR support") Signed-off-by: Shukun Tan --- drivers/crypto/hisilicon/qm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index db816be..a441b3d 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -3334,6 +3334,9 @@ static int qm_vf_reset_prepare(struct hisi_qm *qm, continue; if (pci_physfn(virtfn) == pdev) { + /* save VFs PCIE BAR configuration */ + pci_save_state(virtfn); + ret = hisi_qm_stop(vf_qm, stop_reason); if (ret) goto stop_fail; @@ -3497,6 +3500,9 @@ static int qm_vf_reset_done(struct hisi_qm *qm) continue; if (pci_physfn(virtfn) == pdev) { + /* enable VFs PCIE BAR configuration */ + pci_restore_state(virtfn); + ret = qm_restart(vf_qm); if (ret) goto restart_fail; -- 2.7.4