Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Feb 2012 23:21:36 +0530
From:      "Desai, Kashyap" <Kashyap.Desai@lsi.com>
To:        "freebsd-scsi@freebsd.org" <freebsd-scsi@freebsd.org>, freebsd-stable <freebsd-stable@freebsd.org>, "ed@FreeBSD.org" <ed@FreeBSD.org>, "joerg@FreeBSD.org" <joerg@FreeBSD.org>
Cc:        "Justin T. Gibbs" <gibbs@freebsd.org>, "Kenneth D. Merry" <ken@freebsd.org>, "McConnell, Stephen" <Stephen.McConnell@lsi.com>
Subject:   RE: mpslsi0 : Trying sleep, but thread marked as sleeping prohibited
Message-ID:  <B2FD678A64EAAD45B089B123FDFC3ED72B96D3484A@inbmail01.lsi.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B2FD678A64EAAD45B089B123FDFC3ED72B96D3484A>