Skip to content

[RFC] [DO NOT MERGE] mutual exclusion w/ legacy/Atom/SKL drivers - #927

Closed
plbossart wants to merge 8 commits into
thesofproject:topic/sof-next-rebasefrom
plbossart:fix/driver-exclusion
Closed

plbossart wants to merge 8 commits into
thesofproject:topic/sof-next-rebasefrom
plbossart:fix/driver-exclusion

Conversation

@plbossart

Copy link
Copy Markdown
Member

This is a second attempt to suggestion a solution for distributions who don't know which driver to pick and don't want to deal with blacklists.

Baytrail/Cherrytrail: build-time selection between SOF, Atom/SST and legacy
Broadwell: build-time selection between SOF and legacy
SKL/KBL: SST driver only
APL/GLK: build or run-time selection between SOF and SST
WHL/CML: build-time selection (we can do better e.g. by adding more rules such as presence of DMIC+HDAudio, Chrome DMI, etc).
ICL: SOF only

The detection between SOF and legacy is not handled for now, it'll be a separate topic.

Comments and feedback welcome. I haven't tested on a GLK chromebook but the Up2 quirk works fine with the Skylake driver bailing to let SOF probe.

 [   4.253977] snd_soc_skl 0000:00:0e.0: ApolloLake platform is not supported by SST driver, aborting probe
[    4.268338] sof-audio-pci 0000:00:0e.0: warning: No matching ASoC machine driver found
[    4.268357] sof-audio-pci 0000:00:0e.0: DSP detected with PCI class/subclass/prog-if 0x040100
[    4.268558] sof-audio-pci 0000:00:0e.0: use msi interrupt mode
[    4.271321] sof-audio-pci 0000:00:0e.0: bound 0000:00:02.0 (ops 0xffffffff852a2140)
[    4.279095] sof-audio-pci 0000:00:0e.0: hda codecs found, mask 4
[    4.279099] sof-audio-pci 0000:00:0e.0: using HDA machine driver skl_hda_dsp_generic now
[    4.320122] sof-audio-pci 0000:00:0e.0: Firmware info: version 1:1:0-4d715
[    4.320125] sof-audio-pci 0000:00:0e.0: Firmware: ABI 3:1:0 Kernel ABI 3:4:0
[    4.320253] sof-audio-pci 0000:00:0e.0: firmware boot complete

@cujomalainey

Copy link
Copy Markdown

Tried it out on a GLK chromebook, skylake driver seemed to fail due to a missing firmware file and SOF never even attempted to probe after the failure.

@plbossart

plbossart commented May 11, 2019 via email

Copy link
Copy Markdown
Member Author

@cujomalainey

Copy link
Copy Markdown

I'll see what I can do Monday.

@plbossart

Copy link
Copy Markdown
Member Author

Works for me :-)

[    2.124586] snd_soc_skl 0000:00:0e.0: DSP detected with PCI class/subclass/prog-if info 0x040100
[    2.124591] snd_soc_skl 0000:00:0e.0: GeminiLake platform is not supported by SST driver, aborting probe
[    2.163166] sof-audio-pci 0000:00:0e.0: PCI DSP detected
[    2.163529] sof-audio-pci 0000:00:0e.0: DSP detected with PCI class/subclass/prog-if 0x040100

Did you set the mutual exclusion Kconfigs needed for this PR to do anything different?

CONFIG_SND_SOC_SOF_INTEL_DRIVER_SELECTION=y
CONFIG_SND_SOC_SOF_INTEL_DISABLE_LEGACY_BAYTRAIL=y
CONFIG_SND_SOC_SOF_INTEL_DISABLE_LEGACY_BROADWELL=y
CONFIG_SND_SOC_SOF_INTEL_DISABLE_ATOM_SST_BAYTRAIL=y
CONFIG_SND_SOC_SOF_INTEL_DISABLE_ATOM_SST_MERRIFIELD=y
CONFIG_SND_SOC_SOF_INTEL_RUNTIME_DISABLE_SKL_SST_DRIVER=y

sof-dev-defconfig.txt

@cujomalainey

Copy link
Copy Markdown

Yep I must have missed those in the menuconfig, worked once I added those manually to the config file.

@plbossart

Copy link
Copy Markdown
Member Author

Yep I must have missed those in the menuconfig, worked once I added those manually to the config file.

