Skip to contentSkip to conversation

ASoC: sti: Return irqreturn_t instead of -EPERM in uni_player_irq_handler()

PATCH New Ian Rogers 1 participant 1 message Nov 19

Subsystems (3)
lore
Share & tools
lore

Ian Rogers

author
#0 lore raw

PATCH 1/1 ASoC: sti: Return irqreturn_t instead of -EPERM in uni_player_irq_handler()

When UNIPERIF_ITM_UNDERFLOW_REC_DONE_MASK fires while player->underflow_enabled is false, uni_player_irq_handler() sets ret = -EPERM and returns it as irqreturn_t. Returning a negative errno from a hardirq handler triggers report_bad_irq() in note_interrupt() and bypasses unhandled-IRQ storm accounting (while also clobbering IRQ_HANDLED if an earlier status bit was handled in the same call).

Leave ret unchanged (IRQ_NONE by default, or IRQ_HANDLED if an earlier error bit was handled) instead of overwriting it with -EPERM.

Found via Clang -Wassign-enum on an x86_64 allyesconfig build. Verified by building sound/soc/sti/uniperif_player.o with LLVM=1 W=1 (-Werror) and -Wassign-enum; not runtime-tested on STi hardware.

Fixes 76c2145ded6b ("ASoC: sti: Add CPU DAI driver for playback")
---
 sound/soc/sti/uniperif_player.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/sti/uniperif_player.c +0 -1
index 844ddcfc421a..63dfe2b4d304 100644
@@ -117,7 +117,6 @@ static irqreturn_t uni_player_irq_handler(int irq, void *dev_id)
 		if (!player->underflow_enabled) {
 			dev_err(player->dev,
 				"unexpected Underflow recovering\n");
-			ret = -EPERM;
 			snd_pcm_stream_unlock(player->substream);
 			return ret;
 		}
Signature · 1 line
2.56.1.708.g77570a6a1d-goog