RDMA/bnxt_re: Disable/kill tasklet only if it is enabled
authorSelvin Xavier <selvin.xavier@broadcom.com>
Fri, 19 May 2023 06:48:11 +0000 (23:48 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 19 May 2023 16:26:18 +0000 (13:26 -0300)
commitab112ee7899d6171da5acd77a7ed7ae103f488de
tree4c4f4c8e2428027d60e1180268b2dd96ff4d6373
parent42b0a5e691087c7e7ccbb8da87d51b301a9ddeb1
RDMA/bnxt_re: Disable/kill tasklet only if it is enabled

When the ulp hook to start the IRQ fails because the rings are not
available, tasklets are not enabled. In this case when the driver is
unloaded, driver calls CREQ tasklet_kill. This causes an indefinite hang
as the tasklet is not enabled.

Driver shouldn't call tasklet_kill if it is not enabled. So using the
creq->requested and nq->requested flags to identify if both tasklets/irqs
are registered. Checking this flag while scheduling the tasklet from
ISR. Also, added a cleanup for disabling tasklet, in case request_irq
fails during start_irq.

Check for return value for bnxt_qplib_rcfw_start_irq and in case the
bnxt_qplib_rcfw_start_irq fails, return bnxt_re_start_irq without
attempting to start NQ IRQs.

Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
Link: https://lore.kernel.org/r/1684478897-12247-2-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/main.c
drivers/infiniband/hw/bnxt_re/qplib_fp.c
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c