Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 05F82194 for ; Mon, 5 Jun 2023 07:36:29 +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-out1.suse.de (Postfix) with ESMTPS id 1BC2A21AF9; Mon, 5 Jun 2023 07:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1685950588; 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=ZyQYrJRYAU3gYho/iQyn8Ng9xP05pdlHsPTn4ZWxt90=; b=gliU+Rb30zCGLi8xyOTJlGIW+XdVfUk5bwpGXHwuSOJwKHYD/rJrN7X/G/HafcmZvzG9tr ePMVcIsmIu6x+tANTMyTuDgPSVJFHrPL/FNIqK1zXdUvKlLqUnOcwqrWKJYupweaISH/Jl svldqAdMVa2B7FX8HAVlqNipj01jh0E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1685950588; 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=ZyQYrJRYAU3gYho/iQyn8Ng9xP05pdlHsPTn4ZWxt90=; b=OUhZn66bYPZj+TJK2x4/PeTCo//eI7tnnFoof+sWxKkImPXHc7YElcGjh/RPLu2jCKZ8ky d18kC5Xd+4aaAjAA== 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 D70A0139C7; Mon, 5 Jun 2023 07:36:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8MGFM3uQfWT0bwAAMHmgww (envelope-from ); Mon, 05 Jun 2023 07:36:27 +0000 Date: Mon, 05 Jun 2023 09:36:27 +0200 Message-ID: <87r0qqicn8.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 3/4] ALSA: hda: Workaround for SDnCTL register on loongson controller In-Reply-To: <74a63661726b8c44be72bf3bd35a3259f2ae2e6a.1685501806.git.siyanteng@loongson.cn> References: <74a63661726b8c44be72bf3bd35a3259f2ae2e6a.1685501806.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 Wed, 31 May 2023 05:21:33 +0200, Yanteng Si wrote: > > On loongson controller, after calling snd_hdac_stream_updateb() > to enable DMA engine, the SDnCTL.STRM will become to zero. We > need to access SDnCTL in dword to keep SDnCTL.STRM is not changed. > > Signed-off-by: Yanteng Si > Signed-off-by: Yingkun Meng > --- > sound/hda/hdac_stream.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c > index 1f56fd33b9af..90fbf9fea2b3 100644 > --- a/sound/hda/hdac_stream.c > +++ b/sound/hda/hdac_stream.c > @@ -13,6 +13,7 @@ > #include > #include > #include "trace.h" > +#include "../pci/hda/hda_controller.h" > > /* > * the hdac_stream library is intended to be used with the following > @@ -130,6 +131,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_stream_init); > void snd_hdac_stream_start(struct hdac_stream *azx_dev) > { > struct hdac_bus *bus = azx_dev->bus; > + struct azx *chip = bus_to_azx(bus); > int stripe_ctl; > > trace_snd_hdac_stream_start(bus, azx_dev); > @@ -150,7 +152,11 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev) > stripe_ctl); > } > /* set DMA start and interrupt mask */ > - snd_hdac_stream_updateb(azx_dev, SD_CTL, > + if (chip->driver_caps & AZX_DCAPS_LOONGSON_WORKAROUND) > + snd_hdac_stream_updatel(azx_dev, SD_CTL, > + 0, SD_CTL_DMA_START | SD_INT_MASK); > + else > + snd_hdac_stream_updateb(azx_dev, SD_CTL, > 0, SD_CTL_DMA_START | SD_INT_MASK); Similarly like the patch 2, this has to be handled with a new flag added to struct hdac_bus. Takashi