From: Yonglong Liu liuyonglong@huawei.com
driver inclusion category: feature bugzilla: NA CVE: NA
----------------------------
This reverts commit 6c1eadb888e9e9c6593294c1e99038229ac55bb2.
HNS3 driver use pm_ops to implement the suspend/resume function, so revert the old implementation.
Signed-off-by: Yonglong Liu liuyonglong@huawei.com Reviewed-by: li yongxin liyongxin1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 - .../net/ethernet/hisilicon/hns3/hns3_enet.c | 32 --------- .../hisilicon/hns3/hns3pf/hclge_main.c | 70 ------------------- 3 files changed, 104 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index 9c3163e837222..ed108e5639e28 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -565,8 +565,6 @@ struct hnae3_ae_ops { int (*get_module_eeprom)(struct hnae3_handle *handle, u32 offset, u32 len, u8 *data); bool (*get_cmdq_stat)(struct hnae3_handle *handle); - int (*suspend)(struct hnae3_ae_dev *ae_dev); - int (*resume)(struct hnae3_ae_dev *ae_dev);
/* Notice! If the function is not for test, the definition must before * CONFIG_HNS3_TEST! Because RoCE will use this head file, and it won't diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index a0e6553a2fd80..993bba680408e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -2208,34 +2208,6 @@ static void hns3_shutdown(struct pci_dev *pdev) pci_set_power_state(pdev, PCI_D3hot); }
-#ifdef CONFIG_PM -static int hns3_suspend(struct pci_dev *pdev, pm_message_t state) -{ - struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev); - - if (ae_dev->ops->suspend) - ae_dev->ops->suspend(ae_dev); - - pci_save_state(pdev); - pci_set_power_state(pdev, PCI_D3hot); - - return 0; -} - -static int hns3_resume(struct pci_dev *pdev) -{ - struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev); - - pci_set_power_state(pdev, PCI_D0); - pci_restore_state(pdev); - - if (ae_dev->ops->resume) - return ae_dev->ops->resume(ae_dev); - - return 0; -} -#endif - static pci_ers_result_t hns3_error_detected(struct pci_dev *pdev, pci_channel_state_t state) { @@ -2320,10 +2292,6 @@ struct pci_driver hns3_driver = { .probe = hns3_probe, .remove = hns3_remove, .shutdown = hns3_shutdown, -#ifdef CONFIG_PM - .suspend = hns3_suspend, - .resume = hns3_resume, -#endif .sriov_configure = hns3_pci_sriov_configure, .err_handler = &hns3_err_handler, }; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 41ec86a8760cf..a0372f93edf08 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3883,72 +3883,6 @@ static void hclge_reset(struct hclge_dev *hdev) hclge_reset_task_schedule(hdev); }
-#ifdef CONFIG_PM -static int hclge_suspend(struct hnae3_ae_dev *ae_dev) -{ - struct hclge_dev *hdev = ae_dev->priv; - int ret; - - ret = hclge_notify_roce_client(hdev, HNAE3_DOWN_CLIENT); - if (ret) - return ret; - - rtnl_lock(); - - ret = hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); - if (ret) - goto err_reset_lock; - - ret = hclge_notify_client(hdev, HNAE3_UNINIT_CLIENT); - if (ret) - goto err_reset_lock; - - rtnl_unlock(); - - return hclge_notify_roce_client(hdev, HNAE3_UNINIT_CLIENT); - -err_reset_lock: - rtnl_unlock(); - return ret; -} - -static int hclge_resume(struct hnae3_ae_dev *ae_dev) -{ - struct hclge_dev *hdev = ae_dev->priv; - int ret; - - rtnl_lock(); - - ret = hclge_reset_ae_dev(hdev->ae_dev); - if (ret) - goto err_reset_lock; - - ret = hclge_notify_client(hdev, HNAE3_INIT_CLIENT); - if (ret) - goto err_reset_lock; - - rtnl_unlock(); - - ret = hclge_notify_roce_client(hdev, HNAE3_INIT_CLIENT); - if (ret) - return ret; - - rtnl_lock(); - - ret = hclge_notify_client(hdev, HNAE3_UP_CLIENT); - if (ret) - goto err_reset_lock; - - rtnl_unlock(); - - return hclge_notify_roce_client(hdev, HNAE3_UP_CLIENT); - -err_reset_lock: - rtnl_unlock(); - return ret; -} -#endif - static void hclge_reset_event(struct pci_dev *pdev, struct hnae3_handle *handle) { struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev); @@ -11773,10 +11707,6 @@ struct hnae3_ae_ops hclge_ops = { .set_vf_mac = hclge_set_vf_mac, .get_module_eeprom = hclge_get_module_eeprom, .get_cmdq_stat = hclge_get_cmdq_stat, -#ifdef CONFIG_PM - .suspend = hclge_suspend, - .resume = hclge_resume, -#endif };
static struct hnae3_ae_algo ae_algo = {