Skip to content

HDaudio probe: need to introduce workqueue to avoid deadlocks. #560

@plbossart

Description

@plbossart

Timing issues reported on Skylake expose a conceptual issue in the way the HDaudio probe is handled.

Currently the probe flow is

hda_dsp_probe
-- hda_init_caps
---- hda_codec_i915_init
------ snd_hdac_i915_init
-------- request_module("i915");
---- hda_codec_probe_bus
------ hda_codec_probe
-------- request_module("Hdaudio xyz")

As explained by Takashi Iwai on the alsa-devel mailing list:

you shouldn't call request_module() in the driver's probe
callback.  When the probe callback is called from the module loading,
it blocks the module loading itself, hence loading yet another module
can't work.  A situation might be easier than the past (which
deadlocked), but still it's advised to use either the
request_module_nowait() with the callback or call request_module()
asynchronously from probe.

The request is to move init_caps to a work queue, and cancel it on remove.

Note that this will impact how hardware initialization issues are handled. We already know that errors on driver_probe happening when platform_device_register_data() is called will not be propagated, and the probe might actually be executed later. with a workqueue errors will be even harder to be made available to higher level PCI drivers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APLApplies to ApolloLake platformCMLApplies to Comet Lake platformCNLApplies to CannonlakeGLKApplies to Gemini LakeICLApplies to Icelake platformP1Blocker bugs or important featuresupstream blockerMandatory for upstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions