Unverified Commit 00acfc98 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!3508 roh/hns3: Fix the processing flow of ROH CMDq during the reset process.

parents 68747e50 a147931d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -141,6 +141,8 @@ int hns3_roh_cmdq_init(struct hns3_roh_device *hroh_dev)
	/* Init CRQ REG */
	hns3_roh_cmdq_init_regs(hroh_dev, HNS3_ROH_CMDQ_CRQ);

	clear_bit(HNS3_ROH_STATE_CMD_DISABLE, &priv->handle->rohinfo.reset_state);

	return 0;

err_crq:
@@ -340,6 +342,9 @@ int hns3_roh_cmdq_send(struct hns3_roh_device *hroh_dev, struct hns3_roh_desc *d
	int ntc = 0;
	int ret = 0;

	if (test_bit(HNS3_ROH_STATE_CMD_DISABLE, &priv->handle->rohinfo.reset_state))
		return -EIO;

	spin_lock_bh(&csq->lock);
	ret = hns3_roh_cmdq_build(hroh_dev, desc, num, &ntc);
	if (ret) {
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ enum hns3_roh_state {
	HNS3_ROH_STATE_RESETTING,
	HNS3_ROH_STATE_INIT,
	HNS3_ROH_STATE_INITED,
	HNS3_ROH_STATE_DOWN
	HNS3_ROH_STATE_DOWN,
	HNS3_ROH_STATE_CMD_DISABLE,
};

enum { HNS3_ROH_RST_DIRECT_RETURN = 0 };
+3 −0
Original line number Diff line number Diff line
@@ -388,6 +388,9 @@ static int hns3_roh_reset_notify(struct hnae3_handle *handle,
	case HNAE3_UNINIT_CLIENT:
		ret = hns3_roh_reset_notify_uninit(handle);
		break;
	case HNAE3_DOWN_CLIENT:
		set_bit(HNS3_ROH_STATE_CMD_DISABLE, &handle->rohinfo.reset_state);
		break;
	default:
		break;
	}