Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3530794pxp; Tue, 8 Mar 2022 16:45:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJwr7p3OokOsQg/TSycIs5wNFPPAIxfsHudscXKSEGMeK8ZDr5aFbCQe/wgWMctjAaQGX8+U X-Received: by 2002:a17:902:b204:b0:14d:a8c8:af37 with SMTP id t4-20020a170902b20400b0014da8c8af37mr20571889plr.108.1646786735203; Tue, 08 Mar 2022 16:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646786735; cv=none; d=google.com; s=arc-20160816; b=PugqY+dRl/M1NYvS9LNPlk9te5lco6s29yAE0NwUwjtERtdCbms8+XKyzi+z85/ibG sIt9gJljafSSjllJ/+59ypF18s1pkuDFkeC0H01pTfJNRDGfY9aogjcEBQ5bXKFLBWxM PyWqxQqnM0lz7yRml2L7TMGdUCsX6CjZ6A9lDG3/slR+ET9V4QThzEvL9fKfm9K6b64w my0JAzTmyb7szmcpjelIv8PS0XraOaenKBJt1p0gS40cu6fj7woicqgxZxaOOYiONCGc 6o6gxESuY8g4SYvWW0oF4NjFGN3jzJ/JT2zw6oDJM4LHb4S3s85DoT8myKhj/3fe/EpC H64g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=0ubjnfzvide4w2HooLRSzej1LF1gpX7oRU2HyjaI9Hc=; b=foRxunV+xV/xw+jx7SvN+EIrSmfwLXeMpJPRTO/YmW/VZGF4nEkZy5L12aUarK3ELZ BLSPb+h50lSIEGprdbPnBnHezysCjbwhRUQmP3C3r3c/WmbC2m4FsedPume1zPwJxWuM 9eguDjcSabmN+MlkFv2FWhw1nLTM8HZWdxfzV6PxPrhiI+Mbf14va3+SOMVHei8MaYJw i1qyyNIJOYhed6BawYkxM0BDLsWGOpDwh0C85/Rtd/O79HEBmlXL+gkuQbOkzK5g8DYl 5eFHHqdh03mpF0wG55TlSCagKljB3nhfdO+mJnUUn0jcMUsWnS7jreTW5MEg9uYRDCq6 DG9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bg25-20020a056a02011900b00373d237b665si447145pgb.157.2022.03.08.16.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 16:45:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF990149951; Tue, 8 Mar 2022 16:02:00 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346644AbiCHMDe (ORCPT + 99 others); Tue, 8 Mar 2022 07:03:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233849AbiCHMDc (ORCPT ); Tue, 8 Mar 2022 07:03:32 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6DC8AE69; Tue, 8 Mar 2022 04:02:34 -0800 (PST) Received: from kwepemi500009.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KCYjh6Clnz1GCDT; Tue, 8 Mar 2022 19:57:44 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by kwepemi500009.china.huawei.com (7.221.188.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 8 Mar 2022 20:02:32 +0800 Received: from [10.67.102.118] (10.67.102.118) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 8 Mar 2022 20:02:31 +0800 Subject: Re: [PATCH v8 6/9] hisi_acc_vfio_pci: Add helper to retrieve the struct pci_driver To: Shameer Kolothum , , , CC: , , , , , , , , , References: <20220303230131.2103-1-shameerali.kolothum.thodi@huawei.com> <20220303230131.2103-7-shameerali.kolothum.thodi@huawei.com> From: liulongfang Message-ID: <553bf6f3-b473-d72c-f120-230d02f9a74a@huawei.com> Date: Tue, 8 Mar 2022 20:02:31 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20220303230131.2103-7-shameerali.kolothum.thodi@huawei.com> Content-Type: text/plain; charset="gbk" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.102.118] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-kernel@vger.kernel.org On 2022/3/4 7:01, Shameer Kolothum wrote: > 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(+) > Acked-by: Longfang Liu Thanks, Longfang. > 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 >