Commit 75383f8d authored by Yu Zhao's avatar Yu Zhao Committed by Mark Brown

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: 60767abc ("ASoC: Intel: Skylake: Reset the controller in probe")
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarYu Zhao <yuzhao@google.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent b61749a8
...@@ -384,6 +384,7 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus); ...@@ -384,6 +384,7 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus);
void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus); void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus);
void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus); void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus);
void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus); void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus);
int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset);
void snd_hdac_bus_update_rirb(struct hdac_bus *bus); void snd_hdac_bus_update_rirb(struct hdac_bus *bus);
int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status, int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,
......
...@@ -385,7 +385,7 @@ void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus) ...@@ -385,7 +385,7 @@ void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus)
EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset); EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset);
/* reset codec link */ /* reset codec link */
static int azx_reset(struct hdac_bus *bus, bool full_reset) int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset)
{ {
if (!full_reset) if (!full_reset)
goto skip_reset; goto skip_reset;
...@@ -410,7 +410,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset) ...@@ -410,7 +410,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
skip_reset: skip_reset:
/* check to see if controller is ready */ /* check to see if controller is ready */
if (!snd_hdac_chip_readb(bus, GCTL)) { if (!snd_hdac_chip_readb(bus, GCTL)) {
dev_dbg(bus->dev, "azx_reset: controller not ready!\n"); dev_dbg(bus->dev, "controller not ready!\n");
return -EBUSY; return -EBUSY;
} }
...@@ -425,6 +425,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset) ...@@ -425,6 +425,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hdac_bus_reset_link);
/* enable interrupts */ /* enable interrupts */
static void azx_int_enable(struct hdac_bus *bus) 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,7 +480,7 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
return false; return false;
/* reset controller */ /* reset controller */
azx_reset(bus, full_reset); snd_hdac_bus_reset_link(bus, full_reset);
/* clear interrupts */ /* clear interrupts */
azx_int_clear(bus); azx_int_clear(bus);
......
...@@ -834,7 +834,7 @@ static int skl_first_init(struct hdac_bus *bus) ...@@ -834,7 +834,7 @@ static int skl_first_init(struct hdac_bus *bus)
return -ENXIO; return -ENXIO;
} }
skl_init_chip(bus, true); snd_hdac_bus_reset_link(bus, true);
snd_hdac_bus_parse_capabilities(bus); snd_hdac_bus_parse_capabilities(bus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment