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 B6EC1EB64D0 for ; Tue, 13 Jun 2023 14:24:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242738AbjFMOYe (ORCPT ); Tue, 13 Jun 2023 10:24:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240128AbjFMOYb (ORCPT ); Tue, 13 Jun 2023 10:24:31 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0C5DBA for ; Tue, 13 Jun 2023 07:24:30 -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 71E631FDBB; Tue, 13 Jun 2023 14:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686666269; 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=9RQl95P12+POXLnCCgfU/OKJ6ihJlPynRRID4GB5eus=; b=Gg4sD3qdSQQt5eMvPIb5pTedPLaB3WF8xPmWOV8f5s9LjKQzjca3nlVNcew2ZjJ/CnO/3W wo1W6iTLvFydLZz04gz147pNya+gUiXvwfBKxom1gkF9ymZg68ZHZ9rjBXJ1BwrHsQxGIK MSKX7AoF002sBkhBXUF/YQ1aF651Bzs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686666269; 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=9RQl95P12+POXLnCCgfU/OKJ6ihJlPynRRID4GB5eus=; b=8qssJCDxeIhFf88O9y/2OhTPBis/R67nadGbPcGRzCzoeTnMvsa1lcO+HNjh3SmYafiBUl DWxX+X5GzfALQ4Bg== 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 520F213345; Tue, 13 Jun 2023 14:24:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id znrdEh18iGQMewAAMHmgww (envelope-from ); Tue, 13 Jun 2023 14:24:29 +0000 Date: Tue, 13 Jun 2023 16:24:28 +0200 Message-ID: <87v8frcueb.wl-tiwai@suse.de> From: Takashi Iwai To: Mark Brown Cc: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: hda: Use maple tree register cache In-Reply-To: References: <20230609-alsa-hda-maple-v1-1-a2b725c8b8f5@kernel.org> <87v8fua1qm.wl-tiwai@suse.de> <877cs7g6f1.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-kernel@vger.kernel.org On Tue, 13 Jun 2023 15:59:14 +0200, Mark Brown wrote: > > On Tue, Jun 13, 2023 at 09:36:34AM +0200, Takashi Iwai wrote: > > > This is an error from regache_sync_val(), and it indicates that the > > synced register is write-only; regcache_maple_sync() tries to sync all > > cached values no matter whether it's writable or not, then hitting > > this. > > BTW I was just looking at reg_raw_update_once() and I can't figure out > why it's trying to do what it's doing - it does a read to check if it's > seen the register before and then does an _update_bits() if the register > hasn't been cached yet, apparently trying suppress duplicate writes but > possibly deliberately discarding changes to multiple bitfields in the > same register. That's not what the non-regmap path does, it'll only > discard noop changes to the same bitfield. Yes, it's a quite hackish way of optimization of the initialization. Since HD-audio codec has no known default values unlike normal codecs, it needs to initialize itself only at the first access, and this helper does it. Takashi