All of lore.kernel.org
 help / color / mirror / Atom feed
* crypto: mxs-dcp: do not call blocking ops when !TASK_RUNNING; state=1
@ 2016-08-23 20:38 Stefan Wahren
  2016-08-24 22:52 ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Wahren @ 2016-08-23 20:38 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto, Fabio Estevam

Hi,

i'm using a iMX233-OLinuXino board and i get the following warning during boot
with 4.8.0-rc2-next-20160819:

[    2.450000] ------------[ cut here ]------------
[    2.450000] WARNING: CPU: 0 PID: 42 at kernel/sched/core.c:7602
__might_sleep+0x8c/0xa0
[    2.470000] do not call blocking ops when !TASK_RUNNING; state=1 set at
[<c048f730>] dcp_chan_thread_aes+0x24/0x664
[    2.480000] Modules linked in:
[    2.480000] CPU: 0 PID: 42 Comm: mxs_dcp_chan/ae Not tainted
4.8.0-rc2-next-20160819-dirty #2
[    2.490000] mxs-dcp 80028000.dcp: Failed to register sha1 hash!
[    2.500000] Hardware name: Freescale MXS (Device Tree)
[    2.510000] [<c00100a4>] (unwind_backtrace) from [<c000e088>]
(show_stack+0x10/0x14)
[    2.520000] [<c000e088>] (show_stack) from [<c001ce8c>] (__warn+0xd8/0x100)
[    2.530000] [<c001ce8c>] (__warn) from [<c001cf5c>]
(warn_slowpath_fmt+0x38/0x48)
[    2.540000] [<c001cf5c>] (warn_slowpath_fmt) from [<c00479dc>]
(__might_sleep+0x8c/0xa0)
[    2.540000] [<c00479dc>] (__might_sleep) from [<c05dd24c>]
(mutex_lock_nested+0x24/0x39c)
[    2.550000] [<c05dd24c>] (mutex_lock_nested) from [<c048f760>]
(dcp_chan_thread_aes+0x54/0x664)
[    2.560000] [<c048f760>] (dcp_chan_thread_aes) from [<c0040574>]
(kthread+0xd0/0xf0)
[    2.580000] [<c0040574>] (kthread) from [<c000a36c>]
(ret_from_fork+0x14/0x28)
[    2.590000] ---[ end trace e2182161e464af25 ]---

What would be the right fix for this issue?

Regards
Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: crypto: mxs-dcp: do not call blocking ops when !TASK_RUNNING; state=1
  2016-08-23 20:38 crypto: mxs-dcp: do not call blocking ops when !TASK_RUNNING; state=1 Stefan Wahren
@ 2016-08-24 22:52 ` Fabio Estevam
  2016-08-25  4:44   ` Stefan Wahren
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2016-08-24 22:52 UTC (permalink / raw)
  To: Stefan Wahren; +Cc: Herbert Xu, linux-crypto, Fabio Estevam, Marek Vašut

Hi Stefan,

On Tue, Aug 23, 2016 at 5:38 PM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> Hi,
>
> i'm using a iMX233-OLinuXino board and i get the following warning during boot
> with 4.8.0-rc2-next-20160819:
>
> [    2.450000] ------------[ cut here ]------------
> [    2.450000] WARNING: CPU: 0 PID: 42 at kernel/sched/core.c:7602
> __might_sleep+0x8c/0xa0
> [    2.470000] do not call blocking ops when !TASK_RUNNING; state=1 set at
> [<c048f730>] dcp_chan_thread_aes+0x24/0x664

Did you select any debug option to observe such messages?

The kernelci boot log does not show this problem on a imx23-olinuxino
running linux-next:
https://storage.kernelci.org/next/next-20160824/arm-mxs_defconfig/lab-pengutronix/boot-imx23-olinuxino.html

We still have the errors below:

[    4.400000] mxs-dcp 80028000.dcp: Failed to register sha1 hash!
[    4.410000] mxs-dcp: probe of 80028000.dcp failed with error -22

,but that's a different issue.

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: crypto: mxs-dcp: do not call blocking ops when !TASK_RUNNING; state=1
  2016-08-24 22:52 ` Fabio Estevam
@ 2016-08-25  4:44   ` Stefan Wahren
  2016-08-25  9:02     ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Wahren @ 2016-08-25  4:44 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linux-crypto, Herbert Xu, Fabio Estevam, Marek Vašut

Hi Fabio,

> Fabio Estevam <festevam@gmail.com> hat am 25. August 2016 um 00:52
> geschrieben:
> 
> 
> Hi Stefan,
> 
> On Tue, Aug 23, 2016 at 5:38 PM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> > Hi,
> >
> > i'm using a iMX233-OLinuXino board and i get the following warning during
> > boot
> > with 4.8.0-rc2-next-20160819:
> >
> > [    2.450000] ------------[ cut here ]------------
> > [    2.450000] WARNING: CPU: 0 PID: 42 at kernel/sched/core.c:7602
> > __might_sleep+0x8c/0xa0
> > [    2.470000] do not call blocking ops when !TASK_RUNNING; state=1 set at
> > [<c048f730>] dcp_chan_thread_aes+0x24/0x664
> 
> Did you select any debug option to observe such messages?

yes, it's CONFIG_DEBUG_ATOMIC_SLEEP. After a short web search i found this lwn
article [1].
I will try the suggested solution.

Regards
Stefan

[1] - https://lwn.net/Articles/628628/

> 
> The kernelci boot log does not show this problem on a imx23-olinuxino
> running linux-next:
> https://storage.kernelci.org/next/next-20160824/arm-mxs_defconfig/lab-pengutronix/boot-imx23-olinuxino.html
> 
> We still have the errors below:
> 
> [    4.400000] mxs-dcp 80028000.dcp: Failed to register sha1 hash!
> [    4.410000] mxs-dcp: probe of 80028000.dcp failed with error -22
> 
> ,but that's a different issue.
> 
> Regards,
> 
> Fabio Estevam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: crypto: mxs-dcp: do not call blocking ops when !TASK_RUNNING; state=1
  2016-08-25  4:44   ` Stefan Wahren
@ 2016-08-25  9:02     ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2016-08-25  9:02 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Fabio Estevam, linux-crypto, Fabio Estevam, Marek Vašut

On Thu, Aug 25, 2016 at 06:44:25AM +0200, Stefan Wahren wrote:
> Hi Fabio,
> 
> > Fabio Estevam <festevam@gmail.com> hat am 25. August 2016 um 00:52
> > geschrieben:
> > 
> > 
> > Hi Stefan,
> > 
> > On Tue, Aug 23, 2016 at 5:38 PM, Stefan Wahren <stefan.wahren@i2se.com> wrote:
> > > Hi,
> > >
> > > i'm using a iMX233-OLinuXino board and i get the following warning during
> > > boot
> > > with 4.8.0-rc2-next-20160819:
> > >
> > > [    2.450000] ------------[ cut here ]------------
> > > [    2.450000] WARNING: CPU: 0 PID: 42 at kernel/sched/core.c:7602
> > > __might_sleep+0x8c/0xa0
> > > [    2.470000] do not call blocking ops when !TASK_RUNNING; state=1 set at
> > > [<c048f730>] dcp_chan_thread_aes+0x24/0x664
> > 
> > Did you select any debug option to observe such messages?
> 
> yes, it's CONFIG_DEBUG_ATOMIC_SLEEP. After a short web search i found this lwn
> article [1].
> I will try the suggested solution.

The problem is that the driver is setting the task state too early.
In fact, there is no reason why it should be using a kthread at all.
Someone should convert this over to a work queue.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-25  9:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23 20:38 crypto: mxs-dcp: do not call blocking ops when !TASK_RUNNING; state=1 Stefan Wahren
2016-08-24 22:52 ` Fabio Estevam
2016-08-25  4:44   ` Stefan Wahren
2016-08-25  9:02     ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.