linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* staging: r8188eu: how to handle nested mutex under spinlock
@ 2022-04-02 20:47 Michael Straube
  2022-04-02 21:13 ` Pavel Skripkin
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Michael Straube @ 2022-04-02 20:47 UTC (permalink / raw)
  To: Greg KH
  Cc: Larry Finger, Phillip Potter, open list:STAGING SUBSYSTEM,
	Linux Kernel Mailing List, straube.linux

Hi all,

smatch reported a sleeping in atomic context.

rtw_set_802_11_disassociate() <- disables preempt
-> _rtw_pwr_wakeup()
    -> ips_leave()

rtw_set_802_11_disassociate() takes a spinlock and ips_leave() uses a
mutex.

I'm fairly new to the locking stuff, but as far as I know this is not a
false positive since mutex can sleep, but that's not allowed under a
spinlock.

What is the best way to handle this?
I'm not sure if converting the mutex to a spinlock (including all the
other places where the mutex is used) is the right thing to do?

thanks,
Michael

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

end of thread, other threads:[~2022-04-04 22:08 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-02 20:47 staging: r8188eu: how to handle nested mutex under spinlock Michael Straube
2022-04-02 21:13 ` Pavel Skripkin
2022-04-02 21:32 ` Larry Finger
2022-04-03  8:44   ` Michael Straube
     [not found] ` <4389354.LvFx2qVVIh@leap>
     [not found]   ` <1813843.tdWV9SEqCh@leap>
2022-04-03 11:08     ` Michael Straube
     [not found]       ` <7365301.EvYhyI6sBW@leap>
2022-04-03 11:41         ` Michael Straube
2022-04-03 11:48           ` Pavel Skripkin
     [not found]             ` <1817830.CQOukoFCf9@leap>
2022-04-03 12:14               ` Michael Straube
2022-04-03 12:19             ` Pavel Skripkin
     [not found]               ` <4412825.cEBGB3zze1@leap>
2022-04-03 12:45                 ` Pavel Skripkin
     [not found]                   ` <2029549.KlZ2vcFHjT@leap>
2022-04-03 13:02                     ` Pavel Skripkin
2022-04-03 20:51                       ` Michael Straube
2022-04-03 21:15                         ` Pavel Skripkin
2022-04-04  8:50                           ` David Laight
2022-04-04 16:38                             ` Pavel Skripkin
2022-04-04 16:59                               ` David Laight
2022-04-04 17:12                                 ` Pavel Skripkin
     [not found]           ` <1858641.taCxCBeP46@leap>
     [not found]             ` <2366209.jE0xQCEvom@leap>
2022-04-03 12:18               ` Michael Straube
2022-04-04 13:33                 ` Dan Carpenter
2022-04-04 14:16                   ` Michael Straube
     [not found]         ` <3097543.5fSG56mABF@leap>
2022-04-03 11:44           ` Michael Straube

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).