public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [BUG] isicom.c sleeping function called from invalid context
  2009-10-07 17:15 [BUG] isicom.c sleeping function called from invalid context Alexander Strakh
@ 2009-10-07 13:31 ` Alan Cox
  2009-10-07 14:54 ` Alan Cox
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2009-10-07 13:31 UTC (permalink / raw)
  To: Alexander Strakh; +Cc: Jiri Slaby, Linux Kernlel Mailing List

On Wed, 7 Oct 2009 17:15:14 +0000
Alexander Strakh <strakh@ispras.ru> wrote:

> 	KERNEL_VERSION: 2.6.31
> 	DESCRIBE:
> Driver drivers/char/isicom.c might sleep in atomic  context, because it calls 
> tty_port_xmit_buf under spin_lock.
> 
> ./drivers/char/isicom.c:
> 1307 static void isicom_hangup(struct tty_struct *tty)
> 1308 {
> ...
> 1315         spin_lock_irqsave(&port->card->card_lock, flags);
> 1316         isicom_shutdown_port(port);
> ...
> 
> Path to might_sleep macro from isicom_hangup:
> 1. isicom_hangup calls spin_lock_irqsave (drivers/char/isicom.c:1315) and then 
> calls isicom_shutdown_port.
> 2. isiscom_shutdown_port calls tty_port_free_xmit_buf at 
> drivers/char/isicom.c:906
> 3. tty_port_free_xmit_buf calls mutex_lock at srivers/char/tty_port:48
> 
> Found by Linux Driver Verification Project

Diagnosis is correct. I'll take a quick look at that one

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

* Re: [BUG] isicom.c sleeping function called from invalid context
  2009-10-07 17:15 [BUG] isicom.c sleeping function called from invalid context Alexander Strakh
  2009-10-07 13:31 ` Alan Cox
@ 2009-10-07 14:54 ` Alan Cox
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Cox @ 2009-10-07 14:54 UTC (permalink / raw)
  To: Alexander Strakh; +Cc: Jiri Slaby, Linux Kernlel Mailing List

On Wed, 7 Oct 2009 17:15:14 +0000
Alexander Strakh <strakh@ispras.ru> wrote:

> 	KERNEL_VERSION: 2.6.31
> 	DESCRIBE:
> Driver drivers/char/isicom.c might sleep in atomic  context, because it calls 
> tty_port_xmit_buf under spin_lock.
> 
> ./drivers/char/isicom.c:
> 1307 static void isicom_hangup(struct tty_struct *tty)
> 1308 {
> ...
> 1315         spin_lock_irqsave(&port->card->card_lock, flags);
> 1316         isicom_shutdown_port(port);
> ...
> 
> Path to might_sleep macro from isicom_hangup:
> 1. isicom_hangup calls spin_lock_irqsave (drivers/char/isicom.c:1315) and then 
> calls isicom_shutdown_port.
> 2. isiscom_shutdown_port calls tty_port_free_xmit_buf at 
> drivers/char/isicom.c:906
> 3. tty_port_free_xmit_buf calls mutex_lock at srivers/char/tty_port:48

Ok that's fairly easy to fix once the tty_port_open patch is applied


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

* [BUG] isicom.c sleeping function called from invalid context
@ 2009-10-07 17:15 Alexander Strakh
  2009-10-07 13:31 ` Alan Cox
  2009-10-07 14:54 ` Alan Cox
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Strakh @ 2009-10-07 17:15 UTC (permalink / raw)
  To: Jiri Slaby, Linux Kernlel Mailing List

	KERNEL_VERSION: 2.6.31
	DESCRIBE:
Driver drivers/char/isicom.c might sleep in atomic  context, because it calls 
tty_port_xmit_buf under spin_lock.

./drivers/char/isicom.c:
1307 static void isicom_hangup(struct tty_struct *tty)
1308 {
...
1315         spin_lock_irqsave(&port->card->card_lock, flags);
1316         isicom_shutdown_port(port);
...

Path to might_sleep macro from isicom_hangup:
1. isicom_hangup calls spin_lock_irqsave (drivers/char/isicom.c:1315) and then 
calls isicom_shutdown_port.
2. isiscom_shutdown_port calls tty_port_free_xmit_buf at 
drivers/char/isicom.c:906
3. tty_port_free_xmit_buf calls mutex_lock at srivers/char/tty_port:48

Found by Linux Driver Verification Project.

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

end of thread, other threads:[~2009-10-07 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 17:15 [BUG] isicom.c sleeping function called from invalid context Alexander Strakh
2009-10-07 13:31 ` Alan Cox
2009-10-07 14:54 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox