Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3569576pxp; Tue, 8 Mar 2022 17:42:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYC5u8/JAS2BRud/2IXk0ZMz/IjorDFHI7QQr9I5BrB5rPVM/EYexhrxbhJ/cD6t4wZ2qJ X-Received: by 2002:a17:902:e54c:b0:151:ead7:b8bb with SMTP id n12-20020a170902e54c00b00151ead7b8bbmr13243932plf.5.1646790171462; Tue, 08 Mar 2022 17:42:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646790171; cv=none; d=google.com; s=arc-20160816; b=TWJFvgJbXX7GKDHkXIDlIpni5jOqa3HBUcvy3pAZqCFsbDKNgbhRdZsGu2zEE/5z2y 5hKb92vTro8zQ3B+i21A6XxGqOZITFnYAbNyF0HFqmaRK9miDrseIvKMoWNVo/Fr0Wsv YK6m/449+i4trKH2NjCX8fW6WmCrJC1sqvCxVNX+ibRjnMIPjkzvsytbevEVXgTElwxX pJNmN8/6mIL2e0WAHOWFTUk0Y5NfhoYiyhIZ7d50c5fNpeeH0vB9ZYz+nQZ2SKAWp4FB P6nbKgx7cJhiEc08UcphYFfZ7t1u2b4EQzM3D3qkrNkvA4d6rYLungYXN7nI4yWa9kRE TwxA== 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:cc:references:to :subject; bh=iQc7IGnWDxv74pGC/KojI4kW5DA33eJ7YijS0Bt9HzI=; b=uNaBASilfmQde7i0KqM/8WXY5Xm16g7OTL5ziZrVbBkPCm3vpaUo59WpXfrP0J5cj3 EAGADEm7P3QgnXFtufUkDTnuEYg18XDIXMC/F6woQAmYQeXUWDw5yV3tOdkhBVd1iO+M xSF4JqisYJ3s3yAmHBubHZkUcEWZNRKJy8/USKl6fwLhiyZyrIczFiis2pUTp8OMEZBo zHBA3C7WRJWn6bieRJtGdJ8Z0N0ezw7h3s5RRzz432sV5dRxsqZP1d7dIhIhu7ZZDk2D kYgY3wR1JE/Mqy2hPUJ/yHz2EpBkH40yKz9k65dCFxzv1o75CYsb9TBFC9LSUPXU+dI8 X3/A== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j8-20020a636e08000000b0037439d34a8esi486318pgc.347.2022.03.08.17.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:42:51 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-crypto-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 D093423D181; Tue, 8 Mar 2022 16:37:04 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345867AbiCHK37 (ORCPT + 99 others); Tue, 8 Mar 2022 05:29:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244341AbiCHK36 (ORCPT ); Tue, 8 Mar 2022 05:29:58 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDB1D3C48F; Tue, 8 Mar 2022 02:29:01 -0800 (PST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KCWjk5KmWzdb2N; Tue, 8 Mar 2022 18:27:38 +0800 (CST) Received: from dggpeml100012.china.huawei.com (7.185.36.121) by dggpeml500024.china.huawei.com (7.185.36.10) 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 18:29:00 +0800 Received: from [10.67.103.212] (10.67.103.212) by dggpeml100012.china.huawei.com (7.185.36.121) 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 18:28:59 +0800 Subject: Re: [PATCH v8 6/9] hisi_acc_vfio_pci: Add helper to retrieve the struct pci_driver To: Shameer Kolothum , , , References: <20220303230131.2103-1-shameerali.kolothum.thodi@huawei.com> <20220303230131.2103-7-shameerali.kolothum.thodi@huawei.com> CC: , , , , , , , , , , From: "yekai(A)" Message-ID: <77d96509-bad2-b271-aaaf-07ca6b699db6@huawei.com> Date: Tue, 8 Mar 2022 18:28:59 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20220303230131.2103-7-shameerali.kolothum.thodi@huawei.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.212] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml100012.china.huawei.com (7.185.36.121) 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-crypto@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(+) > > 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 > Hi Shameer, It looks good to me for this movement. Acked-by: Kai Ye Thanks, Kai