Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1574060rwi; Thu, 20 Oct 2022 14:23:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6HW2BIlQ9E4Ebx9YpDISogHOutMNDW40vbuA54uf6uiuuanyxEXTq2fWTKMp5zUjjgLuLa X-Received: by 2002:a17:90b:350d:b0:20d:5438:f59a with SMTP id ls13-20020a17090b350d00b0020d5438f59amr17667002pjb.41.1666301017577; Thu, 20 Oct 2022 14:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666301017; cv=none; d=google.com; s=arc-20160816; b=MjmRCrd5lD+YU+UFqWauQLNdqAsQAFlKysNAKgNOEPmfc+UYUpTaYuuidIKnQR212v WIG867KTFPMcutMEaL4F88xyDY/LPntQJ0N3A9/a9pqkqk1Hd8fg+jtXfkS8giKWRZkp kmBOutAT20xizdNaf0+Hmu6Z0j1vO2ftsEZMZgmKIPy8b2QvVBSD/P+h0sBG3YMLK6uO iTmuF/miXgf5fmeBjEqlgSQP/oPNt5jOKNTaFsV9U9ooS2Eyq+LwbT/zOdq8eWRe6l+i Z0H5K3raM+EHObjyct8/IIsG9f4YJi7QUrcBoyQ50RIqSiSNxoyJ7CfrYHcRw2rjuuLj ha5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=JEXVa4iDyBou+KfiZpoT6xnh2pLn5IeNQXtOmvNWpBU=; b=VMQ5GWud3zMcgv/YPS+UprjcOMrzX8Sc94Z5NYvomXG5P94eYsNNcLtn5N/kyx2cqb lYh6WqJ/7F4B3nM4yosTxgJUUakTjDM7mfnPz0MFmkKZz0Rq6QqVAkOPFSElmtkHvJYf MxfOKkv+5Throh86/oN2FE5Ylf04yC9RH975sm8qgXz2DI4t4XRIQL7jqvmIQMYb0+J6 +rf+C257mF4/LWXZen8cp/tPUwKtBeiNzbIBBfyt3CR5OWL3xOZnnQsIHgRDilM3OBj0 nLE28Spz3DqkKQCQFKaHSQ8alNEr4Dwb6kXYPhWaZWvCymNmO6x7filHQx63b3F9BXmV KnQA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a170902748a00b001865c55049dsi5146938pll.570.2022.10.20.14.23.25; Thu, 20 Oct 2022 14:23:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbiJTUrm (ORCPT + 99 others); Thu, 20 Oct 2022 16:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbiJTUrd (ORCPT ); Thu, 20 Oct 2022 16:47:33 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB6A21F953 for ; Thu, 20 Oct 2022 13:47:21 -0700 (PDT) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1olcQy-0007Uc-He; Thu, 20 Oct 2022 22:46:32 +0200 From: "Maciej S. Szmigiero" To: Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/6] Fix direct renaming of hashed controls Date: Thu, 20 Oct 2022 22:46:20 +0200 Message-Id: X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 From: "Maciej S. Szmigiero" I've noticed that some of mixer controls on my sound card seem to be partially broken on the 6.0 kernel - alsactl wasn't able to find them when restoring the mixer state. The issue was traced down to the recent addition of hashed controls lookup in commit c27e1efb61c5 ("ALSA: control: Use xarray for faster lookups"). Since that commit it is *not* enough to just directly update the control name field (like some of ALSA drivers were doing). Now the hash entries for the modified control have to be updated too. This patch set adds a snd_ctl_rename() function that takes care of doing this operation properly for callers that already have the relevant struct snd_kcontrol at hand and hold the control write lock (or simply haven't registered the card yet). These prerequisites hold true for all the call sites modified. The core controls change and the emu10k1 patch were runtime tested. Similar patches for other devices were only compile tested. include/sound/control.h | 1 + sound/core/control.c | 23 +++++++++++++++++++++++ sound/pci/ac97/ac97_codec.c | 32 ++++++++++++++++++++++++-------- sound/pci/ca0106/ca0106_mixer.c | 2 +- sound/pci/emu10k1/emumixer.c | 2 +- sound/pci/hda/patch_realtek.c | 2 +- sound/usb/mixer.c | 2 +- 7 files changed, 52 insertions(+), 12 deletions(-)