thanks for testing. I realized that the code for SOF needs to be changed to work by design instead of by accident, the tests are done in a work queue and not directly in the probe so the mechanism would not work well if SOF was probed first (it's not because of alphabetical order in the Makefile ...).

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through all the patches and code seems good. Only a few minor comments to check. I haven't yet tested on any hw.

Comment thread sound/soc/sof/intel/Kconfig Resolved
Comment thread sound/soc/sof/intel/Kconfig Resolved
@plbossart
plbossart force-pushed the topic/sof-next-rebase branch from 5c793e4 to 3a18de7 Compare May 24, 2019 19:37
plbossart added 5 commits May 24, 2019 14:38
Revert before adding better solution

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add opt-in config to prefer SOF over deprecated Baytrail legacy (only
used on Chromebooks).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add opt-in config to prefer SOF over deprecated Broadwell legacy (only
used on Pixel 2015 Chromebooks and on Dell XPS when the DSP is
enabled).

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Add opt-in config to prefer SOF over Atom/SST driver used on
Merrifield and Baytrail/CherryTrail/Braswell

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
CNL, CFL and CML platforms have known driver/topology issues with
HDaudio codecs and digital microphone support reported since September
2018 [1]

Since there is no line of sight for any fix, and as platforms with
digital microphones+Hdaudio become common, distributions should only
select CNL, CFL and CML support with the Skylake/SST driver if they
have a good reason to do so, and only when HDaudio codecs and DMICs
are not in-scope, but these options are not recommended. The SOF
driver will support such platforms and should be selected instead.

Instead of using the default selector for all platforms, select only
legacy platforms for backwards compatibility, and make CNL/CFL/CML
opt-in only.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=201251

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
plbossart force-pushed the fix/driver-exclusion branch from d3026ca to 0f42411 Compare May 24, 2019 20:03
@plbossart
plbossart requested a review from kv2019i May 24, 2019 20:03
@plbossart

Copy link
Copy Markdown
Member Author

@lgirdwood can you take a look?

plbossart added 3 commits May 24, 2019 15:38
The DSP detection for Intel cAVS platforms is part of the HDaudio
probe, which can be called from a workqueue. This is broken, we can't
report any error status from a workqueue. Move the code to the PCI
probe so that the probe is aborted immediately.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
…ST driver

Add opt-in configs to prefer SOF over Skylake/SST driver. This option
has no effect on Skylake and Kabylake platforms.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
… driver on APL/GLK

On commercially available APL/GLK platforms, SOF is only available on
the APL UpSquared boards and on GLK Chromebooks. Other platforms can
be supported but require a special firmware not available outside of
Intel/Google.

Add quirks and bail when SOF/SST drivers detect a quirk they don't
support.

This option should not be used when early audio and short probe times
are needed. A build-time option is a better solution. The runtime
detection is more for generic distros who don't want to generate
separate images for various hardware.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
plbossart force-pushed the fix/driver-exclusion branch from 0f42411 to 8c3d7dd Compare May 24, 2019 20:39

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@plbossart plbossart closed this Jun 11, 2019
@kv2019i

kv2019i commented Jun 13, 2019

Copy link
Copy Markdown
Collaborator

@plbossart What happened to this, queued to upstream?

@plbossart

Copy link
Copy Markdown
Member Author

No I will have to redo it after the Summer break. The code needs more work for the detection of DMICs, which I prototyped but need to check the information I was relying on is public.

fengguang pushed a commit to 0day-ci/linux that referenced this pull request Oct 2, 2019
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems like proposed in the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
fengguang pushed a commit to 0day-ci/linux that referenced this pull request Oct 2, 2019
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems like proposed in the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
plbossart pushed a commit to plbossart/sound that referenced this pull request Oct 8, 2019
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
plbossart pushed a commit to plbossart/sound that referenced this pull request Oct 9, 2019
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
tiwai pushed a commit to tiwai/sound that referenced this pull request Oct 23, 2019
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
perexg added a commit to perexg/linux that referenced this pull request Nov 22, 2019
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
(cherry picked from commit 82d9d54)
Bugzilla: 1750194
perexg added a commit to perexg/linux that referenced this pull request Nov 26, 2019
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
(cherry picked from commit 82d9d54)
Bugzilla: 1772498
joelagnel pushed a commit to joelagnel/linux-kernel that referenced this pull request Feb 28, 2020
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject/linux#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 82d9d54)
Signed-off-by: Chintan Patel <chintan.m.patel@intel.com>

BUG=b:147436144
TEST=Audio playback via Speaker, Headphone and HDMI/DP

Change-Id: I086099861e639a41b369afa6bb2c02515da15d2f
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2029713
Reviewed-by: Sean Paul <seanpaul@chromium.org>
jackpot51 pushed a commit to pop-os/linux that referenced this pull request Apr 13, 2020
BugLink: https://bugs.launchpad.net/bugs/1871284

For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
(cherry picked from commit 82d9d54)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fkjbvfdvbnfdkjvbjfhd pushed a commit to halcyonlv/kernel_samsung_s5e8825 that referenced this pull request May 18, 2026
For distributions, we need one place where we can decide
which driver will be activated for the auto-configation of the
Intel's HDA hardware with DSP. Actually, we cover three drivers:

* Legacy HDA
* Intel SST
* Intel Sound Open Firmware (SOF)

All those drivers registers similar PCI IDs, so the first
driver probed from the PCI stack can win. But... it is not
guaranteed that the correct driver wins.

This commit changes Intel's NHLT ACPI module to a common
DSP probe module for the Intel's hardware. All above sound
drivers calls this code. The user can force another behaviour
using the module parameter 'dsp_driver' located in
the 'snd-intel-dspcfg' module.

This change allows to add specific dmi checks for the specific
systems. The examples are taken from the pull request:

  thesofproject/linux#927

Tested on Lenovo Carbon X1 7th gen.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191022174313.29087-1-perex@perex.cz
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants