From: Karsten Wiese Date: Tue, 18 Oct 2005 12:31:07 +0000 (+0200) Subject: [ALSA] Reduce interrupt latency in sound/pci/via82xx.c X-Git-Tag: v2.6.15-rc1~451^2~38 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f550df58f4758ea023704b409830ad9c3b47771;p=pandora-kernel.git [ALSA] Reduce interrupt latency in sound/pci/via82xx.c Modules: VIA82xx driver The change only affects the via823x kind of chips. Here the via8233_pcm_pointer_hw() function (named snd_via8233_pcm_pointer() before) needed to loop until a non zero position is red from the chip. Measurements have shown that more than 200 loops are typically needed on an Athlon64. As io-reads cost many cycles, those loops sum up huge. via8233_pcm_pointer_hw() runs either in interrupt or with interrupts disabled. So it introduces significant interrupt latency. The patch introduces a calculated position value hwptr_done, that is updated by the interrupt routine when a period is completed. It is only used, if the 823x chip returns a zero position, which can't be interpreted reliably. Further optimisation is applied on the 8233 chip's interrupt routine: Only the SGD_SHADOW is read, as it contains all infos needed. We ommit ~5 more register reads that way. Signed-off-by: Karsten Wiese Signed-off-by: Takashi Iwai --- Reading git-diff-tree failed