From owner-freebsd-stable@FreeBSD.ORG Wed Feb 22 17:51:45 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A08A106564A; Wed, 22 Feb 2012 17:51:45 +0000 (UTC) (envelope-from Kashyap.Desai@lsi.com) Received: from na3sys009aog120.obsmtp.com (na3sys009aog120.obsmtp.com [74.125.149.140]) by mx1.freebsd.org (Postfix) with ESMTP id 05A7B8FC0A; Wed, 22 Feb 2012 17:51:43 +0000 (UTC) Received: from paledge01.lsi.com ([192.19.193.42]) (using TLSv1) by na3sys009aob120.postini.com ([74.125.148.12]) with SMTP ID DSNKT0UrLvPOKXWND7dy5zLJDlEh+3VyNd51@postini.com; Wed, 22 Feb 2012 09:51:44 PST Received: from PALCAS01.lsi.com (128.94.213.117) by PALEDGE01.lsi.com (192.19.193.42) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 22 Feb 2012 12:56:29 -0500 Received: from inbexch02.lsi.com (135.36.98.40) by PALCAS01.lsi.com (128.94.213.117) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 22 Feb 2012 12:51:41 -0500 Received: from inbmail01.lsi.com ([135.36.98.64]) by inbexch02.lsi.com ([135.36.98.40]) with mapi; Wed, 22 Feb 2012 23:21:38 +0530 From: "Desai, Kashyap" To: "freebsd-scsi@freebsd.org" , freebsd-stable , "ed@FreeBSD.org" , "joerg@FreeBSD.org" Date: Wed, 22 Feb 2012 23:21:36 +0530 Thread-Topic: mpslsi0 : Trying sleep, but thread marked as sleeping prohibited Thread-Index: AczxazPnpqiOme5iTReYEw8tAgtfPgAHxL5Q Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "Justin T. Gibbs" , "Kenneth D. Merry" , "McConnell, Stephen" Subject: RE: mpslsi0 : Trying sleep, but thread marked as sleeping prohibited X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Feb 2012 17:51:45 -0000 Adding Ed Schouten and Jorg Wunsch as I see there are author of msleep/mtx= related APIs. > -----Original Message----- > From: Desai, Kashyap > Sent: Wednesday, February 22, 2012 7:37 PM > To: freebsd-scsi@freebsd.org; freebsd-stable > Cc: 'Kenneth D. Merry'; McConnell, Stephen; Justin T. Gibbs > Subject: mpslsi0 : Trying sleep, but thread marked as sleeping > prohibited >=20 > Hi, >=20 > I am doing some code changes in mps dirver. While working on those > changes, I come to know about something which is new to me. > Some expert help is required to clarify my doubt. >=20 > 1. When any irq is register with FreeBSD OS, it sets " TDP_NOSLEEPING" > pflag. It means though irq in freebsd is treated as thread, > We cannot sleep in IRQ because of " "TDP_NOSLEEPING " set. > 2. In mps driver we have below code snippet in ISR routine. >=20 >=20 > mps_dprint(sc, MPS_TRACE, "%s\n", __func__); > mps_lock(sc); > mps_intr_locked(data); > mps_unlock(sc); >=20 > I wonder why there is no issue with above code ? Theoretical we cannot > sleep in ISR. (as explained in #1) > Any thoughts ? >=20 >=20 > 3. I recently added few place msleep() instead of DELAY in ISR context > and I see > " Trying sleep, but thread marked as sleeping prohibited". >=20 >=20 > ` Kashyap