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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F427C7EE29 for ; Tue, 13 Jun 2023 09:58:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241988AbjFMJ6B (ORCPT ); Tue, 13 Jun 2023 05:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240695AbjFMJ5x (ORCPT ); Tue, 13 Jun 2023 05:57:53 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED80A10DC for ; Tue, 13 Jun 2023 02:57:26 -0700 (PDT) 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 0AC8622650; Tue, 13 Jun 2023 09:57:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686650245; 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=ddtss2JKtl8IdHSH+rTT1DDkc07hiGaVvLqlIGQL+NA=; b=TYxQMUNOyu+CXp3C2deWEA5RIcdfXFijfwv05YS8eVNDrZ3JJZTLIIppPOxhRCDKZRwzah +KGm0rovRH7bex2a9RqO0KhjWmHvCoRuvBzgl6HoEoA+nHfyEt3NKx3hicJ5lZ9wAtSUkh gcsYCH45gVSxpCXMBcrVTHWPpKZFJ5g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686650245; 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=ddtss2JKtl8IdHSH+rTT1DDkc07hiGaVvLqlIGQL+NA=; b=tddclAA671VUEVuDPoq2DQdxikQPY7Jw4OLN3FshmFuS/u9BIg5tD0WvfTogA4qV3HDfGv nTDwZkoWp4HD8FDQ== 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 C324613345; Tue, 13 Jun 2023 09:57:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id d0SNLoQ9iGTBYwAAMHmgww (envelope-from ); Tue, 13 Jun 2023 09:57:24 +0000 Date: Tue, 13 Jun 2023 11:57:24 +0200 Message-ID: <87legnelbv.wl-tiwai@suse.de> From: Takashi Iwai To: Jon Hunter Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "Thierry Reding" , Sameer Pujar , , , "Oswald Buddenhagen" Subject: Re: [PATCH] ASoC: tegra: Fix Master Volume Control In-Reply-To: <87mt13elff.wl-tiwai@suse.de> References: <20230613093453.13927-1-jonathanh@nvidia.com> <87mt13elff.wl-tiwai@suse.de> 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 Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Tue, 13 Jun 2023 11:55:16 +0200, Takashi Iwai wrote: > > On Tue, 13 Jun 2023 11:34:53 +0200, > Jon Hunter wrote: > > > > Commit 3ed2b549b39f ("ALSA: pcm: fix wait_time calculations") corrected > > the PCM wait_time calculations and in doing so reduced the calculated > > wait_time. This exposed an issue with the Tegra Master Volume Control > > (MVC) device where the reduced wait_time caused the MVC to fail. For now > > fix this by setting the default wait_time for Tegra to be 500ms. > > > > Fixes: 3ed2b549b39f ("ALSA: pcm: fix wait_time calculations") > > Signed-off-by: Jon Hunter > > Hm, it's still not clear why it fails. The commit above changes the > timeout of wait_for_avail() to the full-buffer + 10% margin. In > thoery, the loop should abort after the full buffer read, and that > must be enough. If there were a large FIFO behind, it might be > overflow, but the fifo_size of Tegra driver seems 4, so it's > negligible. > > If extending the timeout "fixes" the problem, it might indicate that > the period update IRQ is triggered too late. Could you measure the > timing of each snd_pcm_period_elapsed() and wait_for_avail() call? OTOH, it's already at a pretty late stage for 6.4, and we need an urgent regression fix. So it's better to paper over it now, while hunting further for the real culprit. Takashi