ALSA: hda: Enable sync-write operation as default for all controllers
Subsystems (2)
PATCH 1/1 ALSA: hda: Enable sync-write operation as default for all controllers
In the end we already enabled the sync-write mode for most of HD-audio controllers including Intel, and it's no big merit to keep the async write mode for the rest. Let's make it as default and drop the superfluous AZX_DCAPS_SYNC_WRITE bit flag.
Also, avoid to set the allow_bus_reset flag, which is a quite unstable and hackish behavior that was needed only for some early platforms (decades ago). The straight fallback to the single cmd mode is more robust.
--- sound/pci/hda/hda_controller.c | 11 ++--------- sound/pci/hda/hda_controller.h | 2 +- sound/pci/hda/hda_intel.c | 16 +++++++--------- 3 files changed, 10 insertions(+), 19 deletions(-)
sound/pci/hda/hda_controller.c +2 -9
@@ -1202,15 +1202,8 @@ int azx_bus_init(struct azx *chip, const char *model)if (chip->driver_caps &AZX_DCAPS_4K_BDLE_BOUNDARY ) bus->core.align_bdle_4k = true; -/* AMD chipsets often cause the communication stalls upon certain -* sequence like the pin-detection. It seems that forcing the synced -* access works around the stall. Grrr... -*/ -if (chip->driver_caps &AZX_DCAPS_SYNC_WRITE ) { -dev_dbg (chip->card->dev,"Enable sync_write for stable communication\n" ); - bus->core.sync_write =1 ; - bus->allow_bus_reset =1 ; - } +/* enable sync_write flag for stable communication as default */ + bus->core.sync_write =1 ;return 0 ; }
sound/pci/hda/hda_controller.h +1 -1
@@ -33,7 +33,7 @@#define AZX_DCAPS_POSFIX_LPIB (1 << 16)/* Use LPIB as default */ #define AZX_DCAPS_AMD_WORKAROUND (1 << 17)/* AMD-specific workaround */ #define AZX_DCAPS_NO_64BIT (1 << 18)/* No 64bit address */ -#define AZX_DCAPS_SYNC_WRITE (1 << 19)/* sync each cmd write */ +/* 19 unused */ #define AZX_DCAPS_OLD_SSYNC (1 << 20)/* Old SSYNC reg for ICH */ #define AZX_DCAPS_NO_ALIGN_BUFSIZE (1 << 21)/* no buffer size alignment */ /* 22 unused */
sound/pci/hda/hda_intel.c +7 -9
@@ -283,13 +283,12 @@ enum {/* quirks for old Intel chipsets */ #define AZX_DCAPS_INTEL_ICH \ - (AZX_DCAPS_OLD_SSYNC | AZX_DCAPS_NO_ALIGN_BUFSIZE |\ - AZX_DCAPS_SYNC_WRITE) + (AZX_DCAPS_OLD_SSYNC | AZX_DCAPS_NO_ALIGN_BUFSIZE)/* quirks for Intel PCH */ #define AZX_DCAPS_INTEL_PCH_BASE \ (AZX_DCAPS_NO_ALIGN_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY |\ - AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE) + AZX_DCAPS_SNOOP_TYPE(SCH))/* PCH up to IVB; no runtime PM; bind with i915 gfx */ #define AZX_DCAPS_INTEL_PCH_NOPM \
@@ -304,13 +303,13 @@ enum { #define AZX_DCAPS_INTEL_HASWELL \ (/*AZX_DCAPS_ALIGN_BUFSIZE |*/ AZX_DCAPS_COUNT_LPIB_DELAY |\ AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_COMPONENT |\ - AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE) + AZX_DCAPS_SNOOP_TYPE(SCH))/* Broadwell HDMI can't use position buffer reliably, force to use LPIB */ #define AZX_DCAPS_INTEL_BROADWELL \ (/*AZX_DCAPS_ALIGN_BUFSIZE |*/ AZX_DCAPS_POSFIX_LPIB |\ AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_COMPONENT |\ - AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE) + AZX_DCAPS_SNOOP_TYPE(SCH))#define AZX_DCAPS_INTEL_BAYTRAIL \ (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_I915_COMPONENT)
@@ -321,19 +320,18 @@ enum {#define AZX_DCAPS_INTEL_SKYLAKE \ (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_PM_RUNTIME |\ - AZX_DCAPS_SYNC_WRITE |\ AZX_DCAPS_SEPARATE_STREAM_TAG | AZX_DCAPS_I915_COMPONENT)#define AZX_DCAPS_INTEL_BROXTON AZX_DCAPS_INTEL_SKYLAKE/* quirks for ATI SB / AMD Hudson */ #define AZX_DCAPS_PRESET_ATI_SB \ - (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_SYNC_WRITE | AZX_DCAPS_POSFIX_LPIB |\ + (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_POSFIX_LPIB |\ AZX_DCAPS_SNOOP_TYPE(ATI))/* quirks for ATI/AMD HDMI */ #define AZX_DCAPS_PRESET_ATI_HDMI \ - (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_SYNC_WRITE | AZX_DCAPS_POSFIX_LPIB|\ + (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_POSFIX_LPIB|\ AZX_DCAPS_NO_MSI64)/* quirks for ATI HDMI with snoop off */
@@ -342,7 +340,7 @@ enum {/* quirks for AMD SB */ #define AZX_DCAPS_PRESET_AMD_SB \ - (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_SYNC_WRITE | AZX_DCAPS_AMD_WORKAROUND |\ + (AZX_DCAPS_NO_TCSEL | AZX_DCAPS_AMD_WORKAROUND |\ AZX_DCAPS_SNOOP_TYPE(ATI) | AZX_DCAPS_PM_RUNTIME)/* quirks for Nvidia */
Signature · 1 line
2.25.0
Jon Hunter
maintainerHi Takashi,
Quoted 11 lines · Takashi Iwai
In the end we already enabled the sync-write mode for most of HD-audio controllers including Intel, and it's no big merit to keep the async write mode for the rest. Let's make it as default and drop the superfluous
AZX_DCAPS_SYNC_WRITEbit flag.Also, avoid to set the
allow_bus_resetflag, which is a quite unstable and hackish behavior that was needed only for some early platforms (decades ago). The straight fallback to the single cmd mode is more robust.Signed-off-by Takashi Iwai <[email protected]>
I have noticed a regression in HDA playback on our Tegra186 Jetson TX2 platform. Bisect is pointing to this patch and reverting this does appear to fix it. Interestingly, I am not seeing any problems on other Tegra platforms, however, Tegra186 does have the IOMMU enabled for HDA which is one different between the other platforms.
We can take a closer look at this for Tegra, but I am wondering if we revert this for Tegra for now.
Cheers
Jon
Signature · 1 line
nvpublic
Jon Hunter
maintainerQuoted 16 lines · Jon Hunter
Hi Takashi,
Quoted 11 lines · Takashi Iwai
In the end we already enabled the sync-write mode for most of HD-audio controllers including Intel, and it's no big merit to keep the async write mode for the rest. Let's make it as default and drop the superfluous
AZX_DCAPS_SYNC_WRITEbit flag.Also, avoid to set the
allow_bus_resetflag, which is a quite unstable and hackish behavior that was needed only for some early platforms (decades ago). The straight fallback to the single cmd mode is more robust.Signed-off-by Takashi Iwai <[email protected]>
Quoted 8 lines
I have noticed a regression in HDA playback on our Tegra186 Jetson TX2 platform. Bisect is pointing to this patch and reverting this does appear to fix it. Interestingly, I am not seeing any problems on other Tegra platforms, however, Tegra186 does have the IOMMU enabled for HDA which is one different between the other platforms.
We can take a closer look at this for Tegra, but I am wondering if we revert this for Tegra for now.
By revert, I don't mean revert the entire change, but just disable the sync-write for Tegra for now.
Jon
Signature · 1 line
nvpublic
Quoted 17 lines · Jon Hunter
Hi Takashi,
Quoted 11 lines · Takashi Iwai
In the end we already enabled the sync-write mode for most of HD-audio controllers including Intel, and it's no big merit to keep the async write mode for the rest. Let's make it as default and drop the superfluous
AZX_DCAPS_SYNC_WRITEbit flag.Also, avoid to set the
allow_bus_resetflag, which is a quite unstable and hackish behavior that was needed only for some early platforms (decades ago). The straight fallback to the single cmd mode is more robust.Signed-off-by Takashi Iwai <[email protected]>
Quoted 8 lines
I have noticed a regression in HDA playback on our Tegra186 Jetson TX2 platform. Bisect is pointing to this patch and reverting this does appear to fix it. Interestingly, I am not seeing any problems on other Tegra platforms, however, Tegra186 does have the IOMMU enabled for HDA which is one different between the other platforms.
We can take a closer look at this for Tegra, but I am wondering if we revert this for Tegra for now.
It's a deja vu, we (or someone else in Nvidia?) discussed it in the past?
The patch below should cure the problem temporarily, as it sets the polling mode as default for Tegra. But it'd be appreciated if you can find the root cause.
thanks,
Takashi
sound/pci/hda/hda_tegra.c +1 -0
@@ -394,6 +394,7 @@ static int hda_tegra_create(struct snd_card *card,if (err <0 )return err; + chip->bus.core.polling =1 ; chip->bus.core.needs_damn_long_delay =1 ; err =snd_device_new (card,SNDRV_DEV_LOWLEVEL , chip, &ops);
Jon Hunter
maintainerQuoted 44 lines · Takashi Iwai
Quoted 17 lines · Jon Hunter
Hi Takashi,
Quoted 11 lines · Takashi Iwai
In the end we already enabled the sync-write mode for most of HD-audio controllers including Intel, and it's no big merit to keep the async write mode for the rest. Let's make it as default and drop the superfluous
AZX_DCAPS_SYNC_WRITEbit flag.Also, avoid to set the
allow_bus_resetflag, which is a quite unstable and hackish behavior that was needed only for some early platforms (decades ago). The straight fallback to the single cmd mode is more robust.Signed-off-by Takashi Iwai <[email protected]>Quoted 8 lines
I have noticed a regression in HDA playback on our Tegra186 Jetson TX2 platform. Bisect is pointing to this patch and reverting this does appear to fix it. Interestingly, I am not seeing any problems on other Tegra platforms, however, Tegra186 does have the IOMMU enabled for HDA which is one different between the other platforms.
We can take a closer look at this for Tegra, but I am wondering if we revert this for Tegra for now.
It's a deja vu, we (or someone else in Nvidia?) discussed it in the past?
The patch below should cure the problem temporarily, as it sets the polling mode as default for Tegra. But it'd be appreciated if you can find the root cause.
thanks,
Takashi
sound/pci/hda/hda_tegra.c static int hda_tegra_create(struct snd_card *card, · line 400
Quoted 7 lines
sound/pci/hda/hda_tegra.c +1
-0@@ -394,6 +394,7 @@ static int hda_tegra_create(struct snd_card *card,if (err <0 )return err; + chip->bus.core.polling =1 ; chip->bus.core.needs_damn_long_delay =1 ; err =snd_device_new (card,SNDRV_DEV_LOWLEVEL , chip, &ops);
Did you mean ...
sound/pci/hda/hda_tegra.c +1 -0
@@ -443,6 +443,7 @@ static int hda_tegra_create(struct snd_card *card,if (err <0 )return err; + chip->bus.core.sync_write =0 ; chip->bus.core.needs_damn_long_delay =1 ; chip->bus.core.aligned_mmio =1 ;
The above works for me.
Cheers
Jon
Signature · 1 line
nvpublic
Quoted 69 lines · Jon Hunter
Quoted 44 lines · Takashi Iwai
Quoted 17 lines · Jon Hunter
Hi Takashi,
Quoted 11 lines · Takashi Iwai
In the end we already enabled the sync-write mode for most of HD-audio controllers including Intel, and it's no big merit to keep the async write mode for the rest. Let's make it as default and drop the superfluous
AZX_DCAPS_SYNC_WRITEbit flag.Also, avoid to set the
allow_bus_resetflag, which is a quite unstable and hackish behavior that was needed only for some early platforms (decades ago). The straight fallback to the single cmd mode is more robust.Signed-off-by Takashi Iwai <[email protected]>Quoted 8 lines
I have noticed a regression in HDA playback on our Tegra186 Jetson TX2 platform. Bisect is pointing to this patch and reverting this does appear to fix it. Interestingly, I am not seeing any problems on other Tegra platforms, however, Tegra186 does have the IOMMU enabled for HDA which is one different between the other platforms.
We can take a closer look at this for Tegra, but I am wondering if we revert this for Tegra for now.
It's a deja vu, we (or someone else in Nvidia?) discussed it in the past?
The patch below should cure the problem temporarily, as it sets the polling mode as default for Tegra. But it'd be appreciated if you can find the root cause.
thanks,
Takashi
sound/pci/hda/hda_tegra.c static int hda_tegra_create(struct snd_card *card, · line 400
Quoted 7 lines
sound/pci/hda/hda_tegra.c +1
-0@@ -394,6 +394,7 @@ static int hda_tegra_create(struct snd_card *card,if (err <0 )return err; + chip->bus.core.polling =1 ; chip->bus.core.needs_damn_long_delay =1 ; err =snd_device_new (card,SNDRV_DEV_LOWLEVEL , chip, &ops);Did you mean ...
sound/pci/hda/hda_tegra.c +1
-0@@ -443,6 +443,7 @@ static int hda_tegra_create(struct snd_card *card,if (err <0 )return err; + chip->bus.core.sync_write =0 ; chip->bus.core.needs_damn_long_delay =1 ; chip->bus.core.aligned_mmio =1 ;
Quoted 1 line
The above works for me.
Yeah, sorry, that was a wrong patch :)
I'm fine for applying it with some more comments.
Care to submit a proper patch?
thanks,
Takashi
Jon Hunter
maintainerOn 14/07/2020 10:12, Takashi Iwai wrote:
...
Quoted 14 lines
Quoted 14 lines
Did you mean ...
sound/pci/hda/hda_tegra.c +1
-0@@ -443,6 +443,7 @@ static int hda_tegra_create(struct snd_card *card,if (err <0 )return err; + chip->bus.core.sync_write =0 ; chip->bus.core.needs_damn_long_delay =1 ; chip->bus.core.aligned_mmio =1 ;
Quoted 6 lines
Quoted 1 line
The above works for me.
Yeah, sorry, that was a wrong patch :)
I'm fine for applying it with some more comments.Care to submit a proper patch?
No problem. I will submit a patch.
Jon
Signature · 1 line
nvpublic