lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Dec 2021 12:02:48 +0530
From:   Sameer Pujar <spujar@...dia.com>
To:     <tiwai@...e.com>, <broonie@...nel.org>, <lgirdwood@...il.com>,
        <robh+dt@...nel.org>, <thierry.reding@...il.com>, <perex@...ex.cz>
CC:     <jonathanh@...dia.com>, <digetx@...il.com>,
        <alsa-devel@...a-project.org>, <devicetree@...r.kernel.org>,
        <linux-tegra@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Sameer Pujar <spujar@...dia.com>, <stable@...r.kernel.org>
Subject: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

HDA regression is recently reported on Tegra194 based platforms.
This happens because "hda2codec_2x" reset does not really exist
in Tegra194 and it causes probe failure. All the HDA based audio
tests fail at the moment. This underlying issue is exposed by
commit c045ceb5a145 ("reset: tegra-bpmp: Handle errors in BPMP
response") which now checks return code of BPMP command response.

The failure can be fixed by avoiding above reset in the driver,
but the explicit reset is not necessary for Tegra devices which
depend on BPMP. On such devices, BPMP ensures reset application
during unpowergate calls. Hence skip reset on these devices
which is applicable for Tegra186 and later.

Signed-off-by: Sameer Pujar <spujar@...dia.com>
Cc: stable@...r.kernel.org
Depends-on: 87f0e46e7559 ("ALSA: hda/tegra: Reset hardware")
---
 sound/pci/hda/hda_tegra.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index ea700395..862141e 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -68,6 +68,10 @@
  */
 #define TEGRA194_NUM_SDO_LINES	  4
 
+struct hda_data {
+	unsigned int do_reset:1;
+};
+
 struct hda_tegra {
 	struct azx chip;
 	struct device *dev;
@@ -76,6 +80,7 @@ struct hda_tegra {
 	unsigned int nclocks;
 	void __iomem *regs;
 	struct work_struct probe_work;
+	const struct hda_data *data;
 };
 
 #ifdef CONFIG_PM
@@ -427,8 +432,13 @@ static int hda_tegra_create(struct snd_card *card,
 	return 0;
 }
 
+static const struct hda_data tegra30_data = {
+	.do_reset = 1,
+};
+
 static const struct of_device_id hda_tegra_match[] = {
-	{ .compatible = "nvidia,tegra30-hda" },
+	{ .compatible = "nvidia,tegra30-hda", .data = &tegra30_data },
+	{ .compatible = "nvidia,tegra186-hda" },
 	{ .compatible = "nvidia,tegra194-hda" },
 	{},
 };
@@ -449,6 +459,8 @@ static int hda_tegra_probe(struct platform_device *pdev)
 	hda->dev = &pdev->dev;
 	chip = &hda->chip;
 
+	hda->data = of_device_get_match_data(&pdev->dev);
+
 	err = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
 			   THIS_MODULE, 0, &card);
 	if (err < 0) {
@@ -456,10 +468,12 @@ static int hda_tegra_probe(struct platform_device *pdev)
 		return err;
 	}
 
-	hda->reset = devm_reset_control_array_get_exclusive(&pdev->dev);
-	if (IS_ERR(hda->reset)) {
-		err = PTR_ERR(hda->reset);
-		goto out_free;
+	if (hda->data && hda->data->do_reset) {
+		hda->reset = devm_reset_control_array_get_exclusive(&pdev->dev);
+		if (IS_ERR(hda->reset)) {
+			err = PTR_ERR(hda->reset);
+			goto out_free;
+		}
 	}
 
 	hda->clocks[hda->nclocks++].id = "hda";
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