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=1796205384; b=P8lxzZ1gLj5OC57ErC+/O3kEE2jS7LRyYe3rn3td82P63GJQbqqoqPseUvIDrQeWvCan PA0EHz5RsvMdEt2dDynKzwQhC1zPPKsjA4b+JBQPLSWQa6mVCQvXTQMxBaensqYmD5qqY CZaYuYYdX9WHQEy+Ziu8VROCuJGC3WpCfKUYApZTEjpi2PVTS5HBvLHRRqdOHeAbfW8SZ Md9lhE5O/ZxEvH7rUyFjO6dVh5ppeZOIfPwtfjjQXDoBkFcGjbP6X22WkXE2ceP/iGvMK RXvVulxT7a8vRmM58qsF6igYcE2ECROMtfWy0ahL//1sUDt30QcxV+wXLAbbuxsVKig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796205384; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Yz6XEwMq8NL/qM8jVqK/WiWhfDeI2SB4+oMtAaVvtak=; b=eSEDP54IQP4hF2je628S5U/T2X2eokcLPVUOCU6ajRiZASTQOMusDQtbrQ0tolRKaiYL eNOH9cFXeUqrK2384d9Btn2+9kUnTQCYrq8sHP7RyiZ6RmIFkKvqL3/Hx6ejgBFEi63ro o4noJCD6rVjHH5zaTJNrWmACbMRFUqYs7YboXeuM8GMuv9iE14yW5F7ccKJcxEWfZNn+V qckTayA8UyJxiiTgtd/gg8Sry5uajC9PqmWNzc92+NBipXMArEQznc4ZuyQPCLWWR+fxf OaM0qQNKOoRzpB1o323/pb5TOPSdwoFrAWXlswt3DvsPJ5WzktfZ2dhcGgx94fzbtOA== 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="c/LzFyFr"; 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 16353606A691 for ; Wed, 2 Dec 2026 09:56:23 +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=c/LzFyFr Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FE751F00A20; Wed, 2 Dec 2026 09:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796205383; bh=Yz6XEwMq8NL/qM8jVqK/WiWhfDeI2SB4+oMtAaVvtak=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=c/LzFyFriHt10TtMtK3b+Xy/avMBmz3iVHA3dnTjh89PGZeXhqtcPThEORl26m18J YBujTf7hPQmOncnkoWMmzYqeCw5KmQ2z0sIjFu6WHQCClePpyDe6PwBunI5x8/+0On jm9Y9EU+3CwGo+d3L58RM+cb8VALY2e91kxPKQGabAAuOqXCucqOOnwCcWGY1CzAOY htkq7nG1qdqv9o9A5JV3HaO3CKM8Kov7JXvBT+COqraxvNlPWsNUrs+ZA6czC+7pdk NhIGxN03P8aP9XQD6bKy5wAhmyArDY60ZENBFIMM6y0mTfH3tWoRFYiRaWVXB8dJ5E Eiys5O1qiOcnA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] ALSA: hda: cix-ipbloq: Fix runtime PM handling on probe failure Reply-To: sashiko-reviews@lists.linux.dev To: "Sreeraj S Kurup" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261202094026.4432-1-sreekuttan2156239@gmail.com> References: <20261202094026.4432-1-sreekuttan2156239@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 09:56:23 +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 3 potential issues to consider: - [High] ALSA: hda: cix-ipbloq: unclocked MMIO or clk leak in cix_ipbloq_hda_probe() - [Low] ALSA: hda: cix-ipbloq: unused out_free_device label in cix_ipbloq_hda_probe() - [Low] ALSA: hda: cix-ipbloq: missing Fixes trailer in commit message -- commit 3f3419aa56e19e9c5ac17d7415a0c34a83809b1f Author: Sreeraj S Kurup > ALSA: hda: cix-ipbloq: Fix runtime PM handling on probe failure > > The driver enables runtime PM before calling > pm_runtime_resume_and_get(). > > If cix_ipbloq_hda_init() or cix_ipbloq_hda_probe_codec() > fails, the runtime PM usage reference is not released. > > Release the reference on these failure paths and disable > runtime PM before freeing the ALSA device and card. > > Also disable runtime PM if pm_runtime_resume_and_get() > fails, as runtime PM was already enabled. > > Signed-off-by: Sreeraj S Kurup [Severity: Low] This fixes the runtime PM cleanup on the probe error paths. Should the commit message include: Fixes: d91e9bd10125 ("ALSA: hda: add CIX IPBLOQ HDA controller support") > diff --git a/sound/hda/controllers/cix-ipbloq.c b/sound/hda/controllers/c= ix-ipbloq.c > index c07098fc13403..1344a5b9760a1 100644 > --- a/sound/hda/controllers/cix-ipbloq.c > +++ b/sound/hda/controllers/cix-ipbloq.c > @@ -284,21 +284,25 @@ static int cix_ipbloq_hda_probe(struct platform_dev= ice *pdev) > err =3D pm_runtime_resume_and_get(hda->dev); > if (err < 0) { > dev_err(hda->dev, "runtime resume and get failed, err =3D %d\n", err); > - goto out_free_device; > + goto out_pm_disable; > } > =20 > err =3D cix_ipbloq_hda_init(hda, chip, pdev); > if (err < 0) > - goto out_free_device; > + goto out_pm_put; > =20 > err =3D cix_ipbloq_hda_probe_codec(hda); > if (err < 0) > - goto out_free_device; > + goto out_pm_put; > =20 > pm_runtime_put(hda->dev); > =20 > return 0; > =20 > +out_pm_put: > + pm_runtime_put_sync(hda->dev); > +out_pm_disable: > + pm_runtime_disable(hda->dev); [Severity: High] Does suspending runtime PM before snd_device_free() and snd_card_free() cause unclocked MMIO accesses in cix_ipbloq_hda_dev_free(), or leak the enabled controller clocks if child codec devices were already created? In cix_ipbloq_hda_init(), azx_init_chip() sets azx_bus(chip)->chip_init to true, while chip->running stays 0 until the end of cix_ipbloq_hda_probe_codec(). If probe fails after azx_init_chip() and before codec child devices exist (for example, when !bus->codec_mask), pm_runtime_put_sync() runs cix_ipbloq_hda_runtime_suspend(), which skips azx_stop_chip() because chip->running is 0 and disables hda->clocks: sound/hda/controllers/cix-ipbloq.c:cix_ipbloq_hda_runtime_suspend() { if (chip && chip->running) { azx_stop_chip(chip); azx_enter_link_reset(chip); } clk_bulk_disable_unprepare(hda->nclocks, hda->clocks); } When snd_device_free(card, chip) then calls cix_ipbloq_hda_dev_free(), azx_bus(chip)->chip_init is still true, so azx_stop_all_streams() and azx_stop_chip() read and write HDA controller registers while the clocks are disabled. Conversely, if cix_ipbloq_hda_probe_codec() fails in azx_codec_configure() or snd_hda_card_register() after azx_probe_codecs() has created active child codec devices, hda->dev->power.child_count is non-zero until snd_card_free() releases the codecs via snd_hdac_device_exit(). pm_runtime_put_sync() then fails with -EBUSY, and pm_runtime_disable() prevents cix_ipbloq_hda_runtime_suspend() from running, leaking the prepared and enabled ipg and per clocks. Freeing the device and card before running pm_runtime_put_sync() and pm_runtime_disable() (as cix_ipbloq_hda_remove() does) would stop the chip while clocked and release child codecs before suspending. > out_free_device: > snd_device_free(card, chip); [Severity: Low] With all three goto out_free_device statements replaced, does the out_free_device label trigger an unused-label compiler warning? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202094026.4432= -1-sreekuttan2156239@gmail.com?part=3D1