Commit e24aa0a4 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda/ca0132 - Don't try loading firmware at resume when already failed

CA0132 driver tries to reload the firmware at resume.  Usually this
works since the firmware loader core caches the firmware contents by
itself.  However, if the driver failed to load the firmwares
(e.g. missing files), reloading the firmware at resume goes through
the actual file loading code path, and triggers a kernel WARNING like:

 WARNING: CPU: 10 PID:11371 at drivers/base/firmware_class.c:1105 _request_firmware+0x9ab/0x9d0()

For avoiding this situation, this patch makes CA0132 skipping the f/w
loading at resume when it failed at probe time.
Reported-and-tested-by: default avatarJanek Kozicki <cosurgi@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent de3da4f6
...@@ -4376,6 +4376,9 @@ static void ca0132_download_dsp(struct hda_codec *codec) ...@@ -4376,6 +4376,9 @@ static void ca0132_download_dsp(struct hda_codec *codec)
return; /* NOP */ return; /* NOP */
#endif #endif
if (spec->dsp_state == DSP_DOWNLOAD_FAILED)
return; /* don't retry failures */
chipio_enable_clocks(codec); chipio_enable_clocks(codec);
spec->dsp_state = DSP_DOWNLOADING; spec->dsp_state = DSP_DOWNLOADING;
if (!ca0132_download_dsp_images(codec)) if (!ca0132_download_dsp_images(codec))
...@@ -4552,7 +4555,8 @@ static int ca0132_init(struct hda_codec *codec) ...@@ -4552,7 +4555,8 @@ static int ca0132_init(struct hda_codec *codec)
struct auto_pin_cfg *cfg = &spec->autocfg; struct auto_pin_cfg *cfg = &spec->autocfg;
int i; int i;
spec->dsp_state = DSP_DOWNLOAD_INIT; if (spec->dsp_state != DSP_DOWNLOAD_FAILED)
spec->dsp_state = DSP_DOWNLOAD_INIT;
spec->curr_chip_addx = INVALID_CHIP_ADDRESS; spec->curr_chip_addx = INVALID_CHIP_ADDRESS;
snd_hda_power_up(codec); snd_hda_power_up(codec);
...@@ -4663,6 +4667,7 @@ static int patch_ca0132(struct hda_codec *codec) ...@@ -4663,6 +4667,7 @@ static int patch_ca0132(struct hda_codec *codec)
codec->spec = spec; codec->spec = spec;
spec->codec = codec; spec->codec = codec;
spec->dsp_state = DSP_DOWNLOAD_INIT;
spec->num_mixers = 1; spec->num_mixers = 1;
spec->mixers[0] = ca0132_mixer; spec->mixers[0] = ca0132_mixer;
......
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