From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D53CC67871 for ; Thu, 27 Oct 2022 10:22:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C04323180; Thu, 27 Oct 2022 12:22:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C04323180 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666866172; bh=f9lWdK6agStVca5kP4WiIkRyMx3lOwcx0BTeQjm9yKY=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LsIKNCHfKTu6PtWVLyfDQ2ZyGWPKsmP4LrOBMrWHNjvQHTz0cY//JrlOu7n2dFfGR tUZJL2csaWrN4z1Sg+nzLJXri53J3Nd7IvJRqzsxDd2VY8PYltYO1ukgy+OjyX2zB7 2hX05FtLlTzSeVa1SAIO9kyh06rNBgLiWnr3dOcE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 70F1CF8025A; Thu, 27 Oct 2022 12:22:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D8C46F8025E; Thu, 27 Oct 2022 12:22:00 +0200 (CEST) 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 alsa1.perex.cz (Postfix) with ESMTPS id DB7A6F8016C for ; Thu, 27 Oct 2022 12:21:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DB7A6F8016C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="X4oegaQp"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="9+9UJKI4" 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 479CC2266E; Thu, 27 Oct 2022 10:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1666866114; 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=fkqFxYH5SlTbuLxBN6lbbKa11TZmI0BPdI1E7j71Wkw=; b=X4oegaQpr9IYHRnP/NO/ALw+vZ1llCOUSK/yu7Tt7SVoLYaJYNGsKTGaxspdAmi7TusMDv OjRHD1d5OMAAmcMhoEQ8K/U2hIkfi2ZheWq89uGF/QkQ8j7qBd78rQtMmhjCs73QdkeQJq VMF7BCYKJR6LHESVyiVTDacPpmynTwE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1666866114; 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=fkqFxYH5SlTbuLxBN6lbbKa11TZmI0BPdI1E7j71Wkw=; b=9+9UJKI4Rr8iymCuUYU80T+7itDuM/b64P8ctTn5JoRpDRz2+MBEPt9lVJtXlAN1HLvBBa MEB1TleBq3XBNKAw== 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 0E5FD134CA; Thu, 27 Oct 2022 10:21:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1PsLAsJbWmMkfQAAMHmgww (envelope-from ); Thu, 27 Oct 2022 10:21:54 +0000 Date: Thu, 27 Oct 2022 12:21:53 +0200 Message-ID: <874jvpo9by.wl-tiwai@suse.de> From: Takashi Iwai To: Cezary Rojewski Subject: Re: [PATCH v3 3/9] ALSA: hda: Introduce snd_hdac_stream_wait_drsm() In-Reply-To: <20221027082331.1561740-4-cezary.rojewski@intel.com> References: <20221027082331.1561740-1-cezary.rojewski@intel.com> <20221027082331.1561740-4-cezary.rojewski@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, tiwai@suse.com, hdegoede@redhat.com, broonie@kernel.org, amadeuszx.slawinski@linux.intel.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Thu, 27 Oct 2022 10:23:25 +0200, Cezary Rojewski wrote: > --- a/sound/hda/hdac_stream.c > +++ b/sound/hda/hdac_stream.c > @@ -821,6 +821,27 @@ void snd_hdac_stream_drsm_enable(struct hdac_bus *bus, > } > EXPORT_SYMBOL_GPL(snd_hdac_stream_drsm_enable); > > +/* > + * snd_hdac_stream_wait_drsm - wait for HW to clear RSM for a stream > + * @azx_dev: HD-audio core stream to await RSM for > + * > + * Returns 0 on success and -ETIMEDOUT upon a timeout. > + */ > +int snd_hdac_stream_wait_drsm(struct hdac_stream *azx_dev) > +{ > + struct hdac_bus *bus = azx_dev->bus; > + u32 mask, reg; > + int ret; > + > + mask = 1 << azx_dev->index; > + > + ret = readb_poll_timeout(bus->drsmcap + AZX_REG_DRSM_CTL, reg, !(reg & mask), 250, 2000); Remember that HD-audio bus doesn't always allow readb(). Tegra requires the aligned access, for example. Takashi