From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756572AbcILFTU (ORCPT ); Mon, 12 Sep 2016 01:19:20 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:19348 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbcILFTT (ORCPT ); Mon, 12 Sep 2016 01:19:19 -0400 From: Vaishali Thakkar Subject: Use of schedule() function while holding a lock in ql4_nx.c To: QLogic-Storage-Upstream@qlogic.com, "Martin K. Petersen" , "James E.J. Bottomley" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <57D63AC7.9010507@oracle.com> Date: Mon, 12 Sep 2016 10:49:03 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I was wondering about the call to schedule in function qla4_82xx_crb_win_lock for driver drivers/scsi/qla4xxx/ql4_nx.c. It is called in 2 functions [qla4_82xx_rd_32 and qla4_82xx_wr_32] while holding a write_lock_irqsave. Normally we avoid using sleeping functions while holding a lock. Is there some reason that I am overlooking? Why it is OK in this case? Are we using schedule() here intentionally? Thank you. -- Vaishali