summaryrefslogtreecommitdiff
path: root/sound/firewire/lib.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2015-10-09 02:10:29 +0300
committerTakashi Iwai <tiwai@suse.de>2015-10-09 10:57:06 +0300
commitbde3e2880ff92f9956914afdd19648ccb20f487a (patch)
tree979aaf8249fd2c7b6037b48c2e45220993d57da1 /sound/firewire/lib.h
parentea848b7b62ab6d3078955b87833c3b336b71bc9f (diff)
downloadlinux-bde3e2880ff92f9956914afdd19648ccb20f487a.tar.xz
ALSA: firewire-lib: avoid endless loop to transfer MIDI messages at fatal error
Currently, when asynchronous transactions finish in error state and retries, work scheduling and work running also continues. This should be canceled at fatal error because it can cause endless loop. This commit enables to cancel transferring MIDI messages when transactions encounter fatal errors. This is achieved by setting error state. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/lib.h')
-rw-r--r--sound/firewire/lib.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/firewire/lib.h b/sound/firewire/lib.h
index 59e086587212..f3f6f84c48d6 100644
--- a/sound/firewire/lib.h
+++ b/sound/firewire/lib.h
@@ -32,6 +32,7 @@ struct snd_fw_async_midi_port {
struct work_struct work;
bool idling;
ktime_t next_ktime;
+ bool error;
u64 addr;
struct fw_transaction transaction;
@@ -58,8 +59,10 @@ static inline void
snd_fw_async_midi_port_run(struct snd_fw_async_midi_port *port,
struct snd_rawmidi_substream *substream)
{
- port->substream = substream;
- schedule_work(&port->work);
+ if (!port->error) {
+ port->substream = substream;
+ schedule_work(&port->work);
+ }
}
/**
@@ -70,6 +73,7 @@ static inline void
snd_fw_async_midi_port_finish(struct snd_fw_async_midi_port *port)
{
port->substream = NULL;
+ port->error = false;
}
#endif