[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180928051007.53pokj4jmazcdikz@gondor.apana.org.au>
Date: Fri, 28 Sep 2018 13:10:08 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Leonard Crestez <leonard.crestez@....com>
Cc: Marek Vasut <marek.vasut@...il.com>,
"David S . Miller " <davem@...emloft.net>,
Horia Geantă <horia.geanta@....com>,
Franck LENORMAND <franck.lenormand@....com>,
Fabio Estevam <fabio.estevam@....com>,
Shawn Guo <shawnguo@...nel.org>, linux-crypto@...r.kernel.org,
linux-imx@....com, kernel@...gutronix.de,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: mxs-dcp - Fix wait logic on chan threads
On Fri, Sep 21, 2018 at 06:03:18PM +0300, Leonard Crestez wrote:
> When compiling with CONFIG_DEBUG_ATOMIC_SLEEP=y the mxs-dcp driver
> prints warnings such as:
>
> WARNING: CPU: 0 PID: 120 at kernel/sched/core.c:7736 __might_sleep+0x98/0x9c
> do not call blocking ops when !TASK_RUNNING; state=1 set at [<8081978c>] dcp_chan_thread_sha+0x3c/0x2ec
>
> The problem is that blocking ops will manipulate current->state
> themselves so it is not allowed to call them between
> set_current_state(TASK_INTERRUPTIBLE) and schedule().
>
> Fix this by converting the per-chan mutex to a spinlock (it only
> protects tiny list ops anyway) and rearranging the wait logic so that
> callbacks are called current->state as TASK_RUNNING. Those callbacks
> will indeed call blocking ops themselves so this is required.
>
> Signed-off-by: Leonard Crestez <leonard.crestez@....com>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists