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 7D482C88CB4 for ; Tue, 13 Jun 2023 10:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239876AbjFMKgV (ORCPT ); Tue, 13 Jun 2023 06:36:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241361AbjFMKf4 (ORCPT ); Tue, 13 Jun 2023 06:35:56 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1D8B1FC0 for ; Tue, 13 Jun 2023 03:34:47 -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 A041A21D89; Tue, 13 Jun 2023 10:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686652486; 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=dHrbmDHvc4UBu9kXQN3fmSwBa66DMZjFi9nl9nR7ma4=; b=zbxNXZvX8v30GyevzwWuzFOv5+aEq3DjZJV1hSv7WUyt4bVzM4LdjJrL7Hs0UALsAoGlRI doUspsKI3EdQzMaKCg05lNf+pVkUH53aThyD0lNsUjN3IHyDhh6JfFwxCmvu7knI08uINM dcnjZQlOp/K+gAwSEiWoRtrW6fgSPhI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686652486; 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=dHrbmDHvc4UBu9kXQN3fmSwBa66DMZjFi9nl9nR7ma4=; b=dT4FDD/lghsEN42AfTleEGoC3BeN3NI1xB1Uz/XDVLrSSnfclXp/VN2fY4W2QQG+nS9yo9 mD9CqK3FomIzE1CA== 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 8072513483; Tue, 13 Jun 2023 10:34:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6wZSHkZGiGRmdgAAMHmgww (envelope-from ); Tue, 13 Jun 2023 10:34:46 +0000 Date: Tue, 13 Jun 2023 12:34:45 +0200 Message-ID: <87ilbrejlm.wl-tiwai@suse.de> From: Takashi Iwai To: Mark Brown Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH] regmap: maple: Don't sync read-only registers In-Reply-To: References: <20230613074511.4476-1-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 12:16:37 +0200, Mark Brown wrote: > > On Tue, Jun 13, 2023 at 09:45:11AM +0200, Takashi Iwai wrote: > > regcache_maple_sync() tries to sync all cached values no matter > > whether it's writable or not. OTOH, regache_sync_val() does care the > > wrtability and returns -EIO for a read-only register. This results in > > an error message like: > > snd_hda_codec_realtek hdaudioC0D0: Unable to sync register 0x2f0009. -5 > > and the sync loop is aborted incompletely. > > > > This patch adds the writable register check in the loop for addressing > > the bug. > > This should be in _needs_sync(). I thought it's a different logic? regacahe_reg_needs_sync() checks only whether it's a default value, and other call paths already check regmap_writeable(). But I can put the check there instead if you still prefer, too. thanks, Takashi