ASoC: qcom: Fix for DMA interrupt clear reg overwriting
Subsystems (4)
PATCH 1/1 ASoC: qcom: Fix for DMA interrupt clear reg overwriting
This patch fixes the DMA interrupt registers overwriting issue in lpass platform interrupt handler.
--- sound/soc/qcom/lpass-platform.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
sound/soc/qcom/lpass-platform.c +11 -6
@@ -526,7 +526,7 @@ static int lpass_platform_pcmops_trigger(struct snd_soc_component *component,return -EINVAL ; } - ret =regmap_write (map, reg_irqclr, val_irqclr); + ret =regmap_update_bits (map, reg_irqclr, val_irqclr, val_irqclr);if (ret) {dev_err (soc_runtime->dev,"error writing to irqclear reg: %d\n" , ret);return ret;
@@ -650,7 +650,7 @@ static irqreturn_t lpass_dma_interrupt_handler(struct lpass_variant *v = drvdata->variant;irqreturn_t ret =IRQ_NONE ;int rv; -unsigned int reg =0 , val =0 ; +unsigned int reg =0 , val =0 , val_clr =0 , val_mask =0 ;struct regmap *map;unsigned int dai_id = cpu_dai->driver->id;
@@ -676,8 +676,9 @@ static irqreturn_t lpass_dma_interrupt_handler(return -EINVAL ; }if (interrupts &LPAIF_IRQ_PER (chan)) { - - rv =regmap_write (map, reg,LPAIF_IRQ_PER (chan) | val); + val_clr = (LPAIF_IRQ_PER (chan) | val); + val_mask =LPAIF_IRQ_ALL (chan); + rv =regmap_update_bits (map, reg, val_mask, val_clr);if (rv) {dev_err (soc_runtime->dev,"error writing to irqclear reg: %d\n" , rv);
@@ -688,7 +689,9 @@ static irqreturn_t lpass_dma_interrupt_handler( }if (interrupts &LPAIF_IRQ_XRUN (chan)) { - rv =regmap_write (map, reg,LPAIF_IRQ_XRUN (chan) | val); + val_clr = (LPAIF_IRQ_XRUN (chan) | val); + val_mask =LPAIF_IRQ_ALL (chan); + rv =regmap_update_bits (map, reg, val_mask, val_clr);if (rv) {dev_err (soc_runtime->dev,"error writing to irqclear reg: %d\n" , rv);
@@ -700,7 +703,9 @@ static irqreturn_t lpass_dma_interrupt_handler( }if (interrupts &LPAIF_IRQ_ERR (chan)) { - rv =regmap_write (map, reg,LPAIF_IRQ_ERR (chan) | val); + val_clr = (LPAIF_IRQ_ERR (chan) | val); + val_mask =LPAIF_IRQ_ALL (chan); + rv =regmap_update_bits (map, reg, val_mask, val_clr);if (rv) {dev_err (soc_runtime->dev,"error writing to irqclear reg: %d\n" , rv);
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Quoting Srinivasa Rao Mandadapu (2021-06-02 22:05:30)
Quoted 1 line
This patch fixes the DMA interrupt registers overwriting
$ git grep "This patch" -- Documentation/process
Quoted 1 line
issue in lpass platform interrupt handler.
Can you describe the issue more?
Quoted 3 lines
Signed-off-by Srinivasa Rao Mandadapu <[email protected]>---
Any Fixes tag?
sound/soc/qcom/lpass-platform.c static irqreturn_t lpass_dma_interrupt_handler( · line 653
Quoted 13 lines
sound/soc/qcom/lpass-platform.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)sound/soc/qcom/lpass-platform.c +1
-1@@ -650,7 +650,7 @@ static irqreturn_t lpass_dma_interrupt_handler(struct lpass_variant *v = drvdata->variant;irqreturn_t ret =IRQ_NONE ;int rv; -unsigned int reg =0 , val =0 ; +unsigned int reg =0 , val =0 , val_clr =0 , val_mask =0 ;
Why assign to 0 and then overwrite it?
sound/soc/qcom/lpass-platform.c static irqreturn_t lpass_dma_interrupt_handler( · line 679
Quoted 10 lines
sound/soc/qcom/lpass-platform.c +1
-2struct regmap *map;unsigned int dai_id = cpu_dai->driver->id;@@ -676,8 +676,9 @@ static irqreturn_t lpass_dma_interrupt_handler(return -EINVAL ; }if (interrupts &LPAIF_IRQ_PER (chan)) { - - rv =regmap_write (map, reg,LPAIF_IRQ_PER (chan) | val); + val_clr = (LPAIF_IRQ_PER (chan) | val);
Is the extra parenthesis useful?
Quoted 5 lines
sound/soc/qcom/lpass-platform.c +2
-0+ val_mask =LPAIF_IRQ_ALL (chan); + rv =regmap_update_bits (map, reg, val_mask, val_clr);if (rv) {dev_err (soc_runtime->dev,"error writing to irqclear reg: %d\n" , rv);
Hi Stephen,
Thanks for Your Time for review comments!!!
Quoted 3 lines · Stephen Boyd
Quoting Srinivasa Rao Mandadapu (2021-06-02 22:05:30)
Quoted 1 line
This patch fixes the DMA interrupt registers overwriting
$ git grep "This patch" -- Documentation/process
Okay will change description.
Quoted 3 lines
Quoted 2 lines
issue in lpass platform interrupt handler.
Can you describe the issue more?
Sure. will elaborate more.
Quoted 8 lines
Quoted 3 lines
Signed-off-by Srinivasa Rao Mandadapu <[email protected]>---
Any Fixes tag?
Quoted 3 lines
sound/soc/qcom/lpass-platform.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
Quoted 11 lines
sound/soc/qcom/lpass-platform.c static irqreturn_t lpass_dma_interrupt_handler( · line 653
Quoted 10 lines
sound/soc/qcom/lpass-platform.c +1
-1@@ -650,7 +650,7 @@ static irqreturn_t lpass_dma_interrupt_handler(struct lpass_variant *v = drvdata->variant;irqreturn_t ret =IRQ_NONE ;int rv; -unsigned int reg =0 , val =0 ; +unsigned int reg =0 , val =0 , val_clr =0 , val_mask =0 ;Why assign to 0 and then overwrite it?
Okay. Will remove initialization.
Quoted 4 lines
Quoted 4 lines
sound/soc/qcom/lpass-platform.c +0
-0struct regmap *map;unsigned int dai_id = cpu_dai->driver->id;
Quoted 8 lines
sound/soc/qcom/lpass-platform.c static irqreturn_t lpass_dma_interrupt_handler( · line 679
Quoted 7 lines
sound/soc/qcom/lpass-platform.c +1
-2@@ -676,8 +676,9 @@ static irqreturn_t lpass_dma_interrupt_handler(return -EINVAL ; }if (interrupts &LPAIF_IRQ_PER (chan)) { - - rv =regmap_write (map, reg,LPAIF_IRQ_PER (chan) | val); + val_clr = (LPAIF_IRQ_PER (chan) | val);Is the extra parenthesis useful?
Not exactly. Will remove it.
Quoted 6 lines
Quoted 6 lines
sound/soc/qcom/lpass-platform.c +2
-0+ val_mask =LPAIF_IRQ_ALL (chan); + rv =regmap_update_bits (map, reg, val_mask, val_clr);if (rv) {dev_err (soc_runtime->dev,"error writing to irqclear reg: %d\n" , rv);
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.