From: Wenpeng Liang <liangwenpeng@huawei.com>
To: <dledford@redhat.com>, <jgg@nvidia.com>
Cc: <linux-rdma@vger.kernel.org>, <linuxarm@huawei.com>,
<liangwenpeng@huawei.com>
Subject: [PATCH for-next 5/7] RDMA/hns: Adjust the order in which irq are requested and enabled
Date: Thu, 26 Aug 2021 21:37:34 +0800 [thread overview]
Message-ID: <1629985056-57004-6-git-send-email-liangwenpeng@huawei.com> (raw)
In-Reply-To: <1629985056-57004-1-git-send-email-liangwenpeng@huawei.com>
It should first alloc workqueue and request irq, and finally enable irq.
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
---
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
index 85ad937..c27dc68 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
@@ -6114,35 +6114,32 @@ static int hns_roce_v2_init_eq_table(struct hns_roce_dev *hr_dev)
ret = hns_roce_v2_create_eq(hr_dev, eq, eq_cmd);
if (ret) {
- dev_err(dev, "eq create failed.\n");
+ dev_err(dev, "failed to create eq.\n");
goto err_create_eq_fail;
}
}
- /* enable irq */
- hns_roce_v2_int_mask_enable(hr_dev, eq_num, EQ_ENABLE);
+ hr_dev->irq_workq = alloc_ordered_workqueue("hns_roce_irq_workq", 0);
+ if (!hr_dev->irq_workq) {
+ dev_err(dev, "failed to create irq workqueue.\n");
+ ret = -ENOMEM;
+ goto err_create_eq_fail;
+ }
- ret = __hns_roce_request_irq(hr_dev, irq_num, comp_num,
- aeq_num, other_num);
+ ret = __hns_roce_request_irq(hr_dev, irq_num, comp_num, aeq_num,
+ other_num);
if (ret) {
- dev_err(dev, "Request irq failed.\n");
+ dev_err(dev, "failed to request irq.\n");
goto err_request_irq_fail;
}
- hr_dev->irq_workq = alloc_ordered_workqueue("hns_roce_irq_workq", 0);
- if (!hr_dev->irq_workq) {
- dev_err(dev, "Create irq workqueue failed!\n");
- ret = -ENOMEM;
- goto err_create_wq_fail;
- }
+ /* enable irq */
+ hns_roce_v2_int_mask_enable(hr_dev, eq_num, EQ_ENABLE);
return 0;
-err_create_wq_fail:
- __hns_roce_free_irq(hr_dev);
-
err_request_irq_fail:
- hns_roce_v2_int_mask_enable(hr_dev, eq_num, EQ_DISABLE);
+ destroy_workqueue(hr_dev->irq_workq);
err_create_eq_fail:
for (i -= 1; i >= 0; i--)
--
2.8.1
next prev parent reply other threads:[~2021-08-26 13:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 13:37 [PATCH for-next 0/7] RDMA/hns: Updates for 5.15 Wenpeng Liang
2021-08-26 13:37 ` [PATCH for-next 1/7] RDMA/hns: Fix query destination qpn Wenpeng Liang
2021-08-26 13:37 ` [PATCH for-next 2/7] RDMA/hns: Fix QP's resp incomplete assignment Wenpeng Liang
2021-08-26 13:37 ` [PATCH for-next 3/7] RDMA/hns: Remove dqpn filling when modify qp from Init to Init Wenpeng Liang
2021-08-26 13:37 ` [PATCH for-next 4/7] RDMA/hns: Remove RST2RST error prints for hw v1 Wenpeng Liang
2021-08-26 13:37 ` Wenpeng Liang [this message]
2021-08-26 13:37 ` [PATCH for-next 6/7] RDMA/hns: Encapsulate the qp db as a function Wenpeng Liang
2021-08-26 13:37 ` [PATCH for-next 7/7] RDMA/hns: Delete unnecessary blank lines Wenpeng Liang
2021-08-26 15:33 ` [PATCH for-next 0/7] RDMA/hns: Updates for 5.15 Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1629985056-57004-6-git-send-email-liangwenpeng@huawei.com \
--to=liangwenpeng@huawei.com \
--cc=dledford@redhat.com \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).