[PATCH] [UBUNTU:sound/core/seq/] Fix sleep in atomic in virmidi driver

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Fri Apr 21 22:55:18 UTC 2006


Subject: [PATCH] [UBUNTU:sound/core/seq/] Fix sleep in atomic in virmidi driver

UpstreamStatus: Added in upstream core/seq/seq_virmidi.c r1.21

Takashi Iwai committed this patch that fixes sleeping in atomic in the
virmidi driver:

Debug: sleeping function called from invalid context at /usr/src/linux/include/linux/rwsem.h:43
 in_atomic():1, irqs_disabled():0
  [<f999d15e>] snd_seq_deliver_event+0xb4/0x1a8 [snd_seq]
  [<f999d2be>] snd_seq_kernel_client_dispatch+0x6c/0x7c [snd_seq]
  [<f93321fc>] snd_virmidi_output_trigger+0xca/0xe5 [snd_seq_virmidi]

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>

---

 sound/core/seq/seq_virmidi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

f9d9191616c0b93238f46671fa760c3b25b7b571
diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c
index e4f512a..e846ee3 100644
--- a/sound/core/seq/seq_virmidi.c
+++ b/sound/core/seq/seq_virmidi.c
@@ -165,7 +165,7 @@ static void snd_virmidi_output_trigger(s
 			return;		/* ignored */
 		}
 		if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
-			if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, 0, 0) < 0)
+			if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
 				return;
 			vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
 		}
@@ -184,7 +184,7 @@ static void snd_virmidi_output_trigger(s
 				pbuf += res;
 				count -= res;
 				if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
-					if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, 0, 0) < 0)
+					if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
 						return;
 					vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
 				}
-- 
1.1.3


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:   www.sh.nu/~crimsun/pubkey.gpg.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060421/9fd5df76/attachment.pgp>


More information about the kernel-team mailing list