diff options
author | Kaike Wan <[email protected]> | 2016-03-05 08:50:49 -0800 |
---|---|---|
committer | Doug Ledford <[email protected]> | 2016-03-17 15:55:18 -0400 |
commit | 831464ce4b74eaec723bad51ea48fe3879732f66 (patch) | |
tree | 4be222146bfeee71a651665fe0c2e82b8367f9ac | |
parent | 528ee9fbf0244406a76cb5e37406eef303b09a46 (diff) |
IB/hfi1: Don't call cond_resched in atomic mode when sending packets
This patch fixed the problem where the driver might reschedule in atomic
mode when sending packets. This is due to the fact that the call to
cond_resched() in hfi1_do_send() might occur in atomic mode and a check is
required to avoid the warning message:
"kernel: BUG: scheduling while atomic: swapper/2/0/0x10000100."
Reviewed-by: Dennis Dalessandro <[email protected]>
Signed-off-by: Mike Marciniszyn <[email protected]>
Signed-off-by: Kaike Wan <[email protected]>
Signed-off-by: Jubin John <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
-rw-r--r-- | drivers/staging/rdma/hfi1/ruc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/rdma/hfi1/ruc.c b/drivers/staging/rdma/hfi1/ruc.c index aa53859503ee..08813cdbd475 100644 --- a/drivers/staging/rdma/hfi1/ruc.c +++ b/drivers/staging/rdma/hfi1/ruc.c @@ -906,8 +906,11 @@ void hfi1_do_send(struct rvt_qp *qp) *ps.ppd->dd->send_schedule); return; } - cond_resched(); - this_cpu_inc(*ps.ppd->dd->send_schedule); + if (!irqs_disabled()) { + cond_resched(); + this_cpu_inc( + *ps.ppd->dd->send_schedule); + } timeout = jiffies + (timeout_int) / 8; } spin_lock_irqsave(&qp->s_lock, flags); |