ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words
Subsystems (3)
PATCH v2 1/1 ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words
From: Nariman Poushin <[email protected]>
Pad the ADSP word (3 bytes) to 4 bytes in the kernel and calculate lengths based on padded ADSP words instead of treating them as bytes
Signed-off-by Nariman Poushin <[email protected]>
Signed-off-by Dimitris Papastamos <[email protected]>
--- sound/soc/codecs/wm_adsp.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/soc/codecs/wm_adsp.c +5 -0
@@ -1066,6 +1066,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp1_alg[i +1 ].dm); region->len -=be32_to_cpu (adsp1_alg[i].dm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region DM with ID %x\n",
@@ -1083,6 +1084,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp1_alg[i +1 ].zm); region->len -=be32_to_cpu (adsp1_alg[i].zm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
@@ -1112,6 +1114,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp2_alg[i +1 ].xm); region->len -=be32_to_cpu (adsp2_alg[i].xm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region XM with ID %x\n",
@@ -1129,6 +1132,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp2_alg[i +1 ].ym); region->len -=be32_to_cpu (adsp2_alg[i].ym); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region YM with ID %x\n",
@@ -1146,6 +1150,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp2_alg[i +1 ].zm); region->len -=be32_to_cpu (adsp2_alg[i].zm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
Signature · 1 line
1.8.4.2
PATCH v2 1/1 ASoC: wm_adsp: Interpret ADSP memory region lengths as 32 bit words
From: Nariman Poushin <[email protected]>
Pad the ADSP word (3 bytes) to 4 bytes in the kernel and calculate lengths based on padded ADSP words instead of treating them as bytes
Signed-off-by Nariman Poushin <[email protected]>
Signed-off-by Dimitris Papastamos <[email protected]>
--- sound/soc/codecs/wm_adsp.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/soc/codecs/wm_adsp.c +5 -0
@@ -1066,6 +1066,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp1_alg[i +1 ].dm); region->len -=be32_to_cpu (adsp1_alg[i].dm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region DM with ID %x\n",
@@ -1083,6 +1084,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp1_alg[i +1 ].zm); region->len -=be32_to_cpu (adsp1_alg[i].zm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
@@ -1112,6 +1114,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp2_alg[i +1 ].xm); region->len -=be32_to_cpu (adsp2_alg[i].xm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region XM with ID %x\n",
@@ -1129,6 +1132,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp2_alg[i +1 ].ym); region->len -=be32_to_cpu (adsp2_alg[i].ym); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region YM with ID %x\n",
@@ -1146,6 +1150,7 @@ static int wm_adsp_setup_algs(struct wm_adsp *dsp)if (i +1 < algs) { region->len =be32_to_cpu (adsp2_alg[i +1 ].zm); region->len -=be32_to_cpu (adsp2_alg[i].zm); + region->len *=4 ;wm_adsp_create_control (dsp, region); }else { adsp_warn(dsp, "Missing length info for region ZM with ID %x\n",
Signature · 1 line
1.8.4.2
Quoted 4 lines · Dimitris Papastamos
From: Nariman Poushin <[email protected]>
Pad the ADSP word (3 bytes) to 4 bytes in the kernel and calculate lengths based on padded ADSP words instead of treating them as bytes
Applied, thanks.