Skip to content

Commit

Permalink
Merge branch 'hns3-next'
Browse files Browse the repository at this point in the history
Huazhong Tan says:

====================
net: hns3: misc updates for -next

This patchset includes some misc updates for the HNS3 ethernet driver.

====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed May 27, 2020
2 parents 4a11c55 + 6f45a9b commit d6a3511
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ int hclge_cmd_init(struct hclge_dev *hdev)
* reset may happen when lower level reset is being processed.
*/
if ((hclge_is_reset_pending(hdev))) {
dev_err(&hdev->pdev->dev,
"failed to init cmd since reset %#lx pending\n",
hdev->reset_pending);
ret = -EBUSY;
goto err_cmd_init;
}
Expand Down
11 changes: 4 additions & 7 deletions drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3770,11 +3770,6 @@ static int hclge_reset_rebuild(struct hclge_dev *hdev)

hclge_clear_reset_cause(hdev);

ret = hclge_reset_prepare_up(hdev);
if (ret)
return ret;


ret = hclge_notify_roce_client(hdev, HNAE3_INIT_CLIENT);
/* ignore RoCE notify error if it fails HCLGE_RESET_MAX_FAIL_CNT - 1
* times
Expand All @@ -3783,6 +3778,10 @@ static int hclge_reset_rebuild(struct hclge_dev *hdev)
hdev->rst_stats.reset_fail_cnt < HCLGE_RESET_MAX_FAIL_CNT - 1)
return ret;

ret = hclge_reset_prepare_up(hdev);
if (ret)
return ret;

rtnl_lock();
ret = hclge_notify_client(hdev, HNAE3_UP_CLIENT);
rtnl_unlock();
Expand Down Expand Up @@ -6584,8 +6583,6 @@ static int hclge_set_app_loopback(struct hclge_dev *hdev, bool en)
/* 2 Then setup the loopback flag */
loop_en = le32_to_cpu(req->txrx_pad_fcs_loop_en);
hnae3_set_bit(loop_en, HCLGE_MAC_APP_LP_B, en ? 1 : 0);
hnae3_set_bit(loop_en, HCLGE_MAC_TX_EN_B, en ? 1 : 0);
hnae3_set_bit(loop_en, HCLGE_MAC_RX_EN_B, en ? 1 : 0);

req->txrx_pad_fcs_loop_en = cpu_to_le32(loop_en);

Expand Down
9 changes: 9 additions & 0 deletions drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2713,13 +2713,22 @@ static int hclgevf_init_nic_client_instance(struct hnae3_ae_dev *ae_dev,
struct hnae3_client *client)
{
struct hclgevf_dev *hdev = ae_dev->priv;
int rst_cnt = hdev->rst_stats.rst_cnt;
int ret;

ret = client->ops->init_instance(&hdev->nic);
if (ret)
return ret;

set_bit(HCLGEVF_STATE_NIC_REGISTERED, &hdev->state);
if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) ||
rst_cnt != hdev->rst_stats.rst_cnt) {
clear_bit(HCLGEVF_STATE_NIC_REGISTERED, &hdev->state);

client->ops->uninit_instance(&hdev->nic, 0);
return -EBUSY;
}

hnae3_set_client_init_flag(client, ae_dev, 1);

if (netif_msg_drv(&hdev->nic))
Expand Down

0 comments on commit d6a3511

Please sign in to comment.