Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751161AbdFAPmd (ORCPT ); Thu, 1 Jun 2017 11:42:33 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:56056 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdFAPmc (ORCPT ); Thu, 1 Jun 2017 11:42:32 -0400 Date: Thu, 01 Jun 2017 11:42:30 -0400 (EDT) Message-Id: <20170601.114230.1418496773053967971.davem@davemloft.net> To: baijiaju1990@163.com Cc: harish.patil@cavium.com, manish.chopra@cavium.com, Dept-GELinuxNICDev@cavium.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] qlcnic: Fix a sleep-in-atomic bug in qlcnic_82xx_hw_write_wx_2M and qlcnic_82xx_hw_read_wx_2M From: David Miller In-Reply-To: <1496305090-17814-1-git-send-email-baijiaju1990@163.com> References: <1496305090-17814-1-git-send-email-baijiaju1990@163.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 01 Jun 2017 08:00:55 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 552 Lines: 19 From: Jia-Ju Bai Date: Thu, 1 Jun 2017 16:18:10 +0800 > The driver may sleep under a write spin lock, and the function > call path is: > qlcnic_82xx_hw_write_wx_2M (acquire the lock by write_lock_irqsave) > crb_win_lock > qlcnic_pcie_sem_lock > usleep_range > qlcnic_82xx_hw_read_wx_2M (acquire the lock by write_lock_irqsave) > crb_win_lock > qlcnic_pcie_sem_lock > usleep_range > > To fix it, the usleep_range is replaced with udelay. > > Signed-off-by: Jia-Ju Bai Applied.