Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D29ED37B71 for ; Tue, 6 Jun 2023 13:39:21 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BFE391FD69; Tue, 6 Jun 2023 13:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686058759; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X3xzDKlG3PpmAUkZbQkkaHOVBGjwGcwG319m5fFmdYQ=; b=Zc+8aKUHA5399nKts4U33rFj2llZdKPQCtRRs7luCssnsdhlKwsdsaB4yiuo2soiFabSgw P6PH6NuDfC4JKTZW4x6P89Hbrh+GQ9YQdu4ok/ka4bagpMeGLxEso50pbBH9Q6rPc4ZqOx 2F8+wEEQIPpoBq1HMIA37OzSBFA33Fk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686058759; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=X3xzDKlG3PpmAUkZbQkkaHOVBGjwGcwG319m5fFmdYQ=; b=FcI4YqYOl7VOP9UjTFBiGHlwjSb79wLlLuiIe25aWYi/8zXKnO5IaDj3RcPeWsgMGpd+Eq +QmoJnwVS8S57DCg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 910CF13776; Tue, 6 Jun 2023 13:39:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /JZpIgc3f2R1YgAAMHmgww (envelope-from ); Tue, 06 Jun 2023 13:39:19 +0000 Date: Tue, 06 Jun 2023 15:39:19 +0200 Message-ID: <87wn0gg16g.wl-tiwai@suse.de> From: Takashi Iwai To: Yanteng Si Cc: tiwai@suse.com, perex@perex.cz, chenhuacai@loongson.cn, alsa-devel@alsa-project.org, loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn, Yingkun Meng Subject: Re: [PATCH v2 2/4] ALSA: hda: Using polling mode for loongson controller by default In-Reply-To: <521be42ac818d35a996e01cc3d591e1c87f230d9.1686057365.git.siyanteng@loongson.cn> References: <521be42ac818d35a996e01cc3d591e1c87f230d9.1686057365.git.siyanteng@loongson.cn> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 Precedence: bulk X-Mailing-List: loongarch@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII On Tue, 06 Jun 2023 15:25:28 +0200, Yanteng Si wrote: > > On loongson controller, RIRBSTS.RINTFL cannot be cleared, > azx_interrupt() is called all the time. We disable RIRB > interrupt, and use polling mode by default. > > Signed-off-by: Yanteng Si > Signed-off-by: Yingkun Meng > --- > include/sound/hdaudio.h | 1 + > sound/hda/hdac_controller.c | 5 ++++- > sound/pci/hda/hda_intel.c | 4 ++++ > 3 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/include/sound/hdaudio.h b/include/sound/hdaudio.h > index 97f09acae302..a1dcc7f97d08 100644 > --- a/include/sound/hdaudio.h > +++ b/include/sound/hdaudio.h > @@ -346,6 +346,7 @@ struct hdac_bus { > bool reverse_assign:1; /* assign devices in reverse order */ > bool corbrp_self_clear:1; /* CORBRP clears itself after reset */ > bool polling_mode:1; > + bool no_intr_polling_mode:1; It isn't clear enough what this flag does. It's basically prohibiting the RIRB IRQ (hence requiring the polling mode), right? Write it in the comment. > diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c > index 3c7af6558249..705e09cc50ac 100644 > --- a/sound/hda/hdac_controller.c > +++ b/sound/hda/hdac_controller.c > @@ -79,7 +79,10 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus) > /* set N=1, get RIRB response interrupt for new entry */ > snd_hdac_chip_writew(bus, RINTCNT, 1); > /* enable rirb dma and response irq */ > - snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN); > + if (bus->no_intr_polling_mode) > + snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN); > + else > + snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN); > /* Accept unsolicited responses */ > snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL); > spin_unlock_irq(&bus->reg_lock); > diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c > index 9c353dc7740c..1e8993836fc6 100644 > --- a/sound/pci/hda/hda_intel.c > +++ b/sound/pci/hda/hda_intel.c > @@ -1875,6 +1875,10 @@ static int azx_first_init(struct azx *chip) > if (chip->driver_type == AZX_DRIVER_GFHDMI) > bus->polling_mode = 1; > > + if (chip->driver_type == AZX_DRIVER_LOONGSON) { > + bus->no_intr_polling_mode = 1; > + } Don't you need to set the bus->polling_mode? thanks, Takashi