From: Takashi Iwai Subject: Re: [PATCH] [RFC] sis7019: Initial support for the SiS 7019 Audio Accelerator Date: Tue, 09 Oct 2007 11:48:10 +0200 Message-ID: References: <11915588983461-git-send-email-dave@thedillows.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 35F762464D for ; Tue, 9 Oct 2007 11:48:11 +0200 (CEST) In-Reply-To: <11915588983461-git-send-email-dave@thedillows.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Dave Dillow Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 5 Oct 2007 00:34:58 -0400, Dave Dillow wrote: > > Basic audio support for the SiS 7019 Audio Accelerator as found in > the SiS 55x SoC. There is currently no synth or power management > support at the moment, but the audio playback has been tested with > several channel and rate combinations, as well as various period > and buffer configurations. > > Signed-off-by: David Dillow Thanks for the patch. The code looks almost OK to me. Below is a very brief review. > diff --git a/include/sound/sis7019.h b/include/sound/sis7019.h > new file mode 100644 > index 0000000..d395abb > --- /dev/null > +++ b/include/sound/sis7019.h Any reason to put this to include/sound? It's basically a place for headers used publicly. If the header is for the driver-only, better placed in sound/pci or a place where is private. > diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c > new file mode 100644 > index 0000000..3a74f64 > --- /dev/null > +++ b/sound/pci/sis7019.c (snip) > +struct sis7019 { > + long unsigned ioport; unsigned long is a more common style. > +static irqreturn_t sis_interrupt(int irq, void *dev) (snip) > + spin_lock(&sis->hw_lock); > + do { > + status = inl(io + SIS_PISR_A); > + if (status) { > + orig = status; > + voice = sis->voices; > + while (status) { > + bit = __ffs(status); > + status >>= bit + 1; > + voice += bit; > + snd_pcm_period_elapsed(voice->substream); You need to unlock sis->hw_lock before calling snd_pcm_period_elapsed(). It may call snd_pcm_stop() at XRUN, and this invokes the trigger callback, which locks hw_lock again. Simply re-acquire hw_lock after calling snd_pcm_period_elapsed(). > + sis_update_end_offsets(voice); > + voice++; > + } > + outl(orig, io + SIS_PISR_A); > + } > + > + status = inl(io + SIS_PISR_B); > + if (status) { > + orig = status; > + voice = &sis->voices[32]; > + while (status) { > + bit = __ffs(status); > + status >>= bit + 1; > + voice += bit; > + snd_pcm_period_elapsed(voice->substream); Ditto. > + sis_update_end_offsets(voice); > + voice++; > + } > + outl(orig, io + SIS_PISR_B); > + } > + > + status = inl(io + SIS_RISR); > + if (status) { > + voice = &sis->capture_voice; > + if (!voice->timing) > + snd_pcm_period_elapsed(voice->substream); Ditto. thanks, Takashi