Commit a147931d authored by Ke Chen's avatar Ke Chen
Browse files

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

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8PS3D



-----------------------------------------------------------------------

Fix the sequence issue in the ROH CMDq processing flow during
the FLR reset process, which may occasionally cause calltrace.
In this patch, we added a flag in the reset process to indicate
the availability of the ROH CMDq, in order to fix this issue.

Fixes:1cb9fff3("roh/hns3: Add ROH cmdq interface support")
Signed-off-by: default avatarKe Chen <chenke54@huawei.com>
Reviewed-by: default avatarGang Zhang <gang.zhang@huawei.com>
parent 68747e50
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;
	}