linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Peter Billam <peter@www.pjb.com.au>,
	Clemens Ladisch <clemens@ladisch.de>,
	Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 3.10 08/51] ALSA: seq-dummy: remove deadlock-causing events on close
Date: Tue,  3 Feb 2015 15:16:50 -0800	[thread overview]
Message-ID: <20150203231724.827022969@linuxfoundation.org> (raw)
In-Reply-To: <20150203231724.582537862@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Clemens Ladisch <clemens@ladisch.de>

commit 0767e95bb96d7fdddcd590fb809e6975d93aebc5 upstream.

When the last subscriber to a "Through" port has been removed, the
subscribed destination ports might still be active, so it would be
wrong to send "all sounds off" and "reset controller" events to them.
The proper place for such a shutdown would be the closing of the actual
MIDI port (and close_substream() in rawmidi.c already can do this).

This also fixes a deadlock when dummy_unuse() tries to send events to
its own port that is already locked because it is being freed.

Reported-by: Peter Billam <peter@www.pjb.com.au>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/core/seq/seq_dummy.c |   31 -------------------------------
 1 file changed, 31 deletions(-)

--- a/sound/core/seq/seq_dummy.c
+++ b/sound/core/seq/seq_dummy.c
@@ -82,36 +82,6 @@ struct snd_seq_dummy_port {
 static int my_client = -1;
 
 /*
- * unuse callback - send ALL_SOUNDS_OFF and RESET_CONTROLLERS events
- * to subscribers.
- * Note: this callback is called only after all subscribers are removed.
- */
-static int
-dummy_unuse(void *private_data, struct snd_seq_port_subscribe *info)
-{
-	struct snd_seq_dummy_port *p;
-	int i;
-	struct snd_seq_event ev;
-
-	p = private_data;
-	memset(&ev, 0, sizeof(ev));
-	if (p->duplex)
-		ev.source.port = p->connect;
-	else
-		ev.source.port = p->port;
-	ev.dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS;
-	ev.type = SNDRV_SEQ_EVENT_CONTROLLER;
-	for (i = 0; i < 16; i++) {
-		ev.data.control.channel = i;
-		ev.data.control.param = MIDI_CTL_ALL_SOUNDS_OFF;
-		snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0);
-		ev.data.control.param = MIDI_CTL_RESET_CONTROLLERS;
-		snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0);
-	}
-	return 0;
-}
-
-/*
  * event input callback - just redirect events to subscribers
  */
 static int
@@ -175,7 +145,6 @@ create_port(int idx, int type)
 		| SNDRV_SEQ_PORT_TYPE_PORT;
 	memset(&pcb, 0, sizeof(pcb));
 	pcb.owner = THIS_MODULE;
-	pcb.unuse = dummy_unuse;
 	pcb.event_input = dummy_input;
 	pcb.private_free = dummy_free;
 	pcb.private_data = rec;



  parent reply	other threads:[~2015-02-03 23:36 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 23:16 [PATCH 3.10 00/51] 3.10.68-stable review Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 01/51] spi: dw-mid: fix FIFO size Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 02/51] ASoC: wm8960: Fix capture sample rate from 11250 to 11025 Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 03/51] can: kvaser_usb: Do not sleep in atomic context Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 04/51] can: kvaser_usb: Send correct context to URB completion Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 05/51] can: kvaser_usb: Retry the first bulk transfer on -ETIMEDOUT Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 06/51] can: kvaser_usb: Fix state handling upon BUS_ERROR events Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 07/51] powerpc/xmon: Fix another endiannes issue in RTAS call from xmon Greg Kroah-Hartman
2015-02-03 23:16 ` Greg Kroah-Hartman [this message]
2015-02-03 23:16 ` [PATCH 3.10 09/51] Input: i8042 - add noloop quirk for Medion Akoya E7225 (MD98857) Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 10/51] nfs: fix dio deadlock when O_DIRECT flag is flipped Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 11/51] NFSv4.1: Fix an Oops in nfs41_walk_client_list Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 12/51] nl80211: fix per-station group key get/del and memory leak Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 13/51] dm thin: dont allow messages to be sent to a pool target in READ_ONLY or FAIL mode Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 14/51] dm cache: fix missing ERR_PTR returns and handling Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 15/51] spi/pxa2xx: Clear cur_chip pointer before starting next message Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 16/51] regulator: core: fix race condition in regulator_put() Greg Kroah-Hartman
2015-02-03 23:16 ` [PATCH 3.10 17/51] drivers: net: cpsw: discard dual emac default vlan configuration Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 18/51] ARM: 7829/1: Add ".text.unlikely" and ".text.hot" to arm unwind tables Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 19/51] ARM: mm: correct pte_same behaviour for LPAE Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 20/51] ARM: LPAE: use signed arithmetic for mask definitions Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 21/51] ARM: LPAE: use phys_addr_t in alloc_init_pud() Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 22/51] ARM: fix type of PHYS_PFN_OFFSET to unsigned long Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 23/51] ARM: lpae: fix definition of PTE_HWTABLE_PTRS Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 24/51] ARM: 7866/1: include: asm: use long long instead of u64 within atomic.h Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 25/51] ARM: 7867/1: include: asm: use int instead of unsigned long for oldval in atomic_cmpxchg() Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 26/51] ARM: fix asm/memory.h build error Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 27/51] ARM: 7931/1: Correct virt_addr_valid Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 28/51] ARM: DMA: ensure that old section mappings are flushed from the TLB Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 29/51] ARM: 8108/1: mm: Introduce {pte,pmd}_isset and {pte,pmd}_isclear Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 30/51] ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 31/51] pstore: Fail to unlink if a driver has not defined pstore_erase Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 32/51] pstore: d_alloc_name() doesnt return an ERR_PTR Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 33/51] pstore: clarify clearing of _read_cnt in ramoops_context Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 34/51] pstore: skip zero size persistent ram buffer in traverse Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 35/51] pstore: Fix NULL pointer fault if get NULL prz in ramoops_get_next_prz Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 36/51] pstore/ram: avoid atomic accesses for ioremapped regions Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 37/51] efi-pstore: Make efi-pstore return a unique id Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 38/51] gpio: squelch a compiler warning Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 39/51] workqueue: fix subtle pool management issue which can stall whole worker_pool Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 40/51] IB/isert: Adjust CQ size to HW limits Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 41/51] ib_isert: Add max_send_sge=2 minimum for control PDU responses Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 42/51] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 43/51] tcm_loop: Fix wrong I_T nexus association Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 44/51] vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 45/51] iscsi,iser-target: Initiate termination only once Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 46/51] iser-target: Fix flush + disconnect completion handling Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 47/51] iser-target: Parallelize CM connection establishment Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 48/51] iser-target: Fix connected_handler + teardown flow race Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 49/51] iser-target: Handle ADDR_CHANGE event for listener cm_id Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 50/51] iser-target: Fix implicit termination of connections Greg Kroah-Hartman
2015-02-03 23:17 ` [PATCH 3.10 51/51] target: Drop arbitrary maximum I/O size limit Greg Kroah-Hartman
2015-02-04 14:01 ` [PATCH 3.10 00/51] 3.10.68-stable review Guenter Roeck
2015-02-04 17:30 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150203231724.827022969@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@www.pjb.com.au \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).