Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1356725pxm; Thu, 3 Mar 2022 16:06:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7Z9fk8n75wwV9jHChpiv5GpX250iD605wxz2A/fterIGhLyDGa02+mO/Fw3qr6PdgY0Cl X-Received: by 2002:a17:902:8498:b0:14d:cca6:741 with SMTP id c24-20020a170902849800b0014dcca60741mr38557019plo.16.1646352364908; Thu, 03 Mar 2022 16:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646352364; cv=none; d=google.com; s=arc-20160816; b=KR3qJZ+fAtHvbRfeJ5BTqvikFTsGFdlyNWtMCMU64vs65e8olHF2Jxo2oDl6GpPzyB Z8DFijqkospqZii6IleX6Tq1xvPGBWvfvDbbhuSRS92ZKhPQufKeyt1hGE3in786LIFY Uz7FKS55wxa7O+eT01/uujyvXyAabqud8ujwmt2q50tzpQrXShp2IQ30/zrwn921MVMv Dz48W6mkbpQKKKjqltL5OoTk91oboCJCXQxIILZwzph6knCvicNyarmY0KeYMrGzyj6w tBZjvMcPwLldhv1Xv+J+5OygfGw6A1cyd5miy2WPMlYGm0iR9nNNLDU7dxBFN3rtEzje x7tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=IodWiwYREuu6ORDiGw3tubsIcWbEbTLKDab5+tGbHhM=; b=AEryG1NDPb9a2uYwjESFdn/DwFyuCGEy+9lOEPnqf7hrns7FAQK4N4ALZVp/dLg+Pm upjKSWNHOyZ9JN7xhSbGEKqvSdHAIMTF+LcqpRqmUz9uDQJwzLcdh78/OS1z32gdv18w PmAGYfcePeZSqfsTD/f6EkxftY54i2ggsVVAwv4hO3UBN0ECY6e7r8SjRVL3vB2Iffcl J0Z90Ftc+OmOMXvxlnIjqr0FXDDLT6zlamhV0+1VE1rUPRWeAtRnNWtw6c1z9riSPkFp yGpLq+HROoVRWf1JALg8sqk1vK52vEmHIbRHn/2p8J4SDsdMOLTQZuoaHCqn53+1Io5g ESuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y34-20020a634962000000b00372ca7631f8si3528427pgk.165.2022.03.03.16.05.44; Thu, 03 Mar 2022 16:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237196AbiCCXDn (ORCPT + 99 others); Thu, 3 Mar 2022 18:03:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235818AbiCCXDb (ORCPT ); Thu, 3 Mar 2022 18:03:31 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB2C10E042; Thu, 3 Mar 2022 15:02:43 -0800 (PST) Received: from fraeml705-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4K8mj12hQTz67fK4; Fri, 4 Mar 2022 07:02:29 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml705-chm.china.huawei.com (10.206.15.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Fri, 4 Mar 2022 00:02:41 +0100 Received: from A2006125610.china.huawei.com (10.47.82.4) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 3 Mar 2022 23:02:34 +0000 From: Shameer Kolothum To: , , CC: , , , , , , , , , , Subject: [PATCH v8 6/9] hisi_acc_vfio_pci: Add helper to retrieve the struct pci_driver Date: Thu, 3 Mar 2022 23:01:28 +0000 Message-ID: <20220303230131.2103-7-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 In-Reply-To: <20220303230131.2103-1-shameerali.kolothum.thodi@huawei.com> References: <20220303230131.2103-1-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.47.82.4] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org struct pci_driver pointer is an input into the pci_iov_get_pf_drvdata(). Introduce helpers to retrieve the ACC PF dev struct pci_driver pointers as we use this in ACC vfio migration driver. Signed-off-by: Shameer Kolothum --- drivers/crypto/hisilicon/hpre/hpre_main.c | 6 ++++++ drivers/crypto/hisilicon/sec2/sec_main.c | 6 ++++++ drivers/crypto/hisilicon/zip/zip_main.c | 6 ++++++ include/linux/hisi_acc_qm.h | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c index 3589d8879b5e..36ab30e9e654 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_main.c +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c @@ -1190,6 +1190,12 @@ static struct pci_driver hpre_pci_driver = { .driver.pm = &hpre_pm_ops, }; +struct pci_driver *hisi_hpre_get_pf_driver(void) +{ + return &hpre_pci_driver; +} +EXPORT_SYMBOL_GPL(hisi_hpre_get_pf_driver); + static void hpre_register_debugfs(void) { if (!debugfs_initialized()) diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c index 311a8747b5bf..421a405ca337 100644 --- a/drivers/crypto/hisilicon/sec2/sec_main.c +++ b/drivers/crypto/hisilicon/sec2/sec_main.c @@ -1088,6 +1088,12 @@ static struct pci_driver sec_pci_driver = { .driver.pm = &sec_pm_ops, }; +struct pci_driver *hisi_sec_get_pf_driver(void) +{ + return &sec_pci_driver; +} +EXPORT_SYMBOL_GPL(hisi_sec_get_pf_driver); + static void sec_register_debugfs(void) { if (!debugfs_initialized()) diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c index 66decfe07282..4534e1e107d1 100644 --- a/drivers/crypto/hisilicon/zip/zip_main.c +++ b/drivers/crypto/hisilicon/zip/zip_main.c @@ -1012,6 +1012,12 @@ static struct pci_driver hisi_zip_pci_driver = { .driver.pm = &hisi_zip_pm_ops, }; +struct pci_driver *hisi_zip_get_pf_driver(void) +{ + return &hisi_zip_pci_driver; +} +EXPORT_SYMBOL_GPL(hisi_zip_get_pf_driver); + static void hisi_zip_register_debugfs(void) { if (!debugfs_initialized()) diff --git a/include/linux/hisi_acc_qm.h b/include/linux/hisi_acc_qm.h index 6a6477c34666..00f2a4db8723 100644 --- a/include/linux/hisi_acc_qm.h +++ b/include/linux/hisi_acc_qm.h @@ -476,4 +476,9 @@ void hisi_qm_pm_init(struct hisi_qm *qm); int hisi_qm_get_dfx_access(struct hisi_qm *qm); void hisi_qm_put_dfx_access(struct hisi_qm *qm); void hisi_qm_regs_dump(struct seq_file *s, struct debugfs_regset32 *regset); + +/* Used by VFIO ACC live migration driver */ +struct pci_driver *hisi_sec_get_pf_driver(void); +struct pci_driver *hisi_hpre_get_pf_driver(void); +struct pci_driver *hisi_zip_get_pf_driver(void); #endif -- 2.25.1