From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796279693; b=EzIcNsQHoEjULrC4h8jZ12JrFEJvI9ZZlE5d2NoDFCGzN/pARIRhVzZ/5u44gtOsCHlL VGm5+sFpovRnYR+Aiwfru07fyEFGQGJqTlEgvO0KOdjSha8fsMeD3P0V5lPvWralcdu3L sRvwCPHhDi91koW1d8jjCah0jxC835aqAMiHrnzKqJJ7NQfaPndtOkLDRha/N+N1DkTmU WGH6TWbNUbkpdg2OOBaLVtq4WlyxD0TerjHQ2UFQmnNFTeBrsk/+SAhl7wQF5gDP7aPxU u1p/S9/nL5O9g74hE5beUVtUIjA49JY7gpKkYuGmMFIxkMyGznADtBrqSLmTtjWITdw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796279693; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=nwpQwTqcfxsqVl93rEc1rIuh2rl36fJeDKxsZRmMhlk=; b=ysocxhzk1eGbNz6OtBVomJtu3aOZFZNGNhhCR5P69Z15PUn8oCkjOGzsH3MDSono//GT Oe8746DxhWC590iFqZLB8+SYKOOuX7jMu06An8U0Ojhzw8Nv8WoWhYO+3mIUb6LofUpnN lbXGIO/sDmRvoXHtimIPWD67HuzhIMmeX6PycEtmIDugkJnS37WFMYrNK/FyCU9izFHn8 Mdudtylx7fCKBUChsukZEhPLDFPuLCYI1+E1AvXdWqF7BzFGF+0O4CgLcsRD5SJG9Mbfl pHYUAe5ktUnPzJePKZr1sM9WlSJ9K66/1fv+G6oZGaXS+fsDf33t/EbW/8vau9ySeCQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CDN5rqYU; arc=none smtp.remote-ip=209.85.210.172 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 192B8606A33F for ; Thu, 3 Dec 2026 06:34:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 192B8606A33F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=CDN5rqYU Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-8b67f25e6e1so6960436b3a.0 for ; Wed, 02 Dec 2026 22:34:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796279692; x=1796884492; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=nwpQwTqcfxsqVl93rEc1rIuh2rl36fJeDKxsZRmMhlk=; b=CDN5rqYU2nLwqqKuJXSeAwTYeW0B7nsi6iyhxiAfMsRku6hu+qkxk+rJiNKGNWYEIW t+58cGH8VtTSDUzyNWUO+Iuvg1PuQv6b0XSh4J7rV3IEV+AU5EIC8yB64oTxL5tf6JK+ 0mhSJfjGqs462Vt/LxlQ+vMd/uTQ2nlwuo5Vs6RGYjKZLIV9RJJoHsUW27AXaGdri2dI x1Vzgf0KJXZ+ojAG14SS9czF1u++gDbZkgFan9katd9mUDg43xkLRlq/FOsG/L82V+kI s5MQoIVWVa30S91TdKoUiLniQOBqyCXJqTegWPoGr5lEdqXVPGFMHf+ZX4Zo3kb6zjg0 kurA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796279692; x=1796884492; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=nwpQwTqcfxsqVl93rEc1rIuh2rl36fJeDKxsZRmMhlk=; b=xBwXfMQ3K5/Z4Z7fn/AwLToYbYeKuzGiRnWX6q3xtVmqUhgmYAhzeXwA7bViQWKvBQ 1Znv9Vir7p0YqYr5gCWp+4OS5PSVxDgHM1fGFPRVQ+A6vzXC6ZQH/v/mOqe+w2l6V0Ik 0mzXskwO9TZPJg3chkSfK8bilLWOHfiHsMSwkgxjIwbMXrG3EagNqH9a4Nw2u4LDWhMb dlgtjTckcEofLxRi6To2lsT0lxVhGunOi8yxj2NzQp7zR2Xn36NJ3LSWn3Z7Y3y62PtY +eZ9SV44+XHxojJyKl89Vl8iYUnhuJXvS/f6T4iSdyPi3ILYWUqZF4tLgXQnIU8Vs++6 FTZA== X-Forwarded-Encrypted: i=1; AL+hErF84wo1Cif63SfAA7VyOCcxZj43fp2SSNMmMLIS9utD+aTzDyNvS1HbBWhSSTtV5fXcI3t1MWr/GPLTLQ4=@vger.kernel.org X-Gm-Message-State: APuU4Z+13emo4sPTjlxbpmwjRb8911J3v8eemopPp9eamgjQEqqXancS kDxSxS4T0O4fCtI81qePKx9qafSaWsBK+6sXqbjjpUsLhfwWq98pXMxc X-Gm-Gg: AZFdTZdZxd4if9QarA2mdZs9jh1ubdTmtT6x7v0SQd//ywiZ3BIcypnfgmjc/whIdu2 D97VsIf/i9luzm/4sVdcm8zmZv6ZwMgI73mw1Y4h0AyEjX4L0/mN0tukwIuidI/+cKj3MMSA+QH N0ciOEu88cOWG2UIN6VQeT/6V934H4Jn6dBFVsv3EPtQWqufN/ShzvSTuPS2aF3+LUppaKKfm1W ohjPtdyi63kWR/xumj24CEH7liJZpbulf7sC9QvEfioDxFRcTUHAvvKqykPHDxuQoYu3U8rv3fQ xhZovm4Fl0TBGxJ1cGXrDgu/DpuPWi8+UFsWdSTyI7r44oFcV7sPS8Jtd6mPgdv+NwbCiSLWlLo O5m8NrCnK6Zc7fPP+JUqsTIbWGfIeT55AshsRiAbwWWltQIU4iN5Y+KdeEAjRn9HkC9F3wuZZIl YZIm9i2HKmNXIja84nKqJSV7CEZdFtOK14GItcQoMYfY7WmukTbTW9alSqaWMHaQj2u9FuSGPDC sXvHX/RlNA+HYO0P47nLbqsFn5zFPMsEHiZgmsGLeLk8xVe9nGyQ9CSGP+MPIqJprft0Z0otP2Q HaRQ8fEicjw0crfVdGHAG2+xThxFNgsho1mnzp8OygZOd2QJ6kiFbCQ93F8CWCx8Xp3gje+uwyI dX9USuf2hJbm/jY1nAt6W6AFdRppKBXGwDsnnKwuJzjQINA== X-Received: by 2002:a05:6a21:115:b0:3e2:a07b:f383 with SMTP id adf61e73a8af0-4014e752d44mr46292037637.70.1796279692131; Wed, 02 Dec 2026 22:34:52 -0800 (PST) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c873c1e2f3sm22767820b3a.54.2026.12.02.22.34.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 22:34:51 -0800 (PST) From: phucduc.bui@gmail.com To: Mark Brown , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Ray Jui , Scott Branden , linux-sound@vger.kernel.org, Kees Cook , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kuninori Morimoto , bui duc phuc Subject: [PATCH 1/2] ASoC: bcm2835-i2s: Remove redundant clock start/stop in trigger path Date: Thu, 3 Dec 2026 13:34:33 +0700 Message-ID: <20261203063435.13517-2-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261203063435.13517-1-phucduc.bui@gmail.com> References: <20261203063435.13517-1-phucduc.bui@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc bcm2835_i2s_stop() is called from .trigger and .shutdown, and stops the clock when the DAI is no longer active and SND_SOC_DAIFMT_CONT is not set. In .trigger the DAI is always active, so the clock is never stopped there. In .shutdown, bcm2835_i2s_shutdown() stops the clock itself right after calling bcm2835_i2s_stop() once no stream is left. The check in bcm2835_i2s_stop() is therefore not needed and can be removed. Likewise, the bcm2835_i2s_start_clock() call in .trigger has no effect, as the clock has already been started in .hw_params and is not stopped before the stream is started. Remove both, which also keeps clk_prepare_enable() and clk_disable_unprepare(), which may sleep, out of the atomic .trigger callback. Drop the now unused dai argument of bcm2835_i2s_stop() and the outdated comment in bcm2835_i2s_shutdown(). No functional change intended. Signed-off-by: bui duc phuc --- sound/soc/bcm/bcm2835-i2s.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c index 8702f1d062df..68be1ded6f93 100644 --- a/sound/soc/bcm/bcm2835-i2s.c +++ b/sound/soc/bcm/bcm2835-i2s.c @@ -639,8 +639,7 @@ static int bcm2835_i2s_prepare(struct snd_pcm_substream *substream, } static void bcm2835_i2s_stop(struct bcm2835_i2s_dev *dev, - struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) + struct snd_pcm_substream *substream) { uint32_t mask; @@ -651,10 +650,6 @@ static void bcm2835_i2s_stop(struct bcm2835_i2s_dev *dev, regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_CS_A_REG, mask, 0); - - /* Stop also the clock when not SND_SOC_DAIFMT_CONT */ - if (!snd_soc_dai_active(dai) && !(dev->fmt & SND_SOC_DAIFMT_CONT)) - bcm2835_i2s_stop_clock(dev); } static int bcm2835_i2s_trigger(struct snd_pcm_substream *substream, int cmd, @@ -667,7 +662,6 @@ static int bcm2835_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - bcm2835_i2s_start_clock(dev); if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) mask = BCM2835_I2S_RXON; @@ -681,7 +675,7 @@ static int bcm2835_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - bcm2835_i2s_stop(dev, substream, dai); + bcm2835_i2s_stop(dev, substream); break; default: return -EINVAL; @@ -720,7 +714,7 @@ static void bcm2835_i2s_shutdown(struct snd_pcm_substream *substream, { struct bcm2835_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - bcm2835_i2s_stop(dev, substream, dai); + bcm2835_i2s_stop(dev, substream); /* If both streams are stopped, disable module and clock */ if (snd_soc_dai_active(dai)) @@ -730,10 +724,6 @@ static void bcm2835_i2s_shutdown(struct snd_pcm_substream *substream, regmap_update_bits(dev->i2s_regmap, BCM2835_I2S_CS_A_REG, BCM2835_I2S_EN, 0); - /* - * Stopping clock is necessary, because stop does - * not stop the clock when SND_SOC_DAIFMT_CONT - */ bcm2835_i2s_stop_clock(dev); } -- 2.43.0