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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0EB22CA6002 for ; Wed, 7 Oct 2026 18:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JykGVcXyDXA+2TTRuO2/QCItxRpkTMleFSqXf8Cjqh4=; b=NQNeYEdFHYc28DZvqLqnQSf5HK enU+oOs1oVINdB9mf+li+8IPkFP3ab/x42Td/h/WWSwzhH/SKh4hWT77DY6gya+J0YYNVUbiuAN1A TwoyiNF0rWF5pD/7TNDgW5d8JeAmmEoSHfbbJ5JQ6DdpsSenfJCa+0LPTbTUutCynoOYX4rloCWvl 77dbfiA2cgg3eqOG/hzWC29vg12bjvyWntjZX+zgjTBjObYXc8vWJXDtopJsz23euMO5e28b2nW0l uKqUjT++9a9bTcEqrB1RgVAHCartteow9ZFXFCWq5Sh3mkgGoYuaFCc4WzvO2lx3Hns//UvPbAfQr 9tgFWyoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xEW0e-00000002vmF-2R57; Wed, 07 Oct 2026 18:04:56 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xEW0b-00000002vlB-1HOY for linux-mediatek@lists.infradead.org; Wed, 07 Oct 2026 18:04:55 +0000 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 697HKmRA756742 for ; Wed, 7 Oct 2026 18:04:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JykGVcXyDXA+2TTRuO2/QCItxRpkTMleFSqXf8Cjqh4=; b=SzgIWJSPJjjem8nE cushvfrvkg22fkrce0c9vfE72gWIUGPdOIWJTPKKxKMcIBBucr2MxZxm1667OsHF YBbItPv71AJx0au1yTR3JPAyG4j2mb9aZ81plf0pCTVykpWFrE3dSqZ5MZl24vul JdPijzTq4P6H5i9a/RF9uo1nTnv2oB7/5CxbhZX5RdgHICjlY9MskRjks/Z/NPcI b4sIlrdd2kxVvPlJuw/FxTeOQ+bly1FuHRhTgaMT849TsCV5m0Ujd9erIi6Sb58B mfxvDzpFx5lHNnJb50slIBd6pV+23qGsBCHoKT9vMMqJ3Tp5YgCVh31nnEQz4hxE eTYXTA== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h5td406yg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 07 Oct 2026 18:04:52 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3a6d95d6e08so3455894a91.1 for ; Wed, 07 Oct 2026 11:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791396291; x=1792001091; darn=lists.infradead.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JykGVcXyDXA+2TTRuO2/QCItxRpkTMleFSqXf8Cjqh4=; b=OQwPE1Y0fjRawLivPWbuTuwrWrkQ0bcbQknkaI1ftpIZoZsuKxpb2LIcVVZqBGX3Ay jJNSNQXoNOKgfrjtgBTI7KXQyQw81rZRORfH1BBxqTTy0r9galeM3czD7pwu+sDOKuXR 3ECzSo4W5lGVeiiSIueBpk7cZ9BeE38V7ctsJRMSBfQyAsfQkRYWgdPkwPNWhiHPkgig zPXi5JxIEq5Hfrh3NL+JpRO69YIyIN99rPvd+yPwC4J3bNvtHwxSrdqEhQNPph4sZKjn 5rv+GpM67ofhzPCCVKwQkvIVv5j/LWRK9auOE0KjGtbVb6oAq/COoc/YofUrYdKp20/E ysZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791396291; x=1792001091; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JykGVcXyDXA+2TTRuO2/QCItxRpkTMleFSqXf8Cjqh4=; b=nTkfRPerAnqcwBfJaDOd2/3ZqtSZwLTruZvTitz0gJz+t3hu8rfvccf2xwcILIDY6o 4Z+HIVt4DRra+UWz3Q0M+YVV387VBH8OFuBrfsqg9CFuUK76Azrfut8q1crjSkjKXvCL Hix3UmqI+Jgw7khzAI1Y/WYxmoIBm3x2e/xcYdCXF1IrbF/wEXlI1ADB5eMFF4xFFz3y BcMoibAmV6NC29UgZpRoXjHNwI+7pcbDSVg3t+8QBfIMm0lTxizH72G5Tn17IEyCRU/f +x5B7fTYZN32x0UBLYrOxpP+k+IL9nkeNwvire2dXyoKXzm44PFj1uQIgbdtl5BoRuaL /FMQ== X-Forwarded-Encrypted: i=1; AKwUvBz1/fc2Vg6uau+7/WQcrIQPwF4rSTEwBtgbUDueDIJHywpY5LX0Y8QXclpFryimbC4Efcls4whpBrMv2+ZzTQ==@lists.infradead.org X-Gm-Message-State: AFq9FYLvvbeOrKsw6sgFCHNJYlvh+VIT6G5ArnqgqxFNByt1RPohETlh DZjDFJLFsOWip2/Wgvbb6xidbvLeDRZ08nlrL1qltGqmSnM3WZRgCEhayJ0yKSJeUma0X4YBnFf 2566bqWxq12nCnrX6iVwZPtDia22R15NAADeuB0IHBhewzXoPS6GbIwSKVdyYXiP3KeHPTvxlEa c= X-Gm-Gg: AYBFou1fPzSC/hkaAqovah3McKK56plWFYF/yvpT4BLemqj3pc1TioWwR47+BE7FAvi UHuP3aFaziw4jEhqp/9NqbKd/HzobgzT0QCKhA88sFCLsv1fRT2ypMvyCDIa2AG6DEwmyLkH9OG MPa2LOno73kprv+wjGGW9lJa6inKpW6iqP7E4QHUcQfQ+ZDmJYVUN5jGzyonbsG2DJQOP+3Dn3u /5s5tnoR5eEyzSehKz/AAzpxvC4I16iAXSoNZ4Atf64FYpNvB0roA/AiUMiF46W0GRMFHg9jRdK XwJBz3kZD6e3Bp/ixqUK1Og3K3Z1ITvQjZM3NWHiigxeO+RSqYskywjuZJ2Meod3lISxy9NI44c qBSh6Zu80EeXUWolhj8R63OxSXBE2 X-Received: by 2002:a17:90b:57ce:b0:3a4:fa1a:2b1d with SMTP id 98e67ed59e1d1-3a8a1c3ac39mr2378624a91.62.1791396291028; Wed, 07 Oct 2026 11:04:51 -0700 (PDT) X-Received: by 2002:a17:90b:57ce:b0:3a4:fa1a:2b1d with SMTP id 98e67ed59e1d1-3a8a1c3ac39mr2378577a91.62.1791396290508; Wed, 07 Oct 2026 11:04:50 -0700 (PDT) Received: from [192.168.1.12] ([223.230.93.214]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3a9f1a2508csm605492a91.3.2026.10.07.11.04.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Oct 2026 11:04:49 -0700 (PDT) Message-ID: Date: Wed, 7 Oct 2026 23:34:37 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 09/21] ASoC: apple: Add macaudio machine driver To: James Calligeros , David Rhodes , Richard Fitzgerald , =?UTF-8?Q?Martin_Povi=C5=A1er?= , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , AngeloGioacchino Del Regno , Shenghao Ding , Kevin Lu , Baojun Xu , Sen Wang , Sven Peter , Janne Grunau , Neal Gompa , ajay.nandam@oss.qualcomm.com Cc: asahi@lists.linux.dev, linux-sound@vger.kernel.org, patches@opensource.cirrus.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Hector Martin , Sasha Finkelstein References: <20261004-macaudio-v2-0-7b47ed6335a8@gmail.com> <20261004-macaudio-v2-9-7b47ed6335a8@gmail.com> Content-Language: en-US From: Ajay Kumar Nandam In-Reply-To: <20261004-macaudio-v2-9-7b47ed6335a8@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: gRflnIL3mCSgg6Ax0xuIUzoS_MIcqbo- X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA3MDA3MiBTYWx0ZWRfX/dv3NQxL7T72 LqWjdeCFJUUyz9EK9fy+5NQ4KgYUutjolJVn5i9t5ivaGXFMs+pQzN21sN3WcWC1R4yyRfBdxjX efLNovus7NYLWrTDSEE0g52fZSeH85tmxeEv27qgeJ9wOWFZT0omUuXS9ZR5iZSBo9CDaXJhNTV e0MuVypI9CbqWxg1mYbdzCdtGXQc+mnhpk3vKJC//1yDIEUaR/mvqIUNbIJyd5XWnkj7ItCchum 7oDHZQRizISom26ozbWbXjZSpmcy5sVv8FtwtQi8vPKNQjfoxjKpHbScEAjLvLcuBy1z7CBpizU zSbGpsoGcLTeDMN0kTUKUDfrdEfBe+RvRG4SSPJwieStp5kSTBcpOZscPpLCJnxftMRT1XZGH4l qiAvdLbj6/NaUDQ1/MZ1h0ASsXz0JNtgW7L8MLGW44gsZLgnlOed1Dp0+lo9WKQmvy/e7/DNm2c lcJhs/DD6ljjNyS/CKg== X-Proofpoint-GUID: gRflnIL3mCSgg6Ax0xuIUzoS_MIcqbo- X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA3MDA3MiBTYWx0ZWRfXwY9HPKn6ytCk s5sHC6//VgRye7u+soFjHwgVtXVu9fX5mp++mPtMLd5+3Yam8bZjjuvCIS9XAMp/9bWK5v+bBS4 9OMikHZA00oHLnY3IT1MXD8fJmZh1WM= X-Authority-Analysis: v=2.4 cv=NY1zRGD4 c=1 sm=1 tr=0 ts=6ac689c4 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ZXy6yrx+fn+bJIgs5eQ1WQ==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=NwbpVL58AAAA:8 a=dOLNmq4gAAAA:8 a=pGLkceISAAAA:8 a=291MuZCLWqhcjKYDPAcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=tNWvAHffTtQgx3ZTRG8Q:22 a=_m6CO-mWuQdSFutSHjXj:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-07_05,2026-10-06_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2610070072 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261007_110453_466014_E4724FA9 X-CRM114-Status: GOOD ( 23.02 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 10/4/2026 11:33 AM, James Calligeros wrote: > From: Martin Povišer > > Apple Silicon Macs have a complex audio subsystem consisting > of an I2S peripheral (MCA) and multiple codecs of various > models and capabilities. Some machines have a basic mono > speaker with hardware downmix, while others have a very > intricate stereo system consisting of multiple codecs and > drivers per L/R channel. Some machines report voice coil > voltage and current information back to the SoC, and others > do not. All machines have a headset jack. > > Add an ASoC machine driver for this platform. > > To express all of this sanely, we initialise the correct > combinations of codecs/I2S ports as DAI backends and link > them to a synthetic frontend. Each frontend is linked to > a PCM, one for the headset codec and one for the speaker > system on the target machine. > > Signed-off-by: Martin Povišer > Co-developed-by: Hector Martin > Signed-off-by: Hector Martin > Co-developed-by: Janne Grunau > Signed-off-by: Janne Grunau > Co-developed-by: Sasha Finkelstein > Signed-off-by: Sasha Finkelstein > Co-developed-by: James Calligeros > Signed-off-by: James Calligeros > --- > sound/soc/apple/Kconfig | 18 + > sound/soc/apple/Makefile | 4 + > sound/soc/apple/macaudio.c | 1699 +++++++++++++++++++++++++ > 3 files changed, 1721 insertions(+) > > + > +static int macaudio_be_trigger(struct snd_pcm_substream *substream, int cmd) > +{ > + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); > + struct macaudio_snd_data *ma = snd_soc_card_get_drvdata(rtd->card); > + struct macaudio_link_props *props = &ma->link_props[rtd->dai_link->id]; > + > + guard(mutex)(&ma->be_link_mutex); > + This is in the DAI link `.trigger` callback, but I don't see the macaudio links being marked `.nonatomic = 1`. The default PCM trigger path can run with the stream lock held and IRQs disabled, so taking a normal mutex here can sleep in atomic context. If this state really needs a sleeping lock, should the affected links be marked nonatomic, or should the trigger path avoid the mutex? > + if (props->is_speakers && substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { > + switch (cmd) { > + case SNDRV_PCM_TRIGGER_START: > + case SNDRV_PCM_TRIGGER_RESUME: > + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: > + ma->bes_active |= BIT(rtd->dai_link->id); > + break; > + case SNDRV_PCM_TRIGGER_SUSPEND: > + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: > + case SNDRV_PCM_TRIGGER_STOP: > + ma->bes_active &= ~BIT(rtd->dai_link->id); > + break; > + default: > + return -EINVAL; > + } > + > + schedule_work(&ma->lock_update_work); > + } > + > + return 0; > +} > +