diff options
author | David Henningsson <david.henningsson@canonical.com> | 2015-09-03 05:51:35 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-09-03 06:14:45 -0400 |
commit | d5f362a7b977bdfaf8a955f3d604a29267bd5464 (patch) | |
tree | cd170f8c4f665d140935a713292f11ddabbed321 | |
parent | f0675d4a8ed9d3e863ff611561ee0944969a2784 (diff) |
drm/i915: Add locks around audio component bind/unbind
This will make sure that audio callbacks do not race with
component bind/unbind.
[Note: this is an update patch to commit [51e1d83cab99: drm/i915: Call
audio pin/ELD notify function] where I mistakenly applied the older
version. Jani and Daniel's review tags were to the latest version,
so I add them below, too -- tiwai]
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | drivers/gpu/drm/i915/intel_audio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c index 2d52d96b5493..678a34f87c1c 100644 --- a/drivers/gpu/drm/i915/intel_audio.c +++ b/drivers/gpu/drm/i915/intel_audio.c | |||
@@ -543,9 +543,11 @@ static int i915_audio_component_bind(struct device *i915_dev, | |||
543 | if (WARN_ON(acomp->ops || acomp->dev)) | 543 | if (WARN_ON(acomp->ops || acomp->dev)) |
544 | return -EEXIST; | 544 | return -EEXIST; |
545 | 545 | ||
546 | drm_modeset_lock_all(dev_priv->dev); | ||
546 | acomp->ops = &i915_audio_component_ops; | 547 | acomp->ops = &i915_audio_component_ops; |
547 | acomp->dev = i915_dev; | 548 | acomp->dev = i915_dev; |
548 | dev_priv->audio_component = acomp; | 549 | dev_priv->audio_component = acomp; |
550 | drm_modeset_unlock_all(dev_priv->dev); | ||
549 | 551 | ||
550 | return 0; | 552 | return 0; |
551 | } | 553 | } |
@@ -556,9 +558,11 @@ static void i915_audio_component_unbind(struct device *i915_dev, | |||
556 | struct i915_audio_component *acomp = data; | 558 | struct i915_audio_component *acomp = data; |
557 | struct drm_i915_private *dev_priv = dev_to_i915(i915_dev); | 559 | struct drm_i915_private *dev_priv = dev_to_i915(i915_dev); |
558 | 560 | ||
561 | drm_modeset_lock_all(dev_priv->dev); | ||
559 | acomp->ops = NULL; | 562 | acomp->ops = NULL; |
560 | acomp->dev = NULL; | 563 | acomp->dev = NULL; |
561 | dev_priv->audio_component = NULL; | 564 | dev_priv->audio_component = NULL; |
565 | drm_modeset_unlock_all(dev_priv->dev); | ||
562 | } | 566 | } |
563 | 567 | ||
564 | static const struct component_ops i915_audio_component_bind_ops = { | 568 | static const struct component_ops i915_audio_component_bind_ops = { |