Lines Matching refs:handle
668 struct hnae3_handle *handle = priv->handle; in hns_roce_write512() local
669 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in hns_roce_write512()
672 if (!hr_dev->dis_db && !ops->get_hw_reset_stat(handle)) in hns_roce_write512()
1034 struct hnae3_handle *handle = priv->handle; in hns_roce_v2_cmd_hw_resetting() local
1035 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in hns_roce_v2_cmd_hw_resetting()
1052 HW_RESET_TIMEOUT_US, false, handle); in hns_roce_v2_cmd_hw_resetting()
1066 struct hnae3_handle *handle = priv->handle; in hns_roce_v2_cmd_sw_resetting() local
1067 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in hns_roce_v2_cmd_sw_resetting()
1074 if (ops->ae_dev_reset_cnt(handle) != hr_dev->reset_cnt) in hns_roce_v2_cmd_sw_resetting()
1081 struct hnae3_handle *handle) in check_aedev_reset_status() argument
1083 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in check_aedev_reset_status()
1097 instance_stage = handle->rinfo.instance_state; in check_aedev_reset_status()
1098 reset_stage = handle->rinfo.reset_state; in check_aedev_reset_status()
1099 reset_cnt = ops->ae_dev_reset_cnt(handle); in check_aedev_reset_status()
1104 hw_resetting = ops->get_cmdq_stat(handle); in check_aedev_reset_status()
1109 sw_resetting = ops->ae_dev_resetting(handle); in check_aedev_reset_status()
1119 struct hnae3_handle *handle = priv->handle; in check_device_is_in_reset() local
1120 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in check_device_is_in_reset()
1122 if (hr_dev->reset_cnt != ops->ae_dev_reset_cnt(handle)) in check_device_is_in_reset()
1125 if (ops->get_hw_reset_stat(handle)) in check_device_is_in_reset()
1128 if (ops->ae_dev_resetting(handle)) in check_device_is_in_reset()
1142 status = check_aedev_reset_status(hr_dev, priv->handle); in v2_chk_mbox_is_avail()
1245 struct hnae3_handle *handle = priv->handle; in update_cmdq_status() local
1247 if (handle->rinfo.reset_state == HNS_ROCE_STATE_RST_INIT || in update_cmdq_status()
1248 handle->rinfo.instance_state == HNS_ROCE_STATE_INIT) in update_cmdq_status()
1395 struct hnae3_handle *handle) in func_clr_hw_resetting_state() argument
1397 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in func_clr_hw_resetting_state()
1406 if (!ops->get_hw_reset_stat(handle)) { in func_clr_hw_resetting_state()
1420 struct hnae3_handle *handle) in func_clr_sw_resetting_state() argument
1422 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in func_clr_sw_resetting_state()
1431 if (ops->ae_dev_reset_cnt(handle) != in func_clr_sw_resetting_state()
1449 struct hnae3_handle *handle = priv->handle; in hns_roce_func_clr_rst_proc() local
1450 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in hns_roce_func_clr_rst_proc()
1452 if (ops->ae_dev_reset_cnt(handle) != hr_dev->reset_cnt) { in hns_roce_func_clr_rst_proc()
1459 if (ops->get_hw_reset_stat(handle)) { in hns_roce_func_clr_rst_proc()
1460 func_clr_hw_resetting_state(hr_dev, handle); in hns_roce_func_clr_rst_proc()
1464 if (ops->ae_dev_resetting(handle) && in hns_roce_func_clr_rst_proc()
1465 handle->rinfo.instance_state == HNS_ROCE_STATE_INIT) { in hns_roce_func_clr_rst_proc()
1466 func_clr_sw_resetting_state(hr_dev, handle); in hns_roce_func_clr_rst_proc()
2076 (u32)priv->handle->rinfo.num_vectors - in apply_func_caps()
3415 if (priv->handle->rinfo.reset_state == HNS_ROCE_STATE_RST_INIT || in free_mr_send_cmd_to_hw()
3416 priv->handle->rinfo.instance_state == HNS_ROCE_STATE_INIT || in free_mr_send_cmd_to_hw()
6692 struct hnae3_handle *handle) in hns_roce_hw_v2_get_cfg() argument
6698 hr_dev->pci_dev = handle->pdev; in hns_roce_hw_v2_get_cfg()
6701 hr_dev->dev = &handle->pdev->dev; in hns_roce_hw_v2_get_cfg()
6707 hr_dev->reg_base = handle->rinfo.roce_io_base; in hns_roce_hw_v2_get_cfg()
6708 hr_dev->mem_base = handle->rinfo.roce_mem_base; in hns_roce_hw_v2_get_cfg()
6710 hr_dev->iboe.netdevs[0] = handle->rinfo.netdev; in hns_roce_hw_v2_get_cfg()
6716 for (i = 0; i < handle->rinfo.num_vectors; i++) in hns_roce_hw_v2_get_cfg()
6717 hr_dev->irq[i] = pci_irq_vector(handle->pdev, in hns_roce_hw_v2_get_cfg()
6718 i + handle->rinfo.base_vector); in hns_roce_hw_v2_get_cfg()
6724 hr_dev->reset_cnt = handle->ae_algo->ops->ae_dev_reset_cnt(handle); in hns_roce_hw_v2_get_cfg()
6725 priv->handle = handle; in hns_roce_hw_v2_get_cfg()
6728 static int __hns_roce_hw_v2_init_instance(struct hnae3_handle *handle) in __hns_roce_hw_v2_init_instance() argument
6743 hns_roce_hw_v2_get_cfg(hr_dev, handle); in __hns_roce_hw_v2_init_instance()
6759 handle->priv = hr_dev; in __hns_roce_hw_v2_init_instance()
6775 static void __hns_roce_hw_v2_uninit_instance(struct hnae3_handle *handle, in __hns_roce_hw_v2_uninit_instance() argument
6778 struct hns_roce_dev *hr_dev = handle->priv; in __hns_roce_hw_v2_uninit_instance()
6783 handle->priv = NULL; in __hns_roce_hw_v2_uninit_instance()
6793 static int hns_roce_hw_v2_init_instance(struct hnae3_handle *handle) in hns_roce_hw_v2_init_instance() argument
6795 const struct hnae3_ae_ops *ops = handle->ae_algo->ops; in hns_roce_hw_v2_init_instance()
6797 struct device *dev = &handle->pdev->dev; in hns_roce_hw_v2_init_instance()
6800 handle->rinfo.instance_state = HNS_ROCE_STATE_INIT; in hns_roce_hw_v2_init_instance()
6802 if (ops->ae_dev_resetting(handle) || ops->get_hw_reset_stat(handle)) { in hns_roce_hw_v2_init_instance()
6803 handle->rinfo.instance_state = HNS_ROCE_STATE_NON_INIT; in hns_roce_hw_v2_init_instance()
6807 id = pci_match_id(hns_roce_hw_v2_pci_tbl, handle->pdev); in hns_roce_hw_v2_init_instance()
6811 if (id->driver_data && handle->pdev->revision == PCI_REVISION_ID_HIP08) in hns_roce_hw_v2_init_instance()
6814 ret = __hns_roce_hw_v2_init_instance(handle); in hns_roce_hw_v2_init_instance()
6816 handle->rinfo.instance_state = HNS_ROCE_STATE_NON_INIT; in hns_roce_hw_v2_init_instance()
6818 if (ops->ae_dev_resetting(handle) || in hns_roce_hw_v2_init_instance()
6819 ops->get_hw_reset_stat(handle)) in hns_roce_hw_v2_init_instance()
6825 handle->rinfo.instance_state = HNS_ROCE_STATE_INITED; in hns_roce_hw_v2_init_instance()
6836 static void hns_roce_hw_v2_uninit_instance(struct hnae3_handle *handle, in hns_roce_hw_v2_uninit_instance() argument
6839 if (handle->rinfo.instance_state != HNS_ROCE_STATE_INITED) in hns_roce_hw_v2_uninit_instance()
6842 handle->rinfo.instance_state = HNS_ROCE_STATE_UNINIT; in hns_roce_hw_v2_uninit_instance()
6844 __hns_roce_hw_v2_uninit_instance(handle, reset); in hns_roce_hw_v2_uninit_instance()
6846 handle->rinfo.instance_state = HNS_ROCE_STATE_NON_INIT; in hns_roce_hw_v2_uninit_instance()
6848 static int hns_roce_hw_v2_reset_notify_down(struct hnae3_handle *handle) in hns_roce_hw_v2_reset_notify_down() argument
6852 if (handle->rinfo.instance_state != HNS_ROCE_STATE_INITED) { in hns_roce_hw_v2_reset_notify_down()
6853 set_bit(HNS_ROCE_RST_DIRECT_RETURN, &handle->rinfo.state); in hns_roce_hw_v2_reset_notify_down()
6857 handle->rinfo.reset_state = HNS_ROCE_STATE_RST_DOWN; in hns_roce_hw_v2_reset_notify_down()
6858 clear_bit(HNS_ROCE_RST_DIRECT_RETURN, &handle->rinfo.state); in hns_roce_hw_v2_reset_notify_down()
6860 hr_dev = handle->priv; in hns_roce_hw_v2_reset_notify_down()
6871 static int hns_roce_hw_v2_reset_notify_init(struct hnae3_handle *handle) in hns_roce_hw_v2_reset_notify_init() argument
6873 struct device *dev = &handle->pdev->dev; in hns_roce_hw_v2_reset_notify_init()
6877 &handle->rinfo.state)) { in hns_roce_hw_v2_reset_notify_init()
6878 handle->rinfo.reset_state = HNS_ROCE_STATE_RST_INITED; in hns_roce_hw_v2_reset_notify_init()
6882 handle->rinfo.reset_state = HNS_ROCE_STATE_RST_INIT; in hns_roce_hw_v2_reset_notify_init()
6884 dev_info(&handle->pdev->dev, "In reset process RoCE client reinit.\n"); in hns_roce_hw_v2_reset_notify_init()
6885 ret = __hns_roce_hw_v2_init_instance(handle); in hns_roce_hw_v2_reset_notify_init()
6891 handle->priv = NULL; in hns_roce_hw_v2_reset_notify_init()
6894 handle->rinfo.reset_state = HNS_ROCE_STATE_RST_INITED; in hns_roce_hw_v2_reset_notify_init()
6901 static int hns_roce_hw_v2_reset_notify_uninit(struct hnae3_handle *handle) in hns_roce_hw_v2_reset_notify_uninit() argument
6903 if (test_bit(HNS_ROCE_RST_DIRECT_RETURN, &handle->rinfo.state)) in hns_roce_hw_v2_reset_notify_uninit()
6906 handle->rinfo.reset_state = HNS_ROCE_STATE_RST_UNINIT; in hns_roce_hw_v2_reset_notify_uninit()
6907 dev_info(&handle->pdev->dev, "In reset process RoCE client uninit.\n"); in hns_roce_hw_v2_reset_notify_uninit()
6909 __hns_roce_hw_v2_uninit_instance(handle, false); in hns_roce_hw_v2_reset_notify_uninit()
6914 static int hns_roce_hw_v2_reset_notify(struct hnae3_handle *handle, in hns_roce_hw_v2_reset_notify() argument
6921 ret = hns_roce_hw_v2_reset_notify_down(handle); in hns_roce_hw_v2_reset_notify()
6924 ret = hns_roce_hw_v2_reset_notify_init(handle); in hns_roce_hw_v2_reset_notify()
6927 ret = hns_roce_hw_v2_reset_notify_uninit(handle); in hns_roce_hw_v2_reset_notify()