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 14143EB64D0 for ; Tue, 13 Jun 2023 16:16:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3D4E3E8C; Tue, 13 Jun 2023 18:15:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3D4E3E8C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1686673001; bh=MP324iDrYbfm0eWrmNDNfTJUUqQns+aJUtdK0/b/X+Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WymHwuzhdUVIEXftPE2ihf9H9+YW9iZBKZAQJ2c9Of/p+xwSDTHv8UMivmuUti8rh EAbcwY9o1a0NHVrppzdWGGBR2BQJinn++3sSl5SbiVMaib+J8rt1gYnofTfn+Oiuxn PqqIAYm1B/OwaZsKkJG2xnzr9mRhv8GRJdh8OM8E= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A1DEF8052E; Tue, 13 Jun 2023 18:15:19 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3D9DAF8025E; Tue, 13 Jun 2023 18:15:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3B91AF80149; Tue, 13 Jun 2023 18:15:16 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 80A47F80130 for ; Tue, 13 Jun 2023 18:15:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 80A47F80130 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=0G5jX+9U; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=aElo1Jkk 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 B33C222509; Tue, 13 Jun 2023 16:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686672912; 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=fVqYdpZ9HtvtVy/54sJHHRor7pEOHvMaLqDV/HaUw1A=; b=0G5jX+9UYczBF+s6QA38vytr4oilg44y+74CkIkuzUm1nQM8k8MKzGCxBlJNwC/JL129mX 9YbdCOql6vXbEMATY3MvLA9ZKzjHueeaIknwzGuyOc9Jo3v6KrYC602Ive1hFO2nE9Ywvi fZMm/Avt8bAkV3hihqihi/y55vhS0OY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686672912; 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=fVqYdpZ9HtvtVy/54sJHHRor7pEOHvMaLqDV/HaUw1A=; b=aElo1Jkk7a3gk/PrHe8ck2pi5hl6MJjw+G1A6kr1VcZ9nHk7AHYwNgFMU4kdLHal5ChdZh agcjayAmo2xQr+DA== 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 8D66F13345; Tue, 13 Jun 2023 16:15:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id o4JrIRCWiGSzOAAAMHmgww (envelope-from ); Tue, 13 Jun 2023 16:15:12 +0000 Date: Tue, 13 Jun 2023 18:15:12 +0200 Message-ID: <87a5x3cp9r.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: <60f70667-16b0-4071-aa0f-a83e43bbf2a0@sirena.org.uk> References: <20230609-alsa-hda-maple-v1-1-a2b725c8b8f5@kernel.org> <87v8fua1qm.wl-tiwai@suse.de> <877cs7g6f1.wl-tiwai@suse.de> <87v8frcueb.wl-tiwai@suse.de> <60f70667-16b0-4071-aa0f-a83e43bbf2a0@sirena.org.uk> 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 Message-ID-Hash: 6ZHFB5D2ZZBZ75N63WCP3Q5R2D5XFQIJ X-Message-ID-Hash: 6ZHFB5D2ZZBZ75N63WCP3Q5R2D5XFQIJ X-MailFrom: tiwai@suse.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 13 Jun 2023 17:49:41 +0200, Mark Brown wrote: > > On Tue, Jun 13, 2023 at 04:24:28PM +0200, Takashi Iwai wrote: > > Mark Brown wrote: > > > > 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. > > Ah, if it's just suppressing the write the code should just be removed. > regmap_update_bits() already suppresses noop writes so unless we might > write a different value to the register later the effect will be the > same. I can send a patch. Oh, I'm afraid that we're seeing different things. The code there is rather to *set* some initial value for each amp register (but only once), and it's not about optimization for writing a same value again. That is, the function helps to set an initial (mute) value on each amp when the driver parses the topology and finds an amp. But if the driver already has parsed this amp beforehand by other paths, it skips the initialization, as the other path may have already unmuted the amp. Or I might have misunderstood what you mean about _update_bits()... thanks, Takashi