Skip to content

Commit

Permalink
RDMA/hns: Fix calltrace for sleeping in atomic
Browse files Browse the repository at this point in the history
We replace usleep_range that was excessively long anyway with udelay
to avoid using usleep_range function in spin_lock_bh spin region,
thereby avoiding this calltrace:

BUG: scheduling while atomic: insmod/1428/0x00000002
Modules linked in: hns-roce-hw-v2(+) hns_roce rdma_ucm rdma_cm iw_cm ib_uverbs ib_cm ib_core
CPU: 0 PID: 1428 Comm: insmod Not tainted 4.12.0-rc1-00677-g252e8fd-dirty rockchip-linux#43
Hardware name: (null) (DT)
Call trace:
[<ffff000008089d20>] dump_backtrace+0x0/0x274
[<ffff00000808a068>] show_stack+0x20/0x28
[<ffff00000844ea58>] dump_stack+0x94/0xb4
[<ffff0000080f975c>] __schedule_bug+0x68/0x84
[<ffff000008a988d4>] __schedule+0x5fc/0x70c
[<ffff000008a98a24>] schedule+0x40/0xa4
[<ffff000008a9c6f0>] schedule_hrtimeout_range_clock+0x98/0xfc
[<ffff000008a9c788>] schedule_hrtimeout_range+0x34/0x40
[<ffff000008a9c098>] usleep_range+0x6c/0x80
[<ffff000000b9ae68>] hns_roce_cmd_send+0xe4/0x264 [hns-roce-hw-v2]
[<ffff000000b9b748>] hns_roce_cmd_query_hw_info+0x40/0x60 [hns-roce-hw-v2]
[<ffff000000b9b790>] hns_roce_v2_profile+0x28/0x668 [hns-roce-hw-v2]
[<ffff000000b6b1f4>] hns_roce_init+0x6c/0x948 [hns-roce-hw-v2]

Signed-off-by: Lijun Ou <[email protected]>
Signed-off-by: Wei Hu (Xavier) <[email protected]>
Signed-off-by: Shaobo Xu <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
oulijun authored and dledford committed Sep 29, 2017
1 parent 7944ff4 commit 988e175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/hns/hns_roce_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ static int hns_roce_cmq_send(struct hns_roce_dev *hr_dev,
do {
if (hns_roce_cmq_csq_done(hr_dev))
break;
usleep_range(1000, 2000);
udelay(1);
timeout++;
} while (timeout < priv->cmq.tx_timeout);
}
Expand Down

0 comments on commit 988e175

Please sign in to comment.