diff options
author | Yu Zhao <yuzhao@google.com> | 2018-09-11 17:15:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-12 06:22:09 -0400 |
commit | 75383f8d39d4c0fb96083dd460b7b139fbdac492 (patch) | |
tree | a67f7449b24e98e50d395fa79f65f9884d6169d5 /sound | |
parent | b61749a89f826eb61fc59794d9e4697bd246eb61 (diff) |
sound: don't call skl_init_chip() to reset intel skl soc
Internally, skl_init_chip() calls snd_hdac_bus_init_chip() which
1) sets bus->chip_init to prevent multiple entrances before device
is stopped; 2) enables interrupt.
We shouldn't use it for the purpose of resetting device only because
1) when we really want to initialize device, we won't be able to do
so; 2) we are ready to handle interrupt yet, and kernel crashes when
interrupt comes in.
Rename azx_reset() to snd_hdac_bus_reset_link(), and use it to reset
device properly.
Fixes: 60767abcea3d ("ASoC: Intel: Skylake: Reset the controller in probe")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/hda/hdac_controller.c | 7 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index 11057d9f84ec..74244d8e2909 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c | |||
@@ -385,7 +385,7 @@ void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus) | |||
385 | EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset); | 385 | EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset); |
386 | 386 | ||
387 | /* reset codec link */ | 387 | /* reset codec link */ |
388 | static int azx_reset(struct hdac_bus *bus, bool full_reset) | 388 | int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset) |
389 | { | 389 | { |
390 | if (!full_reset) | 390 | if (!full_reset) |
391 | goto skip_reset; | 391 | goto skip_reset; |
@@ -410,7 +410,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset) | |||
410 | skip_reset: | 410 | skip_reset: |
411 | /* check to see if controller is ready */ | 411 | /* check to see if controller is ready */ |
412 | if (!snd_hdac_chip_readb(bus, GCTL)) { | 412 | if (!snd_hdac_chip_readb(bus, GCTL)) { |
413 | dev_dbg(bus->dev, "azx_reset: controller not ready!\n"); | 413 | dev_dbg(bus->dev, "controller not ready!\n"); |
414 | return -EBUSY; | 414 | return -EBUSY; |
415 | } | 415 | } |
416 | 416 | ||
@@ -425,6 +425,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset) | |||
425 | 425 | ||
426 | return 0; | 426 | return 0; |
427 | } | 427 | } |
428 | EXPORT_SYMBOL_GPL(snd_hdac_bus_reset_link); | ||
428 | 429 | ||
429 | /* enable interrupts */ | 430 | /* enable interrupts */ |
430 | static void azx_int_enable(struct hdac_bus *bus) | 431 | static void azx_int_enable(struct hdac_bus *bus) |
@@ -479,7 +480,7 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset) | |||
479 | return false; | 480 | return false; |
480 | 481 | ||
481 | /* reset controller */ | 482 | /* reset controller */ |
482 | azx_reset(bus, full_reset); | 483 | snd_hdac_bus_reset_link(bus, full_reset); |
483 | 484 | ||
484 | /* clear interrupts */ | 485 | /* clear interrupts */ |
485 | azx_int_clear(bus); | 486 | azx_int_clear(bus); |
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index dce649485649..1d17be0f78a0 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -834,7 +834,7 @@ static int skl_first_init(struct hdac_bus *bus) | |||
834 | return -ENXIO; | 834 | return -ENXIO; |
835 | } | 835 | } |
836 | 836 | ||
837 | skl_init_chip(bus, true); | 837 | snd_hdac_bus_reset_link(bus, true); |
838 | 838 | ||
839 | snd_hdac_bus_parse_capabilities(bus); | 839 | snd_hdac_bus_parse_capabilities(bus); |
840 | 840 | ||