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:1cb9fff33035("roh/hns3: Add ROH cmdq interface support") Signed-off-by: Ke Chen chenke54@huawei.com Reviewed-by: Gang Zhang gang.zhang@huawei.com --- drivers/roh/hw/hns3/hns3_cmdq.c | 5 +++++ drivers/roh/hw/hns3/hns3_device.h | 3 ++- drivers/roh/hw/hns3/hns3_main.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/roh/hw/hns3/hns3_cmdq.c b/drivers/roh/hw/hns3/hns3_cmdq.c index 75fa2e852152..96c0286779eb 100644 --- a/drivers/roh/hw/hns3/hns3_cmdq.c +++ b/drivers/roh/hw/hns3/hns3_cmdq.c @@ -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) { diff --git a/drivers/roh/hw/hns3/hns3_device.h b/drivers/roh/hw/hns3/hns3_device.h index 07e46879a4b9..4cc5f6aeffb8 100644 --- a/drivers/roh/hw/hns3/hns3_device.h +++ b/drivers/roh/hw/hns3/hns3_device.h @@ -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 }; diff --git a/drivers/roh/hw/hns3/hns3_main.c b/drivers/roh/hw/hns3/hns3_main.c index 64f9a13e5d83..78e57a3d8a95 100644 --- a/drivers/roh/hw/hns3/hns3_main.c +++ b/drivers/roh/hw/hns3/hns3_main.c @@ -388,6 +388,8 @@ 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); default: break; }
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:1cb9fff33035("roh/hns3: Add ROH cmdq interface support") Signed-off-by: Ke Chen chenke54@huawei.com Reviewed-by: Gang Zhang gang.zhang@huawei.com --- drivers/roh/hw/hns3/hns3_cmdq.c | 5 +++++ drivers/roh/hw/hns3/hns3_device.h | 3 ++- drivers/roh/hw/hns3/hns3_main.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/roh/hw/hns3/hns3_cmdq.c b/drivers/roh/hw/hns3/hns3_cmdq.c index 75fa2e852152..96c0286779eb 100644 --- a/drivers/roh/hw/hns3/hns3_cmdq.c +++ b/drivers/roh/hw/hns3/hns3_cmdq.c @@ -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) { diff --git a/drivers/roh/hw/hns3/hns3_device.h b/drivers/roh/hw/hns3/hns3_device.h index 07e46879a4b9..4cc5f6aeffb8 100644 --- a/drivers/roh/hw/hns3/hns3_device.h +++ b/drivers/roh/hw/hns3/hns3_device.h @@ -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 }; diff --git a/drivers/roh/hw/hns3/hns3_main.c b/drivers/roh/hw/hns3/hns3_main.c index 64f9a13e5d83..5d5972f1af7f 100644 --- a/drivers/roh/hw/hns3/hns3_main.c +++ b/drivers/roh/hw/hns3/hns3_main.c @@ -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; }
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3508 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/T...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3508 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/T...
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3507 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/N...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3507 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/N...