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 594E6C433EF for ; Mon, 7 Mar 2022 16:47:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0A42616E6; Mon, 7 Mar 2022 17:46:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A42616E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1646671630; bh=q3EnzzjtcI/zgBv22dKlA2cGLxB7RYLsmRde44U5Q6I=; h=Subject:From:To:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kYPP1edqBBuXIRSxGQdpyrLOlfginOZ8X0TL4n6IHiyh+7JZ3xq0G6rL3cLInZ2wr EHsqsTV26gKGm+/ix0B5yCqKJ7i++Q+OWTfzp5TQV2jh/+PgsK9aarUPvC7OJ92MHj ZuAs2yCY5ubrjU7LG8ZvldepfLxhAC87+ouggwUU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8CA59F80124; Mon, 7 Mar 2022 17:46:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2DC8F8013F; Mon, 7 Mar 2022 17:46:17 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 66B49F80124 for ; Mon, 7 Mar 2022 17:46:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 66B49F80124 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RYerq3R1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646671575; x=1678207575; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=q3EnzzjtcI/zgBv22dKlA2cGLxB7RYLsmRde44U5Q6I=; b=RYerq3R1cRkGKt/uPxbwtHdr8ZtlNPN2aGNOuEyf+DUo1F5cyvkM+c/l XNvbyJ7EfgGyKIYpMDj+AcVTrY4ua+l8cV8WLc7dXCEEYvs4qvVAqqCVF PKWvCuHFLjaCYDEMmV1L2RLlUI30M+hRBx8zpoSF6bwgY1csDUMBWZWvS 5O1fJepFT8XT1TKe2aU0sqT0ot4lCdepiXooh0ToQQWX8mCX3EIQS23+Y 4+NAHFcFl4GygMkoHQ3Tqza8btCa29B9kxxUufT34Q/9oBJLag4Z9sukm 4EAXFE3K1aaRQH1Qwz5UMZUZUJaGzxe3cPov5d22Dm7+n/oFPUVc8T5Tv Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10279"; a="254379527" X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="254379527" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 08:46:10 -0800 X-IronPort-AV: E=Sophos;i="5.90,162,1643702400"; d="scan'208";a="546948992" Received: from zhaojohn-mobl1.amr.corp.intel.com ([10.254.24.100]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 08:46:10 -0800 Message-ID: Subject: Re: [PATCH v3 11/17] ASoC: Intel: avs: Firmware resources management utilities From: Ranjani Sridharan To: Cezary Rojewski , alsa-devel@alsa-project.org Date: Mon, 07 Mar 2022 08:46:10 -0800 In-Reply-To: References: <20220304145755.2844173-1-cezary.rojewski@intel.com> <20220304145755.2844173-12-cezary.rojewski@intel.com> <66e20563567955124488eb9f9b53ea6a2bc5d744.camel@linux.intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Cc: upstream@semihalf.com, harshapriya.n@intel.com, rad@semihalf.com, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, broonie@kernel.org, amadeuszx.slawinski@linux.intel.com, cujomalainey@chromium.org, lma@semihalf.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" > > > + * @modres_mutex: For synchronizing any @mods_info updates > > Is this mutex really necessary? Can you please elaborate under what > > circumstances your will have parallel module updates? > > > > > Yes, we believe modres_mutex is necessary. All information regarding > > modules exposed by the firmware are stored within ->mods_info cache. > > > > That's just a snapshot though. When a new library gets loaded, new > > modules may be available for use and so the driver updates the > > ->mods_info cache to have the latest snapshot. As information found > > there is used when streaming (e.g.: instantiating modules), we enter > a > > scenario when multiple threads could be reading/updating the > ->mods_info > > at once. To prevent any unwanted behavior, mutex has been added. This is the part that's hard to follow without seeing the actual code where this new library is loaded. When does a libray get loaded? When you start streaming and you realize that the stream requires a module that is not built into the base FW? Can this be done during topology loading instead? Thanks, Rnajani