Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1771331iof; Tue, 7 Jun 2022 11:07:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfkUHGEJuDUOA42SkVE3mFV9BPycvqk3EhnZlvqZ1QzLUk1N3eGt2rTdTN+mGgdssH63Ou X-Received: by 2002:a05:6a00:230d:b0:4f6:ec4f:35ff with SMTP id h13-20020a056a00230d00b004f6ec4f35ffmr30826667pfh.53.1654625251623; Tue, 07 Jun 2022 11:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654625251; cv=none; d=google.com; s=arc-20160816; b=HlnTBjJcue2cG8N7wYSbV8rp+o3SyTXn6PbPe6ehtNfeXg+CCe1Q3z7ei0OVWSCEU+ iqhEOX6gxBfeatWOr8HIU9SZ6WxItAseEpuzaPbjaOecZZeLXEB69YgXNzUrOSLizDLR HmYovxMRTTxsUg7bBVIQx62QP6UlXQhM2Cq1KoBlr3ej9kM+2VbwMA4wmtWkVZcdk/T+ rfLYvMBjmqEZFJUF8ZnDYdw8VUPR7Goz+8+uuZTp1fT5SPOx+A8ffPFOQsM6XwI6vIL5 aWEsWBiDl6/TgAF88Dvy0UmR61gDtu9rp92xoXTOBZohrTHf5wTTxbVN/QclPq+xaIoL yCvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=vfmRHdsKy5jL3Jkg558Ih+Gkg25m+JW1BWtz6hVF+I4=; b=ATpND0ZVjqkGJdIldtSPLvuHTbN2Yucdpxa0n88tfmpSaFc6Vck7qgq9Pnuo/fG8Di JyzJ+2RqhSdihlH9xDC86o2zTfJm2COXHopDsWNTvHhTqyPHJ/DLZRZhIC4z37n/mmA0 gSVoNT18DuUjWwvga3Q/fU/cFmhObKNOC0JZeZDWXgm1ujFKNaKjRQ6koqvV20LAoCni XuzrOTDWj6tJZ19+qHVpVXL3Y2Jn7sIE3hTEyf/XiA//pebFvEJsVhUzzj/pbvXN+oaB 2Ncw/gAJs4V9l8axxxA86rkdm/8/4ukZVpHq9iNW56vQkMO+UhEBCD8BLkt9kye14c7q jM4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cutebit.org header.s=mail header.b=Zp4+x16v; 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=cutebit.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a170902e88200b00163655cc8e9si26542409plg.203.2022.06.07.11.06.46; Tue, 07 Jun 2022 11:07:31 -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=@cutebit.org header.s=mail header.b=Zp4+x16v; 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=cutebit.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233890AbiFFUh7 (ORCPT + 99 others); Mon, 6 Jun 2022 16:37:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234168AbiFFUhW (ORCPT ); Mon, 6 Jun 2022 16:37:22 -0400 Received: from hutie.ust.cz (hutie.ust.cz [185.8.165.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A488CAEE29; Mon, 6 Jun 2022 13:35:24 -0700 (PDT) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cutebit.org; s=mail; t=1654547721; bh=vfmRHdsKy5jL3Jkg558Ih+Gkg25m+JW1BWtz6hVF+I4=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=Zp4+x16vSA/uhNUrENr7G3Ja9fHEb+dC8TemongFVg6cfy89mwvmpUWN+UecWyi+m 0fOjdk0f7kDw9VOeUFI1A9djS8U2MgbR+iKH5OR/1g/BMqZ7d5h3CA1PWEH1iMw67n bWCoGFvgB5UrtKJwpQPs1QJPPvL568oBkOd05khg= Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: [RFC PATCH v2 3/5] ASoC: apple: Add MCA platform driver for Apple SoCs From: =?utf-8?Q?Martin_Povi=C5=A1er?= In-Reply-To: Date: Mon, 6 Jun 2022 22:35:20 +0200 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 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20220606191910.16580-1-povik+lin@cutebit.org> <20220606191910.16580-4-povik+lin@cutebit.org> To: Mark Brown X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 > On 6. 6. 2022, at 22:17, Mark Brown wrote: >=20 > On Mon, Jun 06, 2022 at 09:19:08PM +0200, Martin Povi=C5=A1er wrote: >=20 >> +++ b/sound/soc/apple/mca.c >> @@ -0,0 +1,1122 @@ >> +/* >> + * Apple SoCs MCA driver >=20 > Please add SPDX headers to all your files. >=20 >> + mca_modify(cl, serdes_conf, >> + SERDES_CONF_SOME_RST, SERDES_CONF_SOME_RST); >> + (void) readl_relaxed(cl->base + serdes_conf); >=20 > 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. >=20 >> + /* >> + * 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; >> + } >=20 > 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. >=20 >> + 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); >=20 > Are you sure this doesn't need locking? I am not sure. I need to study what locking is already done by = ALSA/ASoC. I assume the two stream directions here don=E2=80=99t share a lock = already...