Skip to content

Commit

Permalink
drivers: imx: esai: set private data after allocation
Browse files Browse the repository at this point in the history
ESAI allocates private data and retrieves this data using
dai_get_drvdata().
But this is never set using dai_set_drvdata() and sometimes
dai_get_drvdata() returns NULL.
So, after private data is allocated, set it using dai_set_drvdata().

Without this fix, on i.MX8QM, on playback we get:
root@imx8qmmek:~# aplay -Dhw:1,0 -f S16_LE -c 2 -r 48000 -d 5 -t raw /dev/urandom
Playing raw data '/dev/urandom' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
[  197.478128] sof-audio-of 556e8000.dsp: error : DSP panic!
[  197.483547] sof-audio-of 556e8000.dsp: error: runtime exception
[  197.489473] sof-audio-of 556e8000.dsp: error: trace point 0dead006
[  197.495658] sof-audio-of 556e8000.dsp: error: panic at :0
[  197.501064] sof-audio-of 556e8000.dsp: error: DSP Firmware Oops
[...]

Fixes: f40222a ("drivers: imx: esai: use rate from topology")
Signed-off-by: Iuliana Prodan <[email protected]>
  • Loading branch information
iuliana-prodan authored and dbaluta committed Mar 23, 2021
1 parent 6998536 commit 0a9262a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/drivers/imx/esai.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ static int esai_probe(struct dai *dai)
dai_err(dai, "ESAI probe failure, out of memory");
return -ENOMEM;
}
dai_set_drvdata(dai, pdata);

/* ESAI core reset */
dai_write(dai, REG_ESAI_ECR, ESAI_ECR_ERST | ESAI_ECR_ESAIEN);
dai_write(dai, REG_ESAI_ECR, ESAI_ECR_ESAIEN);
Expand Down

0 comments on commit 0a9262a

Please sign in to comment.