From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796280713; b=DHFbmAboFIZ3pDmniq4RwyYQOdI8bB4kJrNK9O2oGFPaEVMRvB4M4dyrA2W+b+VnbT70 mJtGLyDmTtnNUmBZMdIdLfdAkGx2fkMilqAudPGbWKt38suisqDS2jltteNJwMVAZ0wIF iVIoH5ImsRVl6jvXOkFDb0Y8UBoBxyAPU73ghCnLLbLSch8bHrKVNJuLHoiPQVNEUsl0f PdgBnQr2reoZR9B1xlSEEpSKkgE/sYarz4+mHGyGaoTTJMbu0aVlo1f/xn9dO2B8Em33G eXeiTgm9ZL8rnUMqgqvFQPnmzAxv0OgqoLNhcjetvaH3sy/U82p6g3NZtuZET2Op8FQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796280713; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=uFCd6kSXVJVpmD5i1h5vnf9JwllIvzERfUimFaSmKq0=; b=bMe+X0WgR4hFC0kX+POeM7PPx3NUtDwkAszpLZV6RGUuWwzT9ujvYg+h6caVGL34HPfU /odmI9ttSgY6sW4hYDXvdYOqdx6uQ0Hd+yXoTwDf6uHcfL3cuZQUgN/ZtVYCDJ0K16sRm MqxztyH38Zg2/N22Nu+mXB54ts38cKrikC6qJL2rpkQTH26TPlZkd+Mjb/Hfq4uozLrl2 wPVNuq6Y83n1ChtJQVhCnoYeXFemxU41BEsXTcIgA+Ito9s1396fpki4Zs2L6KITQatxR Jy1VX7dSQBIlFW7fsWIz+REO1j80mMKVEbAgQQiUzh2yCiWQVXF4+ubCE7f8J19tNtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gyIBnGZT; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED1EE606A322 for ; Thu, 3 Dec 2026 06:51:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=gyIBnGZT Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7DC3A1F00893; Thu, 3 Dec 2026 06:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796280712; bh=uFCd6kSXVJVpmD5i1h5vnf9JwllIvzERfUimFaSmKq0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=gyIBnGZTcrZqrMj38KwPsik0WNaGirmF8zEjZ+Y/UzE9114T4q3JkpjXPToS553g+ dEZZJF8G9+2f5fq7lQmA1IWhDxcWVKwhxXpNfva1aGMasxU5N10NCws0rzQUpbPSxK 1bDp5Dx66k1wkc9dGBTI2HE/USr2NUh1FlwqlApzbmrTEXcBeHjL4wlHLPVmGq+kmH X9Ltm7ftbMAIpOj+ft0sVDroIUu5KYAdblig8OJ6qRgmaxDHpSSY4W+a9ul70atqDJ o4iXl484651tI76WyeZYBgt1iCVGyOmKuGh4Eu9AKQJdy5OE+h++mOAjnfyhLu+sPJ cfQCiK7H5fvWg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 2/2] ASoC: bcm2835-i2s: Check clock enable return value Reply-To: sashiko-reviews@lists.linux.dev To: phucduc.bui@gmail.com Cc: linux-sound@vger.kernel.org In-Reply-To: <20261203063435.13517-3-phucduc.bui@gmail.com> References: <20261203063435.13517-1-phucduc.bui@gmail.com> <20261203063435.13517-3-phucduc.bui@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 06:51:52 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] ASoC: bcm2835-i2s: bcm2835_i2s_clear_fifos() drops clock enable errors - [Low] ASoC: bcm2835-i2s: missing Fixes trailer for commit 517e7a1537ae -- commit f71f2eb66ebb99e713f0cc2faab79f0556d20a07 Author: bui duc phuc > ASoC: bcm2835-i2s: Check clock enable return value > > bcm2835_i2s_start_clock() ignores the return value of > clk_prepare_enable() and marks the clock as prepared even on failure, > so bcm2835_i2s_stop_clock() later disables a clock that was never > enabled. > > Return the error and only set clk_prepared on success. Propagate it > from .hw_params, and skip clearing the FIFOs in > bcm2835_i2s_clear_fifos(), which cannot be done without the clock. > > Signed-off-by: bui duc phuc [Severity: Low] This fixes a clock-imbalance bug introduced by commit 517e7a1537ae ("ASoC: bcm2835: move to use the clock framework"). Should this include: Fixes: 517e7a1537ae ("ASoC: bcm2835: move to use the clock framework") > diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c > index 68be1ded6f935..f367ca070e3a2 100644 > --- a/sound/soc/bcm/bcm2835-i2s.c > +++ b/sound/soc/bcm/bcm2835-i2s.c [ ... ] > @@ -173,8 +181,11 @@ static void bcm2835_i2s_clear_fifos(struct bcm2835_i= 2s_dev *dev, > =20 > /* Start clock if not running */ > clk_was_prepared =3D dev->clk_prepared; > - if (!clk_was_prepared) > - bcm2835_i2s_start_clock(dev); > + if (!clk_was_prepared) { > + ret =3D bcm2835_i2s_start_clock(dev); > + if (ret) > + return; > + } [Severity: Medium] Does discarding ret here let bcm2835_i2s_prepare() return 0 when the clock fails to enable, leaving the stream prepared with stale FIFO data and no active clock? Even with symmetric_sample_bits set, dev->clk_prepared can be false in bcm2835_i2s_prepare(). ALSA symmetry checks physical width (32 bits for both S24_LE and S32_LE), whereas bcm2835_i2s_hw_params() derives bclk_rate from logical width via snd_soc_params_to_bclk(). If an S24_LE stream stops or xruns with a non-empty FIFO, a full-duplex S32_LE stream in bcm2835_i2s_hw_params() stops the clock and can fail to restart it. When the first stream then calls bcm2835_i2s_prepare(), the clock error is dropped and bcm2835_i2s_prepare() returns 0. Both callers (bcm2835_i2s_hw_params() and bcm2835_i2s_prepare()) already return int, so bcm2835_i2s_clear_fifos() could return int and propagate the error. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203063435.1351= 7-1-phucduc.bui@gmail.com?part=3D2