From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10E443F86F8; Tue, 4 Aug 2026 06:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.92.39.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785825597; cv=none; b=XcfVbiHJ9FWfiOKlcdt58oh0VjZwGEo6c2VoREb9HicaOTi0ihB4PJlOb4aXJvFx9HBX8E7erpIpYOnO5TJ0QABipxs8+Sy5j374zEAKC9EOZsqz+TeNFLCTQ3AFioqSADL2eTSnYlpYbD1ntldpG160CH0ExhRbaxZifDPaybU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785825597; c=relaxed/simple; bh=8YPwB/ilrgq2Fo4ZejWnAQgW0JiHVrFzi0thZ417Ilk=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: In-Reply-To:References; b=Qd/Zbui1Aq7lDznr3UMJAcUgoYEtePK4I+EwvvZ9JUtCMTCmfrRA8ohjfAMM3nwqnkOkTfu9ZXgC3088r3Ihe4S/VbBJ7q4OAjxClmydKg93M/Xcn1MSgluQL29knoCqzQJ1yv0Oz2fyQlkT7nhLfJBtJKPMEozbszhPbeBXmcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.spacemit.com; spf=none smtp.mailfrom=linux.spacemit.com; dkim=pass (1024-bit key) header.d=linux.spacemit.com header.i=@linux.spacemit.com header.b=sYvhd31T; arc=none smtp.client-ip=54.92.39.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.spacemit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.spacemit.com header.i=@linux.spacemit.com header.b="sYvhd31T" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.spacemit.com; s=mxsw2412; t=1785825589; bh=LTq95m4NZXUv56aybCVzoaczk2vxOrA0Jv2yXEWtSSY=; h=Mime-Version:Date:Message-Id:Subject:From:To; b=sYvhd31TgYnMKQJpLLUlA+1VccY8F5ejrRGrvvOfPB58K69dgsC9VfqYNs//E18Eb zkOFaqrqucpCHyM+28Q9PS309oA854/Jj2lUiCtIyQeSendw1FDVgf1QtlAghHf4Zb rz7MrfBvrBXxEUmaoLfV4639dZb5kUiBONTn/82o= X-QQ-mid: esmtpsz20t1785825583t9654d158 X-QQ-Originating-IP: mRnntLrRUGnKaEWnui5APgcJXpIUBJXfl5KWk4O1viY= Received: from = ( [120.237.158.181]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 04 Aug 2026 14:39:41 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 16990820903706416116 EX-QQ-RecipientCnt: 14 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: multipart/signed; boundary=61ecdfd0fe19057f00ac6f6f76c3e71ea0f2054d2589209ef8ab808b217a; micalg=pgp-sha512; protocol="application/pgp-signature" Date: Mon, 03 Aug 2026 23:39:39 -0700 Message-Id: Cc: "Troy Mitchell" , "Goko Mell" , "Jinmei Wei" , "Kuninori Morimoto" , , , , Subject: Re: [PATCH] ASoC: spacemit: Remove redundant DAI field initialization From: "Troy Mitchell" To: "Bui Duc Phuc" , "Yixun Lan" , "Takashi Iwai" , "Mark Brown" , "Jaroslav Kysela" , "Liam Girdwood" In-Reply-To: <20260804043036.22065-1-phucduc.bui@gmail.com> References: <20260804043036.22065-1-phucduc.bui@gmail.com> Content-Transfer-Enc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ULoc Muxx+kQujTP1DMCctOgeA607E2F79Eq/2HyTcHCWnKTVZnXNpgLZzz+1kK9synNRNXHi/6Z 5p2L29P5Cgc+FviDpvcQgcZxmsEKl60/XBk9HYU7AndjlzZfPcjILyi2zJBNFqK7tPOfSxq 0FsAO5ZXMyS0Y9bMBC3O9+cLKA+i+rI4I9ZtXKlvnUQ X-QQ-XMRINFO: NS+P29fieYNwqS3WCnRCOn9D1NpZuCnCRA== X-QQ-RECHKSPAM: 0 --61ecdfd0fe19057f00ac6f6f76c3e71ea0f2054d2589209ef8ab808b217a Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 > spacemit_i2s_init_dai() already initializes the playback and capture > fields after duplicating the static DAI template with devm_kmemdup(). > Remove the duplicated initializers from the static template and keep > all field initialization in spacemit_i2s_init_dai(). The code change is functionally correct, but the commit message currently describes it only as removing redundant initialization. It also changes which stream directions ASoC considers valid. > @@ -354,22 +354,6 @@ static const struct snd_soc_dai_ops spacemit_i2s_dai= _ops =3D { > =20 > static struct snd_soc_dai_driver spacemit_i2s_dai =3D { > .ops =3D &spacemit_i2s_dai_ops, > - .playback =3D { > - .channels_min =3D 1, > - .channels_max =3D 2, > - .rates =3D SPACEMIT_PCM_RATES, > - .rate_min =3D SNDRV_PCM_RATE_8000, > - .rate_max =3D SNDRV_PCM_RATE_48000, > - .formats =3D SPACEMIT_PCM_FORMATS, > - }, > - .capture =3D { > - .channels_min =3D 1, > - .channels_max =3D 2, > - .rates =3D SPACEMIT_PCM_RATES, > - .rate_min =3D SNDRV_PCM_RATE_8000, > - .rate_max =3D SNDRV_PCM_RATE_48000, > - .formats =3D SPACEMIT_PCM_FORMATS, > - }, > .symmetric_rate =3D 1, > }; With the current static initialization, channels_min is nonzero for both directions before dma-names is examined. snd_soc_dai_stream_valid() therefore considers capture valid even when the device only provides a "tx" DMA channel, which is permitted by the binding. The DMAengine PCM code may then create a capture substream without an RX DMA channel and fail during PCM creation. > [...] > > @@ -399,6 +383,8 @@ static int spacemit_i2s_init_dai(struct spacemit_i2s_= dev *i2s, > dai->playback.channels_min =3D 1; > dai->playback.channels_max =3D 2; > dai->playback.rates =3D SPACEMIT_PCM_RATES; > + dai->playback.rate_min =3D SNDRV_PCM_RATE_8000; > + dai->playback.rate_max =3D SNDRV_PCM_RATE_48000; > dai->playback.formats =3D SPACEMIT_PCM_FORMATS; > =20 > i2s->playback_dma_data.addr_width =3D DMA_SLAVE_BUSWIDTH_2_BYTES; > > [...] > > @@ -411,6 +397,8 @@ static int spacemit_i2s_init_dai(struct spacemit_i2s_= dev *i2s, > dai->capture.channels_min =3D 1; > dai->capture.channels_max =3D 2; > dai->capture.rates =3D SPACEMIT_PCM_RATES; > + dai->capture.rate_min =3D SNDRV_PCM_RATE_8000; > + dai->capture.rate_max =3D SNDRV_PCM_RATE_48000; > dai->capture.formats =3D SPACEMIT_PCM_FORMATS; > =20 > i2s->capture_dma_data.addr_width =3D DMA_SLAVE_BUSWIDTH_2_BYTES; Initializing these fields conditionally preserves the existing capabilities for devices with both "tx" and "rx" DMA channels, while correctly disabling directions without a corresponding DMA channel. The added rate_min and rate_max assignments also preserve the existing rate constraints. Please update the subject and commit message to describe this functional fix rather than only the removal of redundant initialization. A possible subject is: ASoC: spacemit: advertise only DMA-backed DAI streams Since the issue was introduced with the original driver, please also add: Fixes: fce217449075 ("ASoC: spacemit: add i2s support for K1 SoC") - Troy --61ecdfd0fe19057f00ac6f6f76c3e71ea0f2054d2589209ef8ab808b217a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEABYKACsWIQSL4Ay2cExaPXAQcU2YCe+A+TM0LwUCanGJKw0caUB0cm95LXku b3JnAAoJEJgJ74D5MzQvrYMBAMbOjR8cB3gZnCCwoFuogtbhkkXZKuHUVOalvNnO xLXaAP9cyjXtTVuRiipuj1Wc5jAjZomGvTqPv1ctpbtf1xqFBA== =BzH6 -----END PGP SIGNATURE----- --61ecdfd0fe19057f00ac6f6f76c3e71ea0f2054d2589209ef8ab808b217a--