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=1796181785; b=QKN3j8H6GEDglojcYrp5M7l+RVzdwVTB0Yokufc/z1T3ZrMkTXSYvex0Pg9i44PoavzQ JzUhLif9uYngtT6+YhdlCfpEWZC/70ddPHbYCtlBvrpnXtnQ+xo3Iw4EkaJXKbCcEKdWe wR4IFgmPrF/gPQKDo+DF+U9+XVpxgByokke0W/sfN3a+60H6VCjPGjjXa9aC++K5VsIfY bvmZul0irSG0R/lsvn/KS5GYA4OdxatPOurSV1rvKm3eRRKkP9JGDyz0oIcWkncytSNoL QlX662Jrnpn53FW65unnDQJXaGdWYnAnbOkGKdozDNy5rz//ibFqsn0zRIxsAymt69Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796181785; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=TVuIHxSNroE1FO+nXlkf3R/M3rGd7ShrN19BMesuTUU=; b=gc3UgK3OCunVONuR/ycpPgiRF3sMAWdKs87dRuoKCXjwg9pwOwIZ4/lEHYhKZkKSEfcA b2cHOz6mLfuiC7xbCF4I8p6qc1bazJjgaICm0qP/mS10c4Tk3aJaPT6YNlh93h3pJMU/I rYgzWbJzSuYtLQ5TKjOGv/N0J62CEae8NnMCYP802Mx87jBxg7JABRSrymYDmI+AW5rhX v0RAq7BV5XIH2pRMxVSWDf+GoSYEeIbM+RlwmcuOUzAhdADLApOqMEMMK28kKkfWPkdJC /5JD/6pt/NWdQixeSnVaFDbQdsDJsE4zAp9mHCzpxfo6aekcjchZ37x2kuIsN699nTw== 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=DgBKmFcZ; 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 CF89B606A32D for ; Wed, 2 Dec 2026 03:23:05 +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=DgBKmFcZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60F8F1F000C1; Wed, 2 Dec 2026 03:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796181785; bh=TVuIHxSNroE1FO+nXlkf3R/M3rGd7ShrN19BMesuTUU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=DgBKmFcZ38AOfI+PWSS5iETFDK6VuYPSkysW3/he0dDj0mJ26SgNT9JouzTND3rtv JgMrVNwQm3WWejXP2QuhVlkdB1RI/zSA2vLBiqAlaoKAYqGCi3QHhLq8oOT0o+iYI+ cRjLIgUENscomzkHoCZopw+GdzVaO0In1t/TL9OOGF1W1ywUw3Ifp0PaAxlnfEMWED wLvtohYifMavyoLdCeSKSBWLLWGNQKAqxNr834yFIF25dYTsMs/HSumsQS1NDYc8nJ Bpw0+jaI6lqefYIFKjamdZ58Y5npW8U5oowLerUy/aC/uiSjHyHc5FvmlmRqOL9Ktp lt60h9HqgSsyA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 3/4] ALSA: hda: Add MAX98390 side codec driver Reply-To: sashiko-reviews@lists.linux.dev To: "Stephan Lensky" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261202031233.171555-4-linux@slensky.com> References: <20261202031233.171555-1-linux@slensky.com> <20261202031233.171555-4-linux@slensky.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 03:23:04 +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 1 potential issue to consider: - [Medium] ALSA: hda/max98390: missing amp disable and state reset in max98390_hda_unbind() -- commit 932d4d95bd29cb7c6e758fa755dfe01e842d759c Author: Stephan Lensky ALSA: hda: Add MAX98390 side codec driver This commit adds an HDA side codec driver for MAX98390 boosted class-D amplifiers over I2C, binding to the HDA codec via the component framework and applying default or firmware-loaded DSM speaker tuning. Link: https://github.com/thesofproject/linux/pull/5616 > diff --git a/sound/hda/codecs/side-codecs/max98390_hda.c b/sound/hda/code= cs/side-codecs/max98390_hda.c > new file mode 100644 > index 0000000000000..15ae3c5a9a670 > --- /dev/null > +++ b/sound/hda/codecs/side-codecs/max98390_hda.c [ ... ] > +static void max98390_hda_unbind(struct device *dev, struct device *maste= r, void *master_data) > +{ > + struct max98390_hda_priv *priv =3D dev_get_drvdata(dev); > + struct hda_component_parent *parent =3D master_data; > + struct hda_component *comp; > + > + comp =3D hda_component_from_index(parent, priv->index); > + if (comp && comp->dev =3D=3D dev) > + memset(comp, 0, sizeof(*comp)); > + > + guard(mutex)(&priv->lock); > + > + release_firmware(priv->dsm_fw); > + priv->dsm_fw =3D NULL; > +} > + > +static const struct component_ops max98390_hda_comp_ops =3D { > + .bind =3D max98390_hda_bind, > + .unbind =3D max98390_hda_unbind, > +}; > + > +int max98390_hda_probe(struct device *dev, int index, struct regmap *reg= map) > +{ > + struct max98390_hda_priv *priv; > + unsigned int rev_id; > + int ret; > + > + if (IS_ERR(regmap)) > + return dev_err_probe(dev, PTR_ERR(regmap), "Failed to allocate regmap\= n"); > + > + priv =3D devm_kzalloc_obj(dev, *priv); > + if (!priv) > + return -ENOMEM; > + > + ret =3D devm_mutex_init(dev, &priv->lock); > + if (ret) > + return ret; > + > + priv->dev =3D dev; > + priv->regmap =3D regmap; > + priv->index =3D index; > + priv->channel =3D index % 2; > + priv->is_tweeter =3D index >=3D MAX98390_HDA_NUM_AMPS / 2; > + dev_set_drvdata(dev, priv); > + > + ret =3D regmap_read(regmap, MAX98390_R24FF_REV_ID, &rev_id); > + if (ret) > + return dev_err_probe(dev, ret, "Failed to read revision ID\n"); > + > + dev_dbg(dev, "Revision ID 0x%02x\n", rev_id); > + > + return component_add(dev, &max98390_hda_comp_ops); > +} > +EXPORT_SYMBOL_NS_GPL(max98390_hda_probe, "SND_HDA_SCODEC_MAX98390"); > + > +void max98390_hda_remove(struct device *dev) > +{ > + struct max98390_hda_priv *priv =3D dev_get_drvdata(dev); > + > + component_del(dev, &max98390_hda_comp_ops); > + > + guard(mutex)(&priv->lock); > + > + if (priv->playback_started) > + max98390_hda_set_amp_enable(priv, false); > +} [Severity: Medium] Should max98390_hda_unbind() disable the amplifier and reset priv->playback_started instead of doing it only in max98390_hda_remove()? If any one amplifier or the HDA codec master is unbound while a playback stream is open, component teardown runs max98390_hda_unbind() on all four amplifiers and clears their playback hooks in comp. Only the single device going through max98390_hda_remove() disables its amplifier; the remaining unbound amplifiers miss HDA_GEN_PCM_ACT_CLOSE, stay enabled in hardware, and retain a stale priv->playback_started =3D true that causes max98390_hda_system_resume() to re-enable them even when no stream is active. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202031233.1715= 55-1-linux@slensky.com?part=3D3