Skip to content

Commit 75383f8

Browse files
yuzhaogooglebroonie
authored andcommitted
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: 60767ab ("ASoC: Intel: Skylake: Reset the controller in probe") Reviewed-by: Takashi Iwai <[email protected]> Signed-off-by: Yu Zhao <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent b61749a commit 75383f8

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

include/sound/hdaudio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus);
384384
void snd_hdac_bus_stop_cmd_io(struct hdac_bus *bus);
385385
void snd_hdac_bus_enter_link_reset(struct hdac_bus *bus);
386386
void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus);
387+
int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset);
387388

388389
void snd_hdac_bus_update_rirb(struct hdac_bus *bus);
389390
int snd_hdac_bus_handle_stream_irq(struct hdac_bus *bus, unsigned int status,

sound/hda/hdac_controller.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ void snd_hdac_bus_exit_link_reset(struct hdac_bus *bus)
385385
EXPORT_SYMBOL_GPL(snd_hdac_bus_exit_link_reset);
386386

387387
/* 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)
389389
{
390390
if (!full_reset)
391391
goto skip_reset;
@@ -410,7 +410,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
410410
skip_reset:
411411
/* check to see if controller is ready */
412412
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");
414414
return -EBUSY;
415415
}
416416

@@ -425,6 +425,7 @@ static int azx_reset(struct hdac_bus *bus, bool full_reset)
425425

426426
return 0;
427427
}
428+
EXPORT_SYMBOL_GPL(snd_hdac_bus_reset_link);
428429

429430
/* enable interrupts */
430431
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)
479480
return false;
480481

481482
/* reset controller */
482-
azx_reset(bus, full_reset);
483+
snd_hdac_bus_reset_link(bus, full_reset);
483484

484485
/* clear interrupts */
485486
azx_int_clear(bus);

sound/soc/intel/skylake/skl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ static int skl_first_init(struct hdac_bus *bus)
834834
return -ENXIO;
835835
}
836836

837-
skl_init_chip(bus, true);
837+
snd_hdac_bus_reset_link(bus, true);
838838

839839
snd_hdac_bus_parse_capabilities(bus);
840840

0 commit comments

Comments
 (0)