linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] soc/sti: a possible sleep-in-atomic bug in uni_player_ctl_iec958_put
@ 2017-12-12 14:27 Jia-Ju Bai
  2017-12-12 16:11 ` Arnaud Pouliquen
  0 siblings, 1 reply; 2+ messages in thread
From: Jia-Ju Bai @ 2017-12-12 14:27 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, arnaud.pouliquen, dan.carpenter
  Cc: alsa-devel, Linux Kernel Mailing List

According to sound/soc/sti/uniperif_player.c, the driver may sleep under 
a spinlock.
The function call path is:
uni_player_ctl_iec958_put (acquire the spinlock)
   uni_player_set_channel_status
     mutex_lock --> may sleep

I do not find a good way to fix it, so I only report.
This possible bug is found by my static analysis tool (DSAC) and checked 
by my code review.


Thanks,
Jia-Ju Bai

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

* Re: [BUG] soc/sti: a possible sleep-in-atomic bug in uni_player_ctl_iec958_put
  2017-12-12 14:27 [BUG] soc/sti: a possible sleep-in-atomic bug in uni_player_ctl_iec958_put Jia-Ju Bai
@ 2017-12-12 16:11 ` Arnaud Pouliquen
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaud Pouliquen @ 2017-12-12 16:11 UTC (permalink / raw)
  To: Jia-Ju Bai, lgirdwood, broonie, perex, tiwai, dan.carpenter
  Cc: alsa-devel, Linux Kernel Mailing List

Hello Jia-Ju,


On 12/12/2017 03:27 PM, Jia-Ju Bai wrote:
> According to sound/soc/sti/uniperif_player.c, the driver may sleep under
> a spinlock.
> The function call path is:
> uni_player_ctl_iec958_put (acquire the spinlock)
>   uni_player_set_channel_status
>     mutex_lock --> may sleep
> 
> I do not find a good way to fix it, so I only report.
> This possible bug is found by my static analysis tool (DSAC) and checked
> by my code review.
you right, mutex under spin lock is not recommended... I will have a look
Thanks!

Regards
Arnaud

> 
> 
> Thanks,
> Jia-Ju Bai

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

end of thread, other threads:[~2017-12-12 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-12 14:27 [BUG] soc/sti: a possible sleep-in-atomic bug in uni_player_ctl_iec958_put Jia-Ju Bai
2017-12-12 16:11 ` Arnaud Pouliquen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).