Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp925500iof; Mon, 6 Jun 2022 15:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1VekmhHHAyafa7mlcOjDTOg5Z70p/Wr01EVW9e34QrHMasCcl7vU2ksv8DHke3lFfMKy2 X-Received: by 2002:a17:907:3f0d:b0:6ff:43e:bb1a with SMTP id hq13-20020a1709073f0d00b006ff043ebb1amr23105881ejc.52.1654555706599; Mon, 06 Jun 2022 15:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654555706; cv=none; d=google.com; s=arc-20160816; b=QWqNFMByx3+DOfp08N0+4PbkUh+/b9PhS3z7O/tJC3w59yciU5C8QHLxZIezYDEZGG tyAMzW3MlUqXnE4s6vKhqan2Zz7Y22pFo+94hlnyY8+T+s5S3sLX1gZPg0WG1FblA1FB P62Ww0xTWQsFm/bvtlCO+ejuO4yj1/oc9UGzUx6z2SqUX6OExpVIAOgTmV+sZPvtH/ph 9bfaKPaUAL9s0rZaxPwnE8OIG9sUUzeMsaZfBin73O1PzFV0Kjeo9AxCwwqVQbYJb2RG YctKLSArW7wEIjvmq1kM/sjLqQd9e0DKdDZurxDLKa3QeDzUeN3kzI/CPdzlINakIs9C M+6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ExHiX9ZsjposmwIX33ZeE+Y3eOFk3whW8x83DX8QTEk=; b=C6lT3/AEjiUr02BhClJMVbE7e87nd480h4+S62YvI3J9M57zB3fe+v2fGKgnTehqjV mlI9osI73v3vIoM1hWTQ7x+sVvfSw+q66/Y5g0JE0+wEWESAWuxhrayahNnofYNOStQK voVHKDDnftEwkgWdvK1UGlXPmy0SRewTpVHPe+mJDRlqby7hyfmp49pxaAYzaXLfq1mW Qlex9or5/AsSaH8Q1YRaUoqOKvQvzxCdvgJIBrijVIu/OksxvZfyqX2WdIBGWgkdHTE/ UaqCSiwEddBep+TKDw6dTHA6dCg8IuploVTj7i0FBc61BBsea/xWOMmhNUCw2CRn7iRH lvLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aoKo2oMj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bx1-20020a0564020b4100b00423d5e26a5asi9073707edb.576.2022.06.06.15.47.48; Mon, 06 Jun 2022 15:48:26 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aoKo2oMj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233371AbiFFUSC (ORCPT + 99 others); Mon, 6 Jun 2022 16:18:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233554AbiFFURw (ORCPT ); Mon, 6 Jun 2022 16:17:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF00862A24; Mon, 6 Jun 2022 13:17:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8C422614F9; Mon, 6 Jun 2022 20:17:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CCE5C385A9; Mon, 6 Jun 2022 20:17:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654546665; bh=/B/PloBld3O4RZgCV+lWXc3i8yVuTLMMkjx9VYvCuws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aoKo2oMj/3Zm29onm9GITm4MOVqXfu7+oV0bWECk3Z8pxRMmbBzPeRLkQJ7bc/eMZ k0fbcvuo7hEgg+OIva5vuVm112PdpnSHmWtKZkcm3z2ryt0g2UST/yudrgzTG47qCS 8pdQTb7WDLJ+c43lGsbgXGidsXNQtW3z14NJEje+1u8lCONjFVNgIrvIeYPeYnyzrz 7BOaEGuqn0FtB5WNp1bye/dOhP9Mnp1ApvtcC3nV0lQ9fH6qhMJ8XO653U1hTrqkpU wOa3b2pit7AO9MKP19/cFJFVkN23xKJEEzeNGvfAJaILVx/n4KV/Lp7HJKu72MG2rg fp1Rzb6VMDC0Q== Date: Mon, 6 Jun 2022 21:17:39 +0100 From: Mark Brown To: Martin =?utf-8?Q?Povi=C5=A1er?= Cc: Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Kettenis , Hector Martin , Sven Peter , asahi@lists.linux.dev Subject: Re: [RFC PATCH v2 3/5] ASoC: apple: Add MCA platform driver for Apple SoCs Message-ID: References: <20220606191910.16580-1-povik+lin@cutebit.org> <20220606191910.16580-4-povik+lin@cutebit.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="elKz+L5SmKmXJeQI" Content-Disposition: inline In-Reply-To: <20220606191910.16580-4-povik+lin@cutebit.org> X-Cookie: Have an adequate day. X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --elKz+L5SmKmXJeQI Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 06, 2022 at 09:19:08PM +0200, Martin Povi=C5=A1er wrote: > +++ b/sound/soc/apple/mca.c > @@ -0,0 +1,1122 @@ > +/* > + * Apple SoCs MCA driver Please add SPDX headers to all your files. > + mca_modify(cl, serdes_conf, > + SERDES_CONF_SOME_RST, SERDES_CONF_SOME_RST); > + (void) readl_relaxed(cl->base + serdes_conf); Please drop the cast, casts to/from void are generally a warning sign as they're unneeded in C. If you want to document the barrier use a comment or wrapper function. > + /* > + * Codecs require clocks at time of umute with the 'mute_stream' op. > + * We need to enable them here at the latest (frontend prepare would > + * be too late). > + */ > + if (!mca_fe_clocks_in_use(fe_cl)) { > + ret =3D mca_fe_enable_clocks(fe_cl); > + if (ret < 0) > + return ret; > + } This requirement is CODEC specific. It's fine to bodge around to satisfy it though, especially given the restricted set of platforms this can be used with. > + fe_cl =3D &mca->clusters[cl->port_driver]; > + if (!mca_fe_clocks_in_use(fe_cl)) > + return 0; /* Nothing to do */ > + > + cl->clocks_in_use[substream->stream] =3D false; > + > + if (!mca_fe_clocks_in_use(fe_cl)) > + mca_fe_disable_clocks(fe_cl); Are you sure this doesn't need locking? --elKz+L5SmKmXJeQI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmKeYOIACgkQJNaLcl1U h9BVlQf9Hhza64pdhAryt0leuNmoItrjQI4ru3oVzIPzjS1FTHojgISfLilo8RjN xsVACb5GG0HKM5P/KUmFuH3+niL6W1zxmfO67gzGz0gr5zGpQLvy7XaNc52rVqM5 u5A9NH0Mqv4/OBbjCi8UzbhG8wZfkAIr2B6FENy3KsSbzdUq2crOrOhiS+TwEK8P gQ0yfnnAAm7oueBiZ0ByCfMHOeBtG6dR3o5Yz+UhnZDmg783E0xvz4okjXcbuo2m eHMDeulABPHv86DHGZ3KlvUHIK3n8398P1iZxs/0NuJqvNkT4JFcL06Y1TFYeywz /0ogXX5hoScevm8+OW4gzuc99bGDBA== =ItfL -----END PGP SIGNATURE----- --elKz+L5SmKmXJeQI--