From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 24 Feb 2019 15:11:49 -0000 Received: from mga02.intel.com ([134.134.136.20]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1gxvO2-0001SY-5F for speck@linutronix.de; Sun, 24 Feb 2019 16:08:14 +0100 From: Andi Kleen Subject: [MODERATED] [PATCH v6 27/43] MDSv6 Date: Sun, 24 Feb 2019 07:07:33 -0800 Message-Id: In-Reply-To: References: In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: speck@linutronix.de Cc: Andi Kleen List-ID: Add lazy_clear_cpu_interrupt() in sound core functions that are generally associated with touching user data in interrupt handlers. We consider all actual sound data as user data. Signed-off-by: Andi Kleen --- sound/core/pcm_lib.c | 3 +++ sound/core/rawmidi.c | 3 +++ sound/core/timer.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 6c0b30391ba9..d05599a8c660 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1801,6 +1802,8 @@ void snd_pcm_period_elapsed(struct snd_pcm_substream *substream) return; runtime = substream->runtime; + lazy_clear_cpu(); + snd_pcm_stream_lock_irqsave(substream, flags); if (!snd_pcm_running(substream) || snd_pcm_update_hw_ptr0(substream, 1) < 0) diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index ee601d7f0926..5edd3f0eb114 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -946,6 +947,7 @@ int snd_rawmidi_receive(struct snd_rawmidi_substream *substream, wake_up(&runtime->sleep); } spin_unlock_irqrestore(&runtime->lock, flags); + lazy_clear_cpu(); return result; } EXPORT_SYMBOL(snd_rawmidi_receive); @@ -1232,6 +1234,7 @@ int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream, result = __snd_rawmidi_transmit_ack(substream, count); } spin_unlock_irqrestore(&runtime->lock, flags); + lazy_clear_cpu(); return result; } EXPORT_SYMBOL(snd_rawmidi_transmit); diff --git a/sound/core/timer.c b/sound/core/timer.c index 61a0cec6e1f6..c8a39813f609 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -863,6 +864,8 @@ void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left) if (use_tasklet) tasklet_schedule(&timer->task_queue); + + lazy_clear_cpu(); } EXPORT_SYMBOL(snd_timer_interrupt); -- 2.17.2