From patchwork Fri Apr 28 09:59:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oswald Buddenhagen X-Patchwork-Id: 13226214 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 E231EC77B61 for ; Fri, 28 Apr 2023 10:05:00 +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 9F58212A8; Fri, 28 Apr 2023 12:04:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F58212A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1682676298; bh=Cae39/E7r/oW9G5MrRJaNnjFL9qRivm/dOCRESOz2Ts=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZgZv0ypXAaw0uaa9ZpiFXgdH91VcVKD5e9MoKrK5n7+beu1my/4g2cxEz83DAG25/ rBNR4s0gGCua8WZF9hqQ4FJuQtCKdjqCGUMohDOV73ZGK8Yn5cT2ruT+3HXeQnEoem CTwmkhxGnHn2w82wliyZ9wcu6Oio2WJdX6YkERog= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 7EC0EF8052E; Fri, 28 Apr 2023 12:03:19 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 53874F8025E; Fri, 28 Apr 2023 12:03:16 +0200 (CEST) Received: from bluemchen.kde.org (bluemchen.kde.org [209.51.188.41]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6A277F800AC for ; Fri, 28 Apr 2023 11:59:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6A277F800AC Received: from ugly.fritz.box (localhost [127.0.0.1]) by bluemchen.kde.org (Postfix) with ESMTP id DD11724269; Fri, 28 Apr 2023 05:59:41 -0400 (EDT) Received: by ugly.fritz.box (masqmail 0.3.4, from userid 1000) id 1psKtB-9tL-00; Fri, 28 Apr 2023 11:59:41 +0200 From: Oswald Buddenhagen To: alsa-devel@alsa-project.org Subject: [PATCH 5/6] ALSA: core: update comment on snd_card.controls_rwsem Date: Fri, 28 Apr 2023 11:59:40 +0200 Message-Id: <20230428095941.1706278-6-oswald.buddenhagen@gmx.de> X-Mailer: git-send-email 2.40.0.152.g15d061e6df In-Reply-To: <20230428095941.1706278-1-oswald.buddenhagen@gmx.de> References: <20230428095941.1706278-1-oswald.buddenhagen@gmx.de> MIME-Version: 1.0 Message-ID-Hash: SEMNKIWEY7SMZWBV262MNZKHD766CGSB X-Message-ID-Hash: SEMNKIWEY7SMZWBV262MNZKHD766CGSB X-MailFrom: ossi@kde.org 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 CC: Takashi Iwai 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: Since commit 5bbb1ab5bd ("control: use counting semaphore as write lock for ELEM_WRITE operation"), this has been locking the controls including their values, not just the list of controls. Signed-off-by: Oswald Buddenhagen --- include/sound/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sound/core.h b/include/sound/core.h index 3edc4ab08774..4ea5f66b59d7 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -98,7 +98,7 @@ struct snd_card { struct device ctl_dev; /* control device */ unsigned int last_numid; /* last used numeric ID */ - struct rw_semaphore controls_rwsem; /* controls list lock */ + struct rw_semaphore controls_rwsem; /* controls lock (list and values) */ rwlock_t ctl_files_rwlock; /* ctl_files list lock */ int controls_count; /* count of all controls */ size_t user_ctl_alloc_size; // current memory allocation by user controls.