Skip to contentSkip to conversation

Fix Tegra194 HDA regression

PATCH Superseded Sameer Pujar 5 participants 40 messages Dec 7, 2021 – Dec 20, 2021

Subsystems (5)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Fix Tegra194 HDA regression

HDA probe failure is observed on Tegra194 based platforms and this happens due to a reset failure. The series fixes this problem by avoiding explicit resets on BPMP based devices.

Sameer Pujar (3):
ALSA: hda/tegra: Skip reset on BPMP devices
dt-bindings: sound: tegra: Update HDA resets
arm64: tegra: Remove non existent Tegra194 reset

 .../bindings/sound/nvidia,tegra30-hda.yaml         | 13 ++++++++----
 arch/arm64/boot/dts/nvidia/tegra194.dtsi           |  5 ++---
 sound/pci/hda/hda_tegra.c                          | 24 +++++++++++++++++-----
 3 files changed, 30 insertions(+), 12 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

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.

Depends-on: 87f0e46e7559 ("ALSA: hda/tegra: Reset hardware")

---
 sound/pci/hda/hda_tegra.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
sound/pci/hda/hda_tegra.c +19 -5
index ea700395..862141e 100644
@@ -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";
Signature · 1 line
2.7.4
Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 25 lines · Sameer Pujar

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.

Depends-on: 87f0e46e7559 ("ALSA: hda/tegra: Reset hardware")

---
 sound/pci/hda/hda_tegra.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
sound/pci/hda/hda_tegra.c +0 -0
index ea700395..862141e 100644

sound/pci/hda/hda_tegra.c line 73

Quoted 6 lines
sound/pci/hda/hda_tegra.c +3 -0
@@ -68,6 +68,10 @@
  */
 #define TEGRA194_NUM_SDO_LINES	  4
 
+struct hda_data {
+	unsigned int do_reset:1;
+};

I suppose this could also be a bool. Not sure if we need to care about packing optimizations at this point.

It may also be useful to rename this to something less generic to avoid potential clashes with other data structures in the future. We've often used the _soc suffix in other drivers to mark this kind of SoC-specific data. In this case it would be struct hda_tegra_soc.

If Takashi is fine with this as-is, I don't have any strong objections, though.

Quoted 17 lines
sound/pci/hda/hda_tegra.c +3 -0
+
 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 = {

sound/pci/hda/hda_tegra.c static int hda_tegra_create(struct snd_card *card, · line 444

Quoted 10 lines
sound/pci/hda/hda_tegra.c +5 -1
+	.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" },
 	{},
 };

One other thing we've done in the past is to explicitly pass these structures for each compatible string. That simplifies things a bit because we don't have to keep checking for non-NULL pointers and instead rely on the fact that there's always a valid pointer.

To do so, you'd basically add:

	static const struct hda_data tegra186_data = {
		.do_reset = 0,
	};

And reference that for both the Tegra186 and Tegra194 entries. Again, not strictly necessary and since we have only one occurrence where we need to check this, it seems fine as-is, so:

#3 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 37 lines · Thierry Reding
Quoted 25 lines · Sameer Pujar

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.

Depends-on: 87f0e46e7559 ("ALSA: hda/tegra: Reset hardware")

---
 sound/pci/hda/hda_tegra.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)
sound/pci/hda/hda_tegra.c +0 -0
index ea700395..862141e 100644

sound/pci/hda/hda_tegra.c line 73

Quoted 6 lines
sound/pci/hda/hda_tegra.c +3 -0
@@ -68,6 +68,10 @@
  */
 #define TEGRA194_NUM_SDO_LINES	  4
 
+struct hda_data {
+	unsigned int do_reset:1;
+};

I suppose this could also be a bool. Not sure if we need to care about packing optimizations at this point.

Quoted 7 lines

It may also be useful to rename this to something less generic to avoid potential clashes with other data structures in the future. We've often used the _soc suffix in other drivers to mark this kind of SoC-specific data. In this case it would be struct hda_tegra_soc.

If Takashi is fine with this as-is, I don't have any strong objections, though.

Indeed, a bit more prefix would be better for avoiding the possible conflict in future, but the struct name is local, so I don't mind to use the simple name for now. We can change it later once when needed, too.

Quoted 39 lines
Quoted 17 lines
sound/pci/hda/hda_tegra.c +3 -0
+
 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 = {

sound/pci/hda/hda_tegra.c static int hda_tegra_create(struct snd_card *card, · line 444

Quoted 10 lines
sound/pci/hda/hda_tegra.c +5 -1
+	.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" },
 	{},
 };

One other thing we've done in the past is to explicitly pass these structures for each compatible string. That simplifies things a bit because we don't have to keep checking for non-NULL pointers and instead rely on the fact that there's always a valid pointer.

To do so, you'd basically add:

	static const struct hda_data tegra186_data = {
		.do_reset = 0,
	};
Quoted 5 lines

And reference that for both the Tegra186 and Tegra194 entries. Again, not strictly necessary and since we have only one occurrence where we need to check this, it seems fine as-is, so:

That's true, too. OTOH, completely without a NULL check would be also unsafe, so some sanity check would be still required.

That said, the current patch is good enough for taking as a regression fix, but I'm fine to wait for a while for v2 to address those, too :)

thanks,

Takashi

#4 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 16 lines · Takashi Iwai
Quoted 10 lines · Thierry Reding

I suppose this could also be a bool. Not sure if we need to care about packing optimizations at this point.

It may also be useful to rename this to something less generic to avoid potential clashes with other data structures in the future. We've often used the _soc suffix in other drivers to mark this kind of SoC-specific data. In this case it would be struct hda_tegra_soc.

If Takashi is fine with this as-is, I don't have any strong objections, though.

Indeed, a bit more prefix would be better for avoiding the possible conflict in future, but the struct name is local, so I don't mind to use the simple name for now. We can change it later once when needed, too.

[...]

Quoted 16 lines
Quoted 16 lines

One other thing we've done in the past is to explicitly pass these structures for each compatible string. That simplifies things a bit because we don't have to keep checking for non-NULL pointers and instead rely on the fact that there's always a valid pointer.

To do so, you'd basically add:

       static const struct hda_data tegra186_data = {
               .do_reset = 0,
       };

And reference that for both the Tegra186 and Tegra194 entries. Again, not strictly necessary and since we have only one occurrence where we need to check this, it seems fine as-is, so:

Quoted 7 lines
Quoted 1 line

That's true, too. OTOH, completely without a NULL check would be also unsafe, so some sanity check would be still required.

That said, the current patch is good enough for taking as a regression fix, but I'm fine to wait for a while for v2 to address those, too :)

Let me send a v2 for above.

#5 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

In reply to Sameer Pujar

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 7 lines

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.

Quoted 5 lines

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.

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

If T194+ doesn't have hda2codec_2x reset, then don't request that reset for T194+.

#6 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

07.12.2021 13:22, Dmitry Osipenko пишет:

Quoted 14 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 7 lines

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.

Quoted 5 lines

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.

Quoted 7 lines

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

If T194+ doesn't have hda2codec_2x reset, then don't request that reset for T194+.

I don't see the problem in the driver. It's only the device-tree that is wrong. This hda_tegra.c patch should be unneeded, please fix only the device-tree.

#7 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

07.12.2021 13:44, Dmitry Osipenko пишет:

Quoted 8 lines

07.12.2021 13:22, Dmitry Osipenko пишет:

Quoted 7 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 6 lines

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.

I see that this BPMP commit already has been reverted. There is no problem in this hda_tegra driver at all.

Quoted 18 lines
Quoted 6 lines
Quoted 5 lines

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.

Quoted 7 lines

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

If T194+ doesn't have hda2codec_2x reset, then don't request that reset for T194+.

I don't see the problem in the driver. It's only the device-tree that is wrong. This hda_tegra.c patch should be unneeded, please fix only the device-tree.

maintainer
#8 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 10 lines · Dmitry Osipenko

07.12.2021 13:44, Dmitry Osipenko пишет:

Quoted 8 lines

07.12.2021 13:22, Dmitry Osipenko пишет:

Quoted 7 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 6 lines

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.

Quoted 2 lines

I see that this BPMP commit already has been reverted. There is no problem in this hda_tegra driver at all.

That is temporary until this fix is merged and then we will revert the revert.

Jon

Signature · 1 line
nvpublic
#9 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

07.12.2021 14:02, Jon Hunter пишет:

Quoted 12 lines · Dmitry Osipenko
Quoted 10 lines

07.12.2021 13:44, Dmitry Osipenko пишет:

Quoted 8 lines

07.12.2021 13:22, Dmitry Osipenko пишет:

Quoted 7 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 6 lines

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.

Quoted 5 lines
Quoted 2 lines

I see that this BPMP commit already has been reverted. There is no problem in this hda_tegra driver at all.

That is temporary until this fix is merged and then we will revert the revert.

It's the device-tree that is broken, not the driver. If you don't care about broken HDMI audio using outdated dtb, then there is nothing to fix in the code.

Otherwise, the fix is to skip the non-existent reset.

You could add workaround to the BPMP reset driver by making it always return success for TEGRA194_RESET_HDA2CODEC_2X invocation instead of making the FW call for that reset.

maintainer
#10 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 16 lines · Dmitry Osipenko

07.12.2021 14:02, Jon Hunter пишет:

Quoted 15 lines · Dmitry Osipenko
Quoted 12 lines

07.12.2021 13:44, Dmitry Osipenko пишет:

Quoted 8 lines

07.12.2021 13:22, Dmitry Osipenko пишет:

Quoted 7 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 6 lines

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.

I see that this BPMP commit already has been reverted. There is no problem in this hda_tegra driver at all.

Quoted 6 lines
Quoted 2 lines

That is temporary until this fix is merged and then we will revert the revert.

It's the device-tree that is broken, not the driver. If you don't care about broken HDMI audio using outdated dtb, then there is nothing to fix in the code.

That's correct. However, we do care about HDMI audio being broken with existing DTBs and so we need to make sure they still work.

Jon

Signature · 1 line
nvpublic
#11 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

In reply to Dmitry Osipenko
Quoted 8 lines · Dmitry Osipenko

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 7 lines

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.

Quoted 8 lines
Quoted 5 lines

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.

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

Yes the power-domain is shared with display. As mentioned above, explicit reset in driver is not really necessary since BPMP is already doing it during unpowergate stage. So the h/w is already ensured to be in a good state.

#12 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

07.12.2021 15:00, Sameer Pujar пишет:

Quoted 16 lines · Dmitry Osipenko
Quoted 13 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 12 lines

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.

Quoted 8 lines
Quoted 3 lines

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

Yes the power-domain is shared with display. As mentioned above, explicit reset in driver is not really necessary since BPMP is already doing it during unpowergate stage. So the h/w is already ensured to be in a good state.

If you'll reload the driver module, then h/w won't be reset.

#13 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 19 lines · Dmitry Osipenko

External email: Use caution opening links or attachments

07.12.2021 15:00, Sameer Pujar пишет:

Quoted 15 lines · Dmitry Osipenko
Quoted 13 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 12 lines

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.

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

Yes the power-domain is shared with display. As mentioned above, explicit reset in driver is not really necessary since BPMP is already doing it during unpowergate stage. So the h/w is already ensured to be in a good state.

If you'll reload the driver module, then h/w won't be reset.

How the reload case would be different? Can you please specify more details if you are referring to a particular scenario?

#14 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

07.12.2021 15:40, Sameer Pujar пишет:

Quoted 25 lines · Dmitry Osipenko
Quoted 22 lines

External email: Use caution opening links or attachments

07.12.2021 15:00, Sameer Pujar пишет:

Quoted 18 lines · Dmitry Osipenko
Quoted 16 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 7 lines

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.

Quoted 5 lines

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.

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

Yes the power-domain is shared with display. As mentioned above, explicit reset in driver is not really necessary since BPMP is already doing it during unpowergate stage. So the h/w is already ensured to be in a good state.

If you'll reload the driver module, then h/w won't be reset.

How the reload case would be different? Can you please specify more details if you are referring to a particular scenario?

You have a shared power domain. Since power domain can be turned off only when nobody keeps domain turned on, you now making reset of HDA controller dependent on the state of display driver. Do you want to have inconsistent h/w reset behaviour depending on the runtime state of display driver?

#15 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 28 lines · Dmitry Osipenko

07.12.2021 15:40, Sameer Pujar пишет:

Quoted 27 lines · Dmitry Osipenko
Quoted 25 lines

External email: Use caution opening links or attachments

07.12.2021 15:00, Sameer Pujar пишет:

Quoted 21 lines · Dmitry Osipenko
Quoted 8 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 7 lines

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.

Quoted 8 lines
Quoted 5 lines

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.

The power domain is shared with the display, AFAICS. The point of reset is to bring h/w into predictable state. It doesn't make sense to me to skip the reset.

Yes the power-domain is shared with display. As mentioned above, explicit reset in driver is not really necessary since BPMP is already doing it during unpowergate stage. So the h/w is already ensured to be in a good state.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

If you'll reload the driver module, then h/w won't be reset.

How the reload case would be different? Can you please specify more details if you are referring to a particular scenario?

You have a shared power domain. Since power domain can be turned off only when nobody keeps domain turned on, you now making reset of HDA controller dependent on the state of display driver.

I don't think that the state of display driver would affect. The HDA driver itself can issue unpowergate calls which in turn ensures h/w reset. If display driver is already runtime active, HDA driver runtime resume after this would be still fine since h/w reset is already applied during display runtime resume. Note that both HDA and display resets are connected to this power-domain and BPMP applies these resets during unpowergate.

Quoted 3 lines

Do you want to have
inconsistent h/w reset behaviour depending on the runtime state of display driver?

Of course no.

#16 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

07.12.2021 17:49, Sameer Pujar пишет:
...

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

How the reload case would be different? Can you please specify more details if you are referring to a particular scenario?

You have a shared power domain. Since power domain can be turned off only when nobody keeps domain turned on, you now making reset of HDA controller dependent on the state of display driver.

Quoted 7 lines

I don't think that the state of display driver would affect. The HDA driver itself can issue unpowergate calls which in turn ensures h/w reset. If display driver is already runtime active, HDA driver runtime resume after this would be still fine since h/w reset is already applied during display runtime resume. Note that both HDA and display resets are connected to this power-domain and BPMP applies these resets during unpowergate.

HDA won't be reset while display is active on T186+. HDA will be reset while is display is inactive on T186+. HDA will be reset regardless of display state on pre-T186.

This is a pure inconsistency of the reset behaviour. Please don't do it.

#17 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 10 lines · Dmitry Osipenko

External email: Use caution opening links or attachments

07.12.2021 17:49, Sameer Pujar пишет:
...

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

How the reload case would be different? Can you please specify more details if you are referring to a particular scenario?

You have a shared power domain. Since power domain can be turned off only when nobody keeps domain turned on, you now making reset of HDA controller dependent on the state of display driver.

Quoted 8 lines
Quoted 7 lines

I don't think that the state of display driver would affect. The HDA driver itself can issue unpowergate calls which in turn ensures h/w reset. If display driver is already runtime active, HDA driver runtime resume after this would be still fine since h/w reset is already applied during display runtime resume. Note that both HDA and display resets are connected to this power-domain and BPMP applies these resets during unpowergate.

HDA won't be reset while display is active on T186+.

No. HDA reset is applied whenever power-domain is ungated. It can happen when either HDA or display device becomes active. So I don't think that it is inconsistent.

#18 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

07.12.2021 20:37, Sameer Pujar пишет:
..

Quoted 4 lines
Quoted 1 line

HDA won't be reset while display is active on T186+.

No. HDA reset is applied whenever power-domain is ungated. It can happen when either HDA or display device becomes active.

I said "display is active", where do you see "becomes active"?

Quoted 2 lines

So I don't think that
it is inconsistent.

If display is already active, then shared power domain is already ungated. It won't be ungated second time in a row, HDA won't get the reset.

#19 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

On 12/7/2021 11:32 PM, Dmitry Osipenko wrote

Quoted 2 lines

If display is already active, then shared power domain is already ungated.

If display is already active, then shared power domain is already ungated. HDA reset is already applied during this ungate. In other words, HDA would be reset as well when display ungates power-domain.

#20 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

08.12.2021 08:22, Sameer Pujar пишет:

Quoted 9 lines

On 12/7/2021 11:32 PM, Dmitry Osipenko wrote

Quoted 2 lines

If display is already active, then shared power domain is already ungated.

If display is already active, then shared power domain is already ungated. HDA reset is already applied during this ungate. In other words, HDA would be reset as well when display ungates power-domain.

Now, if you'll reload the HDA driver module while display is active, you'll get a different reset behaviour. HDA hardware will be reset on pre-T186, on T186+ it won't be reset.

Please make v2 using devm_reset_control_bulk_get_exclusive(), skipping the non-existent reset, or move the workaround to the BPMP driver like I suggested in the other reply.

#21 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 11 lines · Dmitry Osipenko

08.12.2021 08:22, Sameer Pujar пишет:

Quoted 7 lines

On 12/7/2021 11:32 PM, Dmitry Osipenko wrote

Quoted 2 lines

If display is already active, then shared power domain is already ungated.

If display is already active, then shared power domain is already ungated. HDA reset is already applied during this ungate. In other words, HDA would be reset as well when display ungates power-domain.

Now, if you'll reload the HDA driver module while display is active, you'll get a different reset behaviour. HDA hardware will be reset on pre-T186, on T186+ it won't be reset.

How the reset behavior is different? At this point when HDA driver is loaded the HW is already reset during display ungate. What matters, during HDA driver load, is whether the HW is in predictable state or not and the answer is yes. So I am not sure what problem you are referring to. Question is, if BPMP already ensures this, then why driver needs to take care of it.

#22 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

14.12.2021 09:02, Sameer Pujar пишет:

Quoted 15 lines · Dmitry Osipenko
Quoted 11 lines

08.12.2021 08:22, Sameer Pujar пишет:

Quoted 7 lines

On 12/7/2021 11:32 PM, Dmitry Osipenko wrote

Quoted 2 lines

If display is already active, then shared power domain is already ungated.

If display is already active, then shared power domain is already ungated. HDA reset is already applied during this ungate. In other words, HDA would be reset as well when display ungates power-domain.

Now, if you'll reload the HDA driver module while display is active, you'll get a different reset behaviour. HDA hardware will be reset on pre-T186, on T186+ it won't be reset.

Quoted 6 lines

How the reset behavior is different? At this point when HDA driver is loaded the HW is already reset during display ungate. What matters, during HDA driver load, is whether the HW is in predictable state or not and the answer is yes. So I am not sure what problem you are referring to. Question is, if BPMP already ensures this, then why driver needs to take care of it.

1. Enable display
2. Play audio over HDMI
3. HDA hardware now is in dirty state
4. Reload HDA driver
5. In your case HDA is kept in dirty state, in my no

#23 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

14.12.2021 09:09, Dmitry Osipenko пишет:

Quoted 23 lines

14.12.2021 09:02, Sameer Pujar пишет:

Quoted 15 lines · Dmitry Osipenko
Quoted 11 lines

08.12.2021 08:22, Sameer Pujar пишет:

Quoted 7 lines

On 12/7/2021 11:32 PM, Dmitry Osipenko wrote

Quoted 2 lines

If display is already active, then shared power domain is already ungated.

If display is already active, then shared power domain is already ungated. HDA reset is already applied during this ungate. In other words, HDA would be reset as well when display ungates power-domain.

Now, if you'll reload the HDA driver module while display is active, you'll get a different reset behaviour. HDA hardware will be reset on pre-T186, on T186+ it won't be reset.

Quoted 6 lines

How the reset behavior is different? At this point when HDA driver is loaded the HW is already reset during display ungate. What matters, during HDA driver load, is whether the HW is in predictable state or not and the answer is yes. So I am not sure what problem you are referring to. Question is, if BPMP already ensures this, then why driver needs to take care of it.

Quoted 6 lines

1. Enable display
2. Play audio over HDMI
3. HDA hardware now is in dirty state
4. Reload HDA driver
5. In your case HDA is kept in dirty state, in my no

The power domain is shared by display and HDA, is this correct?

If yes, then the shared power domain will be turned off only when all its clients are turned off, i.e. both display and HDA simultaneously.

#24 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

In reply to Dmitry Osipenko
Quoted 19 lines · Dmitry Osipenko

14.12.2021 09:02, Sameer Pujar пишет:

Quoted 12 lines · Dmitry Osipenko
Quoted 10 lines

08.12.2021 08:22, Sameer Pujar пишет:

Quoted 6 lines

On 12/7/2021 11:32 PM, Dmitry Osipenko wrote

Quoted 2 lines

If display is already active, then shared power domain is already ungated.

If display is already active, then shared power domain is already ungated. HDA reset is already applied during this ungate. In other words, HDA would be reset as well when display ungates power-domain.

Now, if you'll reload the HDA driver module while display is active, you'll get a different reset behaviour. HDA hardware will be reset on pre-T186, on T186+ it won't be reset.

Quoted 6 lines

How the reset behavior is different? At this point when HDA driver is loaded the HW is already reset during display ungate. What matters, during HDA driver load, is whether the HW is in predictable state or not and the answer is yes. So I am not sure what problem you are referring to. Question is, if BPMP already ensures this, then why driver needs to take care of it.

Quoted 4 lines

1. Enable display
2. Play audio over HDMI

3. HDA hardware now is in dirty state

Why this would be a dirty state? It is rather a functional state. Isn't it? Power-domain is ON while all this happens.

Another point is, with present logic the reset is not applied for every runtime PM resume of HDA device, which is confusing. It depends on the state of 'chip->running' flag and I don't see this getting cleared anywhere. Would you say subsequent HDA playback happen under a dirty state?

#25 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

14.12.2021 10:22, Sameer Pujar пишет:
...

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

How the reset behavior is different? At this point when HDA driver is loaded the HW is already reset during display ungate. What matters, during HDA driver load, is whether the HW is in predictable state or not and the answer is yes. So I am not sure what problem you are referring to. Question is, if BPMP already ensures this, then why driver needs to take care of it.

Quoted 7 lines
Quoted 4 lines

1. Enable display
2. Play audio over HDMI

3. HDA hardware now is in dirty state

Why this would be a dirty state? It is rather a functional state. Isn't it? Power-domain is ON while all this happens.

In general state should be a functional, but we shouldn't assume that. There is always a possibility for a subtle bug in a driver that may put h/w into a bad state. Full hardware reset is encouraged by users.

Quoted 4 lines

Another point is, with present logic the reset is not applied for every runtime PM resume of HDA device, which is confusing. It depends on the state of 'chip->running' flag and I don't see this getting cleared anywhere. Would you say subsequent HDA playback happen under a dirty state?

This is a good point. There should be another potential problem in the HDA driver for newer SoCs because apparently we don't re-initialize HDA controller properly after runtime PM resume.

See hda_tegra_first_init() that is invoked only during driver probe, it configures FPCI_DBG_CFG_2 register on T194, which isn't done by hda_tegra_init(), and thus, this register may be in reset state after resume from RPM suspend. It should be a bug in the HDA driver that needs to be fixed.

On older SoCs: HDA resides in the APB power domain which could be disabled only across system suspend/resume. HDA is only clock-gated during runtime PM suspend.

On newer SoCs: HDA power state could be lost after RPM suspend/resume, depending on the state of display. I'm wondering whether HDMI playback works after DPMS on T194+, I assume this case was never tested properly.

It looks like it should be safe to reset HDA on runtime PM resume regardless of the chip->running, and thus, we could remove that check and reset HDA unconditionally. Will great if you could check/test and improve this in the driver.

I'm also wondering whether snd_power_change_state() should be moved into RPM callbacks and whether this function does anything practically useful on Tegra at all.

#26 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

Quoted 44 lines · Dmitry Osipenko

14.12.2021 10:22, Sameer Pujar пишет:
...

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

How the reset behavior is different? At this point when HDA driver is loaded the HW is already reset during display ungate. What matters, during HDA driver load, is whether the HW is in predictable state or not and the answer is yes. So I am not sure what problem you are referring to. Question is, if BPMP already ensures this, then why driver needs to take care of it.

Quoted 7 lines
Quoted 4 lines

1. Enable display
2. Play audio over HDMI

3. HDA hardware now is in dirty state

Why this would be a dirty state? It is rather a functional state. Isn't it? Power-domain is ON while all this happens.

In general state should be a functional, but we shouldn't assume that. There is always a possibility for a subtle bug in a driver that may put h/w into a bad state. Full hardware reset is encouraged by users.

Quoted 4 lines

Another point is, with present logic the reset is not applied for every runtime PM resume of HDA device, which is confusing. It depends on the state of 'chip->running' flag and I don't see this getting cleared anywhere. Would you say subsequent HDA playback happen under a dirty state?

This is a good point. There should be another potential problem in the HDA driver for newer SoCs because apparently we don't re-initialize HDA controller properly after runtime PM resume.

See hda_tegra_first_init() that is invoked only during driver probe, it configures FPCI_DBG_CFG_2 register on T194, which isn't done by hda_tegra_init(), and thus, this register may be in reset state after resume from RPM suspend. It should be a bug in the HDA driver that needs to be fixed.

On older SoCs: HDA resides in the APB power domain which could be disabled only across system suspend/resume. HDA is only clock-gated during runtime PM suspend.

On newer SoCs: HDA power state could be lost after RPM suspend/resume, depending on the state of display. I'm wondering whether HDMI playback works after DPMS on T194+, I assume this case was never tested properly.

Quoted 8 lines

It looks like it should be safe to reset HDA on runtime PM resume regardless of the chip->running, and thus, we could remove that check and reset HDA unconditionally. Will great if you could check/test and improve this in the driver.

I'm also wondering whether snd_power_change_state() should be moved into RPM callbacks and whether this function does anything practically useful on Tegra at all.

This call is mostly for ALSA core stuff, and not necessarily reflecting the exact device power state. The major role is for controlling / blocking the device accesses at the system suspend/resume, so it's correct to set only in the system suspend/resume callbacks, not in runtime PM.

Takashi

#27 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

14.12.2021 17:29, Takashi Iwai пишет:

Quoted 9 lines
Quoted 3 lines

I'm also wondering whether snd_power_change_state() should be moved into RPM callbacks and whether this function does anything practically useful on Tegra at all.

This call is mostly for ALSA core stuff, and not necessarily reflecting the exact device power state. The major role is for controlling / blocking the device accesses at the system suspend/resume, so it's correct to set only in the system suspend/resume callbacks, not in runtime PM.

Thank you for the clarification.

#28 lore raw

Re: [PATCH 1/3] ALSA: hda/tegra: Skip reset on BPMP devices

In reply to Dmitry Osipenko
Quoted 8 lines · Dmitry Osipenko

14.12.2021 10:22, Sameer Pujar пишет:
...

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

How the reset behavior is different? At this point when HDA driver is loaded the HW is already reset during display ungate. What matters, during HDA driver load, is whether the HW is in predictable state or not and the answer is yes. So I am not sure what problem you are referring to. Question is, if BPMP already ensures this, then why driver needs to take care of it.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

1. Enable display
2. Play audio over HDMI
3. HDA hardware now is in dirty state

Why this would be a dirty state? It is rather a functional state. Isn't it? Power-domain is ON while all this happens.

In general state should be a functional, but we shouldn't assume that. There is always a possibility for a subtle bug in a driver that may put h/w into a bad state. Full hardware reset is encouraged by users.

OK. I will prepare a v2 by just skipping the invalid reset for Tegra194.

Quoted 19 lines
Quoted 5 lines

Another point is, with present logic the reset is not applied for every runtime PM resume of HDA device, which is confusing. It depends on the state of 'chip->running' flag and I don't see this getting cleared anywhere. Would you say subsequent HDA playback happen under a dirty state?

This is a good point. There should be another potential problem in the HDA driver for newer SoCs because apparently we don't re-initialize HDA controller properly after runtime PM resume.

See hda_tegra_first_init() that is invoked only during driver probe, it configures FPCI_DBG_CFG_2 register on T194, which isn't done by hda_tegra_init(), and thus, this register may be in reset state after resume from RPM suspend. It should be a bug in the HDA driver that needs to be fixed.

On older SoCs: HDA resides in the APB power domain which could be disabled only across system suspend/resume. HDA is only clock-gated during runtime PM suspend.

Quoted 8 lines

On newer SoCs: HDA power state could be lost after RPM suspend/resume, depending on the state of display. I'm wondering whether HDMI playback works after DPMS on T194+, I assume this case was never tested properly.

It looks like it should be safe to reset HDA on runtime PM resume regardless of the chip->running, and thus, we could remove that check and reset HDA unconditionally. Will great if you could check/test and improve this in the driver.

There seems to be multiple issues. I will work on this separately and send a separate series. Presently basic function is broken on Tegra194 and will first send v2 to fix the regression. Thanks for review.

#29 lore raw

PATCH 2/3 dt-bindings: sound: tegra: Update HDA resets

In reply to Sameer Pujar

Tegra194 HDA has only two resets unlike the previous generations of Tegra SoCs. Hence update the reset list accordingly.

Fixes 2d8f8955fe02 ("dt-bindings: tegra: Convert HDA doc to json-schema")
---
 .../devicetree/bindings/sound/nvidia,tegra30-hda.yaml       | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml +9 -4
index b55775e..70dbdff5 100644
@@ -50,13 +50,18 @@ properties:
       - const: hda2codec_2x
 
   resets:
+    minItems: 2
     maxItems: 3
 
   reset-names:
-    items:
-      - const: hda
-      - const: hda2hdmi
-      - const: hda2codec_2x
+    oneOf:
+      - items:
+          - const: hda
+          - const: hda2hdmi
+          - const: hda2codec_2x
+      - items:
+          - const: hda
+          - const: hda2hdmi
 
   power-domains:
     maxItems: 1
Signature · 1 line
2.7.4
Acked-by on v1 2/3
#30 lore raw

Re: [PATCH 2/3] dt-bindings: sound: tegra: Update HDA resets

Quoted 23 lines · Sameer Pujar

Tegra194 HDA has only two resets unlike the previous generations of Tegra SoCs. Hence update the reset list accordingly.

Fixes 2d8f8955fe02 ("dt-bindings: tegra: Convert HDA doc to json-schema")
---
 .../devicetree/bindings/sound/nvidia,tegra30-hda.yaml       | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml +1 -2
index b55775e..70dbdff5 100644
@@ -50,13 +50,18 @@ properties:
       - const: hda2codec_2x
 
   resets:
+    minItems: 2
     maxItems: 3
 
   reset-names:
-    items:
-      - const: hda

Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml properties: · line 64

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra30-hda.yaml +8 -2
-      - const: hda2hdmi
-      - const: hda2codec_2x
+    oneOf:
+      - items:
+          - const: hda
+          - const: hda2hdmi
+          - const: hda2codec_2x
+      - items:
+          - const: hda
+          - const: hda2hdmi

We could make this more specific using an if: conditional and match on nvidia,tegra194-hda, but this would work as well, especially since I presume that Tegra194's successors will also not have the hda2codec_2x reset.

#31 lore raw

Re: [PATCH 2/3] dt-bindings: sound: tegra: Update HDA resets

Quoted 4 lines · Thierry Reding

We could make this more specific using an if: conditional and match on nvidia,tegra194-hda, but this would work as well, especially since I presume that Tegra194's successors will also not have the hda2codec_2x reset.

Yes, reset hda2codec_2x is dropped from Tegra194 onward. So I believe this should be good enough.

#32 lore raw

Re: [PATCH 2/3] dt-bindings: sound: tegra: Update HDA resets

In reply to Sameer Pujar

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 4 lines

Tegra194 HDA has only two resets unlike the previous generations of Tegra SoCs. Hence update the reset list accordingly.

Fixes 2d8f8955fe02 ("dt-bindings: tegra: Convert HDA doc to json-schema")

The original txt binding was already wrong, this "fixes" tag is wrong.

#33 lore raw

Re: [PATCH 2/3] dt-bindings: sound: tegra: Update HDA resets

Quoted 6 lines · Dmitry Osipenko

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 4 lines

Tegra194 HDA has only two resets unlike the previous generations of Tegra SoCs. Hence update the reset list accordingly.

Fixes 2d8f8955fe02 ("dt-bindings: tegra: Convert HDA doc to json-schema")

The original txt binding was already wrong, this "fixes" tag is wrong.

The text didn't document "nvidia,tegra194-hda" compatibile support until the json-schema conversion happened. Perhaps the text doc was not updated when Tegra194 support was added. So wouldn't this be right to use json-schema commit as a base for this?

#34 lore raw

Re: [PATCH 2/3] dt-bindings: sound: tegra: Update HDA resets

07.12.2021 14:04, Sameer Pujar пишет:

Quoted 7 lines · Dmitry Osipenko
Quoted 4 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 3 lines

Tegra194 HDA has only two resets unlike the previous generations of Tegra SoCs. Hence update the reset list accordingly.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines
Fixes 2d8f8955fe02 ("dt-bindings: tegra: Convert HDA doc to

json-schema")

The original txt binding was already wrong, this "fixes" tag is wrong.

The text didn't document "nvidia,tegra194-hda" compatibile support until the json-schema conversion happened. Perhaps the text doc was not updated when Tegra194 support was added. So wouldn't this be right to use json-schema commit as a base for this?

This problem didn't exist when the binding was converted. Should be better to drop this tag since it doesn't add much value and creates confusion, IMO.

#35 lore raw

Re: [PATCH 2/3] dt-bindings: sound: tegra: Update HDA resets

Quoted 9 lines · Dmitry Osipenko

07.12.2021 14:04, Sameer Pujar пишет:

Quoted 8 lines · Dmitry Osipenko
Quoted 6 lines

07.12.2021 09:32, Sameer Pujar пишет:

Quoted 5 lines

Tegra194 HDA has only two resets unlike the previous generations of Tegra SoCs. Hence update the reset list accordingly.

Fixes 2d8f8955fe02 ("dt-bindings: tegra: Convert HDA doc to

json-schema")

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

The original txt binding was already wrong, this "fixes" tag is wrong.

The text didn't document "nvidia,tegra194-hda" compatibile support until the json-schema conversion happened. Perhaps the text doc was not updated when Tegra194 support was added. So wouldn't this be right to use json-schema commit as a base for this?

This problem didn't exist when the binding was converted. Should be better to drop this tag since it doesn't add much value and creates confusion, IMO.

It is true that the problem was introduced recently, but from the documentation point of view, given the HW never had this reset it should not have been included in the first place. If it is not useful, I can just drop this tag.

#36 lore raw

PATCH 3/3 arm64: tegra: Remove non existent Tegra194 reset

In reply to Sameer Pujar

Tegra194 does not really have "hda2codec_2x" related reset. Hence drop this entry to reflect actual HW.

Fixes 4878cc0c9fab ("arm64: tegra: Add HDA controller on Tegra194")
---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +2 -3
index 8d29b7f..6a1d896 100644
@@ -976,9 +976,8 @@
 				 <&bpmp TEGRA194_CLK_HDA2CODEC_2X>;
 			clock-names = "hda", "hda2hdmi", "hda2codec_2x";
 			resets = <&bpmp TEGRA194_RESET_HDA>,
-				 <&bpmp TEGRA194_RESET_HDA2HDMICODEC>,
-				 <&bpmp TEGRA194_RESET_HDA2CODEC_2X>;
-			reset-names = "hda", "hda2hdmi", "hda2codec_2x";
+				 <&bpmp TEGRA194_RESET_HDA2HDMICODEC>;
+			reset-names = "hda", "hda2hdmi";
 			power-domains = <&bpmp TEGRA194_POWER_DOMAIN_DISP>;
 			interconnects = <&mc TEGRA194_MEMORY_CLIENT_HDAR &emc>,
 					<&mc TEGRA194_MEMORY_CLIENT_HDAW &emc>;
Signature · 1 line
2.7.4
Reviewed-by on the v1 series
#37 lore raw
In reply to Sameer Pujar
Quoted 9 lines · Sameer Pujar

HDA probe failure is observed on Tegra194 based platforms and this happens due to a reset failure. The series fixes this problem by avoiding explicit resets on BPMP based devices.

Sameer Pujar (3):
ALSA: hda/tegra: Skip reset on BPMP devices
dt-bindings: sound: tegra: Update HDA resets
arm64: tegra: Remove non existent Tegra194 reset

The change in HDA drier looks fine, and the question how to take those patches. If other people can give acks, I can take those to sound.git tree destined for 5.16.

Or, if anyone else prefers taking those, feel free to do: for the first patch,

thanks,

Takashi

#38 lore raw
Quoted 12 lines · Takashi Iwai
Quoted 9 lines · Sameer Pujar

HDA probe failure is observed on Tegra194 based platforms and this happens due to a reset failure. The series fixes this problem by avoiding explicit resets on BPMP based devices.

Sameer Pujar (3):
ALSA: hda/tegra: Skip reset on BPMP devices
dt-bindings: sound: tegra: Update HDA resets
arm64: tegra: Remove non existent Tegra194 reset

Quoted 8 lines

The change in HDA drier looks fine, and the question how to take those patches. If other people can give acks, I can take those to sound.git tree destined for 5.16.

Or, if anyone else prefers taking those, feel free to do: for the first patch,

My understanding is that patches 1-2 are mostly independent of patch 3, with the latter being mostly a complementary cleanup. Patch 1 will effectively ignore the non-existent reset on Tegra194 anyway. Patch 1 (and potentially 2) could go into v5.16 to fix the regression via sound.git, but the cleanup in patch 3 isn't time-critical, so I could just queue that up for v5.17 via the Tegra tree.

Sameer, any objections to that? Did I miss anything?

Thierry

#39 lore raw
Quoted 19 lines · Thierry Reding
Quoted 10 lines · Takashi Iwai
Quoted 8 lines · Sameer Pujar

HDA probe failure is observed on Tegra194 based platforms and this happens due to a reset failure. The series fixes this problem by avoiding explicit resets on BPMP based devices.

Sameer Pujar (3):
ALSA: hda/tegra: Skip reset on BPMP devices
dt-bindings: sound: tegra: Update HDA resets
arm64: tegra: Remove non existent Tegra194 reset

Quoted 8 lines

The change in HDA drier looks fine, and the question how to take those patches. If other people can give acks, I can take those to sound.git tree destined for 5.16.

Or, if anyone else prefers taking those, feel free to do: for the first patch,

Quoted 8 lines

My understanding is that patches 1-2 are mostly independent of patch 3, with the latter being mostly a complementary cleanup. Patch 1 will effectively ignore the non-existent reset on Tegra194 anyway. Patch 1 (and potentially 2) could go into v5.16 to fix the regression via sound.git, but the cleanup in patch 3 isn't time-critical, so I could just queue that up for v5.17 via the Tegra tree.

Sameer, any objections to that? Did I miss anything?

Yes, Patch 1 is critical to fix the regression. Remaining patches are for cleanup. So above plan sounds good to me.