Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp380109ybt; Wed, 1 Jul 2020 00:22:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjZe9ZgJuwE9rFgczAK80QWSXScZhYM+WiQyFahR0jjGcMYSCd+K8ED4vCwZ6ESrQzGVS+ X-Received: by 2002:a17:906:b354:: with SMTP id cd20mr19567963ejb.296.1593588133595; Wed, 01 Jul 2020 00:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593588133; cv=none; d=google.com; s=arc-20160816; b=vM8yNzPD9tbq9HxxfnQflLUWwf1aZxJU+kK4Z6nsrYIrY2o4p97yEM5glVTQ9RS90D Y3anK0wlJTx+9WolvrFkhV1+aE2b6dB8uAl5H0QLRgixC0uzlhZUiI8mrqRyy1RqNqwA sDuZ6UhobiD5X+0xHITBMUOfoJufcPasSjekn99XkePOWegon1CrRMlJQdkr08DajmWK iPopJ2zglrYYr3uBDFCC3AULyxH3Kj1FQjAXUPyDAAVaeEnip0YsPgYmZC22vIWiU5Uc HrxYy+8364oIc7B4SD77jjKMCDesWxxXARsfaR8rckFP0nqNVV9/49UQt5E5VsBhOHpH Rf/Q== 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=jCBNZAEMWNlT3qtR8zEOdPdich/XuWI1zi1Z3FszJRc=; b=ITzNuY7HcaXyAt6XlKRpUa49PJDyzb0/vU/bJmse2nEgQaQwHr40l+QMO91nQ0C+7M jppSlxUNjKQBRBsIevTgQ6qRCI/rOUkMAFsB4nn4bEdSiUR1WnCGXlPw26f8hxXY129p UFomQVcCG6gD+CbVrdoXXH2O9ewrb6c/OKR8nxoqdqF+tG0PeRZiejZ5hn9TSOsv5RzP JQ5WDNqDL74fsTneswLc6HvZAe0EVBDb0hFnSKJmkSmZV6Eon8LPsLX19SooOusf7iYr V40Ug0Ocfl4oHWtxfGi569Faglb8WVQ7lDMu7Gk7CykkjP8giKqwByCIn6cfAji8r6n5 f1Wg== 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 c5si3242717edy.429.2020.07.01.00.21.48; Wed, 01 Jul 2020 00:22:13 -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 S1728133AbgGAHVo (ORCPT + 99 others); Wed, 1 Jul 2020 03:21:44 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57340 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728113AbgGAHVo (ORCPT ); Wed, 1 Jul 2020 03:21:44 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D0FA24A5DCD10D2318FC; Wed, 1 Jul 2020 15:21:41 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 1 Jul 2020 15:21:32 +0800 From: Yang Shen To: , CC: , , Subject: [Patch v2 7/9] crypto: hisilicon/qm - fix VF not available after PF FLR Date: Wed, 1 Jul 2020 15:19:53 +0800 Message-ID: <1593587995-7391-8-git-send-email-shenyang39@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1593587995-7391-1-git-send-email-shenyang39@huawei.com> References: <1593587995-7391-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 Signed-off-by: Yang Shen Reviewed-by: Zhou Wang --- 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