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=1796384301; b=1KmWjeIc3igsaiBuQs9tldRCd2+l5fybmYW876ngzIsJL+Vn4r/ORH02c78W9nx4aa7c yMxEl/oUU59PoHHHw1tK+NUfrBYqdLYaKzfMJe+sUBounSIHDKfcOGojGhSS/rOH8UXwy YU75Pcz/37pTnutlAuUbzKd4rJIgtyuEVgCHGMz7KncB6A/QrhW3zsJwVk1+YHyJW7h4a UvKW2SnAQ8+FMRB25VASGARmJVtX52/x2J2Is/IEvQhlDDCzh2W4bUiqI+0ufOJ9TaHxy v7tkhvgTgNlEKxXMBAZtlvgyAXiFLGOtEgCCbNfjIscgREnFcyBa2vkVEI+w6h8oicw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384301; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=/Lfy8UR19qkNnR9kcPNTrAM9wyYixhhxFLXb/CkGw5s=; b=JvehLgHtspYsijzAGkd5QfBEcT1MevUyoETgYOq6naZjgsNJhSxBfEtgVwDpd9LHZZ8t kTDCTQFyd1WDyJPIS4ikWqhNFxFm8+iqZlp9P87iomWsIyRFvFv7LwMmUswRkZLx0Mom2 qTHcUF0/3FX7GkNxcZT75Cv1XUmAsTbiGy6B5uFsZbyuhiL+RO5Gp9ozygG66gC2mFQzQ aUg5tumS+U7NVQE4F6CETKekKVCMb3wZRUcTE5j03qmprWEOCPWebjwodvF6v3aHsyn4R IB2g3LDVpFXHx+E5cNXKBHwo+oiYCCqmGDXU1n8jtWpqOuh67ih0htSare5A6yKPIdQ== 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="LR/htEFl"; 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 2823C606A32F for ; Fri, 4 Dec 2026 11:38:21 +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=LR/htEFl Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF97A1F000CE; Fri, 4 Dec 2026 11:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796384300; bh=/Lfy8UR19qkNnR9kcPNTrAM9wyYixhhxFLXb/CkGw5s=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=LR/htEFlBOLZ7cyi7dqnFmHTNTIhoWq4T5qhmMqiK8RvCAp5kZz6kd0s16iDfLuiI YTRHtzwsEaGYLveA2OgQMRpI+absAmSlrPhs9ROfylcxjsVpsL6y7H38NrVAo06f2w dUPv+P98iy1JILX2AUKZGP0NwXY54AEBPZeUVG7ws+jQOHcC8wDRxD9Z2ksNs0JPwX KAOojI2JPr43FhKqmAVhR12MCpJrWRlujPs+mtrUPuCqanv9QbV82nkp8x/7Xm8ou+ Qq+kE2GCMpfSzm7oi1MQHiVvgftgVXnUdzix3YG3YBeBbotrU7XGvWYC6QM5hWUy+5 GX9aAn4RSj08w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable() Reply-To: sashiko-reviews@lists.linux.dev To: phucduc.bui@gmail.com Cc: linux-sound@vger.kernel.org In-Reply-To: <20261204111644.63432-4-phucduc.bui@gmail.com> References: <20261204111644.63432-1-phucduc.bui@gmail.com> <20261204111644.63432-4-phucduc.bui@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 11:38:20 +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: amd: raven: UAF in i2s_irq_handler() due to probe/devres reordering - [Low] ASoC: amd: raven: commit message omits probe reordering and MMIO write -- commit bfce84f5994b14173f5fe0980ac3f19b7b299695 Author: bui duc phuc > ASoC: amd: raven: Use devm_pm_runtime_enable() > > Use devm_pm_runtime_enable() to automatically disable runtime PM > when the device is removed, allowing the remove callback to be > removed. > > Signed-off-by: bui duc phuc [Severity: Low] Should the commit message also describe the probe reordering and the new mmACP_EXTERNAL_INTR_ENB write? The patch moves runtime PM setup and devm_request_irq() ahead of devm_snd_soc_register_component(), and adds a write to mmACP_EXTERNAL_INTR_ENB in acp3x_audio_probe(). These are only noted after the --- separator, which is stripped when the patch is applied. > diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/ac= p3x-pcm-dma.c > index 700c0ca20e181..1555157d8316c 100644 > --- a/sound/soc/amd/raven/acp3x-pcm-dma.c > +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c > @@ -408,6 +408,24 @@ static int acp3x_audio_probe(struct platform_device = *pdev) > adata->i2s_irq =3D status; > =20 > dev_set_drvdata(&pdev->dev, adata); > + > + pm_runtime_set_autosuspend_delay(&pdev->dev, 2000); > + pm_runtime_use_autosuspend(&pdev->dev); > + pm_runtime_mark_last_busy(&pdev->dev); > + pm_runtime_set_active(&pdev->dev); > + status =3D devm_pm_runtime_enable(&pdev->dev); > + if (status) > + return status; > + > + status =3D devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler, > + irqflags, "ACP3x_I2S_IRQ", adata); > + if (status) { > + dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n"); > + return -ENODEV; > + } > + > + rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); > + > status =3D devm_snd_soc_register_component(&pdev->dev, > &acp3x_i2s_component, > NULL, 0); [Severity: Medium] Can moving devm_request_irq() before devm_snd_soc_register_component() cause a use-after-free of struct snd_pcm_substream during driver unbind? Devres unwinds in LIFO order, so devm_component_release() now runs before devm_irq_release() calls free_irq(). acp3x_dma_close() clears the stream pointers without locking or calling synchronize_irq(), leaving an in-flight i2s_irq_handler() with a stale substream pointer: CPU0 CPU1 devres_release_all() devm_component_release() snd_soc_component_unregister() ... acp3x_dma_close() i2s_irq_handler() reads rv_i2s_data->play_stream adata->play_stream =3D NULL snd_card_free() ... kfree(substream) snd_pcm_period_elapsed(play_stream) <-- use-after-free devm_irq_release() free_irq() Keeping devm_request_irq() after devm_snd_soc_register_component() ensures free_irq() synchronizes i2s_irq_handler() before the component and its PCM substreams are torn down. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204111644.6343= 2-1-phucduc.bui@gmail.com?part=3D3