Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1970771rwb; Wed, 5 Oct 2022 07:24:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM52TUcVUIcRVvXcIgGDQ4AvwQfgI2vsLvr1BHhMy+L6dMHIPVVUKIkE+9EefvlhEi6pdoz2 X-Received: by 2002:a17:907:e94:b0:782:f9d2:5301 with SMTP id ho20-20020a1709070e9400b00782f9d25301mr23844453ejc.393.1664979849703; Wed, 05 Oct 2022 07:24:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664979849; cv=none; d=google.com; s=arc-20160816; b=RlNGYOQbFuhNfCVo88euQeSeOjSmPwvEGv9h6iTWqfJ3MK3LbFCJFnMvi5MKCahaZR VziTzSrJ9EzGgHiXprUxhZ0FGOe26l9nQUCtwNeXDD46sD48dEw7tzOpSQBcRkcOS06/ U7E0xgMgLA9iFEOJM3qK/kaM1x6gDxuTWk9dXgP2fYYQe7+ryFYFjRITV1Rnl5wsD2H7 3P2uYh17/DUFNhpYh3A3zAE9ncDMLIyID9ISupLhojPpRTtnQcJnMhZgmkYJWyw39inY JZXI//8POULjoA/SRKWL/r6AJnu9Q9GWdkzVTqPtM0DA+eXh9V2Twqb0a8G48LE8FGUe FIIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=XioUhwCBBtQwLWJU+hANZWRRbVnnSiuRtPmjADjh+pc=; b=GhRGD/E1Cbz53CXY7d5RdU3moLsizdN5UiceDteqf5aXOWCeZZRryoSHS5e/U3LsET sDdWPrYGUOch5ABVlx4MgTevtTrWI0FOvI/eGPXtQEuA0z+qM8W1j0y2r6Gup3TkeqYX bkEaKIeddYj5oZMey+gRHE4MqqXmx7GI965Ij9CeyAZ45zAXT3IBPrTu+QZYJI5luTkA HPyEjzeDhK9vO0TWR+PprzPxWm4ijBYf9RzpRiS9dgsoudsE5KYURjEaZzijfFhG4zSH LLtP1oX36viRGp79ct2Q2B9yJ8n3cZE19G3UTQcrkkwRbDpj4UIcrrexVHFP2xtwjFOG leKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TWzKJkgs; dkim=neutral (no key) header.i=@suse.de header.b=HYIWH8O+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v16-20020aa7dbd0000000b00446fdce2a62si12548884edt.420.2022.10.05.07.23.43; Wed, 05 Oct 2022 07:24:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TWzKJkgs; dkim=neutral (no key) header.i=@suse.de header.b=HYIWH8O+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230224AbiJEOH7 (ORCPT + 99 others); Wed, 5 Oct 2022 10:07:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbiJEOH5 (ORCPT ); Wed, 5 Oct 2022 10:07:57 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FFF76773; Wed, 5 Oct 2022 07:07:56 -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-out2.suse.de (Postfix) with ESMTPS id 06B771F45F; Wed, 5 Oct 2022 14:07:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1664978875; 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=XioUhwCBBtQwLWJU+hANZWRRbVnnSiuRtPmjADjh+pc=; b=TWzKJkgsjO+FA/Gx2PrIWWljAqlLGw07E31yArWdouhRFFJiP0UfhdDVKkhlfPv1gMobIM dPlRttIaz3JYhXQ+tuq8X+Lyj0lR5RTLagwjqwBUptVitAJAyxZcIdz322dwVCGJ4BsdvJ Vjo/+zPWtzR4MbvXTAFL9+7DVVrlcJY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1664978875; 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=XioUhwCBBtQwLWJU+hANZWRRbVnnSiuRtPmjADjh+pc=; b=HYIWH8O+uvTINcwhF3VKPCGHEztfFKymkcgIBSuSsziKIoQp7RIbHvbSqpZIkZQwr/bmhU uSi/UaPshUWUd1DA== 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 B4A8613345; Wed, 5 Oct 2022 14:07:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Q8dSK7qPPWNtHAAAMHmgww (envelope-from ); Wed, 05 Oct 2022 14:07:54 +0000 Date: Wed, 05 Oct 2022 16:07:54 +0200 Message-ID: <87lepugy85.wl-tiwai@suse.de> From: Takashi Iwai To: Jon Hunter Cc: Amadeusz =?ISO-8859-2?Q?S=B3awi=F1ski?= , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Cezary Rojewski , Pierre-Louis Bossart , Jaroslav Kysela , "linux-tegra@vger.kernel.org" , Mohan Kumar D Subject: Re: [PATCH v2 2/4] ALSA: hda: Rework snd_hdac_stream_reset() to use macros In-Reply-To: <9677f39a-5297-bb1c-d4e3-62484ec1cf25@nvidia.com> References: <20220818141517.109280-1-amadeuszx.slawinski@linux.intel.com> <20220818141517.109280-3-amadeuszx.slawinski@linux.intel.com> <657d2418-0c3e-296f-8f4a-dc10ced2dffe@nvidia.com> <87a66av4gk.wl-tiwai@suse.de> <9677f39a-5297-bb1c-d4e3-62484ec1cf25@nvidia.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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 05 Oct 2022 15:52:01 +0200, Jon Hunter wrote: > > > On 05/10/2022 13:29, Takashi Iwai wrote: > > ... > > >> HDA playback is failing on -next for various Tegra boards. Bisect is > >> point to this commit and reverting it fixes the problem. I was a bit > >> puzzled why this change is causing a problem, but looking closer there > >> is a difference between the previous code that was calling > >> snd_hdac_stream_readb() and the new code that is calling > >> snd_hdac_stream_readb_poll(). The function snd_hdac_stream_readb() > >> calls snd_hdac_aligned_mmio() is see if the device has an aligned MMIO > >> which Tegra does and then would call snd_hdac_aligned_read(). However, > >> now the code always call readb() and this is breaking Tegra. > >> > >> So it is either necessary to update snd_hdac_stream_readb_poll() to > >> handle this or revert this change. > > > > Does the patch below work? > > > > > > thanks, > > > > Takashi > > > > -- 8< -- > > --- a/include/sound/hdaudio.h > > +++ b/include/sound/hdaudio.h > > @@ -592,8 +592,8 @@ int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus, > > #define snd_hdac_stream_readb(dev, reg) \ > > snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) > > #define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \ > > - readb_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \ > > - delay_us, timeout_us) > > + read_poll_timeout(snd_hdac_reg_readb, val, cond, delay_us, timeout_us,\ > > + false, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) > > #define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \ > > readl_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \ > > delay_us, timeout_us) > > > Amazingly it does not work. I would have thought that would, but it > does not. I am a bit puzzled by that? Interesting, it must be a subtle difference. What about passing true? It seems that the original code has the udelay(3) before the loop. Takashi -- 8< -- --- a/include/sound/hdaudio.h +++ b/include/sound/hdaudio.h @@ -592,8 +592,8 @@ int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus, #define snd_hdac_stream_readb(dev, reg) \ snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) #define snd_hdac_stream_readb_poll(dev, reg, val, cond, delay_us, timeout_us) \ - readb_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \ - delay_us, timeout_us) + read_poll_timeout(snd_hdac_reg_readb, val, cond, delay_us, timeout_us,\ + true, (dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg) #define snd_hdac_stream_readl_poll(dev, reg, val, cond, delay_us, timeout_us) \ readl_poll_timeout((dev)->sd_addr + AZX_REG_ ## reg, val, cond, \ delay_us, timeout_us)