summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2026-09-03 17:08:13 +0200
committerTakashi Iwai <tiwai@suse.de>2026-09-03 18:06:18 +0200
commit4c4e4be4edd5dbf5f7f6a3ef4fc0c243f2d01b3c (patch)
tree78b1c63c72d61959d25f5986a8093e050dee2b3a /include
parentbdeed0642157667bd14912241c83ffd50f9fec22 (diff)
downloadlinux-next-4c4e4be4edd5dbf5f7f6a3ef4fc0c243f2d01b3c.tar.gz
linux-next-4c4e4be4edd5dbf5f7f6a3ef4fc0c243f2d01b3c.zip
ALSA: rawmidi: Add a proper disconnect handling
The rawmidi core detaches only exposed devices at disconnection, but it doesn't deal with the pending bytes or gate the further unexpected accesses, leaving naively to each driver dealing with such situations. Let's try to restrict it in the core side for more safety: introduce the disconnected flag to each substream, set it at disconnection call, then trigger down & cancel the pending event work. Link: https://patch.msgid.link/20260903150816.1917831-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/sound/rawmidi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 4154035af414..d812f70725bd 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -86,6 +86,7 @@ struct snd_rawmidi_substream {
bool opened; /* open flag */
bool append; /* append flag (merge more streams) */
bool active_sensing; /* send active sensing when close */
+ bool disconnected; /* already disconnected */
unsigned int framing; /* whether to frame input data */
unsigned int clock_type; /* clock source to use for input framing */
int use_count; /* use counter (for output) */