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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C83AC4332B for ; Fri, 20 Mar 2020 16:40:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9B5A720709 for ; Fri, 20 Mar 2020 16:40:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="n5Ao/c5B" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B5A720709 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 05AE574C; Fri, 20 Mar 2020 17:40:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 05AE574C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1584722450; bh=0BNF32Ot9S3paqwF1C3COqOTGVZ/vjexQUsZ36K3iI0=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=n5Ao/c5BD9SsfBxO/LNHIY8x9iY1OpRbveH240wMEWAXdnj4VjfD/GIqgwCUg5Z/l cyGwC3egLcNk6MiV/KMnVUcfiU6h2XWNj48YWpMrX5TlbWrGgjGmMaoFUuyYAAnAg0 DktR+UMpdSPGwWTiPZ6dnWjRWJlTSB58pW4UgymM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 81924F80139; Fri, 20 Mar 2020 17:39:59 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2B365F8015B; Fri, 20 Mar 2020 17:39:58 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by alsa1.perex.cz (Postfix) with ESMTP id 8B60AF800C0; Fri, 20 Mar 2020 17:39:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8B60AF800C0 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 443831FB; Fri, 20 Mar 2020 09:39:50 -0700 (PDT) Received: from localhost (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ED9833F305; Fri, 20 Mar 2020 09:39:49 -0700 (PDT) Date: Fri, 20 Mar 2020 16:39:48 +0000 From: Mark Brown To: Guennadi Liakhovetski Subject: Re: [PATCH 06/14] ASoC: SOF: add a power status IPC Message-ID: <20200320163948.GD3961@sirena.org.uk> References: <20200312144429.17959-1-guennadi.liakhovetski@linux.intel.com> <20200312144429.17959-7-guennadi.liakhovetski@linux.intel.com> <20200313143956.GJ5528@sirena.org.uk> <20200320115203.GA2130@ubuntu> <20200320121952.GC3961@sirena.org.uk> <20200320132732.GC2130@ubuntu> <20200320150727.GD2130@ubuntu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VV4b6MQE+OnNyhkM" Content-Disposition: inline In-Reply-To: <20200320150727.GD2130@ubuntu> X-Cookie: Laugh when you can User-Agent: Mutt/1.10.1 (2018-07-13) Cc: Liam Girdwood , Takashi Iwai , alsa-devel@alsa-project.org, sound-open-firmware@alsa-project.org 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" --VV4b6MQE+OnNyhkM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 20, 2020 at 04:07:27PM +0100, Guennadi Liakhovetski wrote: > On Fri, Mar 20, 2020 at 02:27:32PM +0100, Guennadi Liakhovetski wrote: > > No, this isn't a completion - it's a counter. I've used atomic variable= s=20 > > before, I cannot remember seeing any difficulties with their correct us= e=20 > > described. Do you have a pointer? > Actually I'd even say this isn't a problem. I think it's safe to say, you= =20 > won't suspend and resume your audio interface more often than every 10=20 > seconds. That makes under 3200000 cycles per year. Even with 31 bits for = a=20 > signed integer that makes more than 600 years. I think we're safe. The problem is that atomics are just incredibly error prone - for example they're just a plain number, they're usually counting something which is not being locked so you have to be careful any time you do anything around them. Their lack of structure makes them harder to reason about than most other locking primitives, often harder than it's worth. --VV4b6MQE+OnNyhkM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl508dMACgkQJNaLcl1U h9AwrAf/eWl+Yb8qB8Fr4u5YFzbxMd1qzAcjCqwrHb7QunWcMmllBJOAYCyPin/C 3n84GcOZezV6APmoZXx6W8KrrMlYBo5BMHXp8vXCzZ36B3UQgdqjLMsFr4pQxp8H BKYXtow+NC9B2/h3HpegWkQ0wSAF2ohd3VI5k7OhPwz2MhWeNO30bxQx7dkxFPtE 3c3EFq77PB662iGDR4YnKuc1MUDblfMtPg/Je866pg0ZCNgQ7Bq9TVxQzWrF+R4b tOsZdeYwGO4Zo7Vj/+9GoVw5kYo30961PXjb9Kywa3rHLuGXXNYC0E4yEyOEKQbw dow3mx9kcb6v0fCeINu7R6hxXru/Jw== =6VtB -----END PGP SIGNATURE----- --VV4b6MQE+OnNyhkM--