From patchwork Fri Sep 29 15:10:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wei Hu (Xavier)" X-Patchwork-Id: 9978211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5153F60329 for ; Fri, 29 Sep 2017 14:44:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4569229828 for ; Fri, 29 Sep 2017 14:44:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A1E029874; Fri, 29 Sep 2017 14:44:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE13029871 for ; Fri, 29 Sep 2017 14:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752411AbdI2OoR (ORCPT ); Fri, 29 Sep 2017 10:44:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7478 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159AbdI2OmR (ORCPT ); Fri, 29 Sep 2017 10:42:17 -0400 Received: from 172.30.72.59 (EHLO DGGEMS410-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DIE66166; Fri, 29 Sep 2017 22:42:14 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.301.0; Fri, 29 Sep 2017 22:42:05 +0800 From: "Wei Hu (Xavier)" To: CC: , , , , , , , , , , Subject: [PATCH V2 for-next 8/8] RDMA/hns: Replace usleep_range with udelay when checking command status Date: Fri, 29 Sep 2017 23:10:14 +0800 Message-ID: <1506697814-98432-9-git-send-email-xavier.huwei@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506697814-98432-1-git-send-email-xavier.huwei@huawei.com> References: <1506697814-98432-1-git-send-email-xavier.huwei@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.59CE5BC6.00E8, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: aa918513a10718c3303137aa99a7b8ab Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lijun Ou It replaces usleep_range with udelay to avoid using usleep_range function in spin_lock_bh spin region, because it probably cause 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 #43 Hardware name: (null) (DT) Call trace: [] dump_backtrace+0x0/0x274 [] show_stack+0x20/0x28 [] dump_stack+0x94/0xb4 [] __schedule_bug+0x68/0x84 [] __schedule+0x5fc/0x70c [] schedule+0x40/0xa4 [] schedule_hrtimeout_range_clock+0x98/0xfc [] schedule_hrtimeout_range+0x34/0x40 [] usleep_range+0x6c/0x80 [] hns_roce_cmd_send+0xe4/0x264 [hns-roce-hw-v2] [] hns_roce_cmd_query_hw_info+0x40/0x60 [hns-roce-hw-v2] [] hns_roce_v2_profile+0x28/0x668 [hns-roce-hw-v2] [] hns_roce_init+0x6c/0x948 [hns-roce-hw-v2] Signed-off-by: Lijun Ou Signed-off-by: Wei Hu (Xavier) Signed-off-by: Shaobo Xu --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 2def203..7be53021 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -589,7 +589,7 @@ 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); }