Commit 8e9d8e19 authored by Subhransu S. Prusty's avatar Subhransu S. Prusty Committed by Mark Brown

ASoC: Intel: Skylake: Request IRQ late only after all context are initialized

Sometimes during boot, panic is observed at sst_dsp_shim_read_unlocked().
This happens when interrupt occurs before the context is initialized. So
move the irq initialization only after the context is initialized
completely.
Signed-off-by: default avatarSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: default avatarPawse, GuruprasadX <guruprasadx.pawse@intel.com>
Signed-off-by: default avatarGuneshwor Singh <guneshwor.o.singh@intel.com>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 87684d33
...@@ -595,7 +595,7 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, ...@@ -595,7 +595,7 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
INIT_DELAYED_WORK(&skl->d0i3.work, bxt_set_dsp_D0i3); INIT_DELAYED_WORK(&skl->d0i3.work, bxt_set_dsp_D0i3);
skl->d0i3.state = SKL_DSP_D0I3_NONE; skl->d0i3.state = SKL_DSP_D0I3_NONE;
return 0; return skl_dsp_acquire_irq(sst);
} }
EXPORT_SYMBOL_GPL(bxt_sst_dsp_init); EXPORT_SYMBOL_GPL(bxt_sst_dsp_init);
......
...@@ -458,7 +458,7 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, ...@@ -458,7 +458,7 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
cnl->boot_complete = false; cnl->boot_complete = false;
init_waitqueue_head(&cnl->boot_wait); init_waitqueue_head(&cnl->boot_wait);
return 0; return skl_dsp_acquire_irq(sst);
} }
EXPORT_SYMBOL_GPL(cnl_sst_dsp_init); EXPORT_SYMBOL_GPL(cnl_sst_dsp_init);
......
...@@ -435,16 +435,22 @@ struct sst_dsp *skl_dsp_ctx_init(struct device *dev, ...@@ -435,16 +435,22 @@ struct sst_dsp *skl_dsp_ctx_init(struct device *dev,
return NULL; return NULL;
} }
return sst;
}
int skl_dsp_acquire_irq(struct sst_dsp *sst)
{
struct sst_dsp_device *sst_dev = sst->sst_dev;
int ret;
/* Register the ISR */ /* Register the ISR */
ret = request_threaded_irq(sst->irq, sst->ops->irq_handler, ret = request_threaded_irq(sst->irq, sst->ops->irq_handler,
sst_dev->thread, IRQF_SHARED, "AudioDSP", sst); sst_dev->thread, IRQF_SHARED, "AudioDSP", sst);
if (ret) { if (ret)
dev_err(sst->dev, "unable to grab threaded IRQ %d, disabling device\n", dev_err(sst->dev, "unable to grab threaded IRQ %d, disabling device\n",
sst->irq); sst->irq);
return NULL;
}
return sst; return ret;
} }
void skl_dsp_free(struct sst_dsp *dsp) void skl_dsp_free(struct sst_dsp *dsp)
......
...@@ -206,6 +206,7 @@ int skl_cldma_wait_interruptible(struct sst_dsp *ctx); ...@@ -206,6 +206,7 @@ int skl_cldma_wait_interruptible(struct sst_dsp *ctx);
void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state); void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state);
struct sst_dsp *skl_dsp_ctx_init(struct device *dev, struct sst_dsp *skl_dsp_ctx_init(struct device *dev,
struct sst_dsp_device *sst_dev, int irq); struct sst_dsp_device *sst_dev, int irq);
int skl_dsp_acquire_irq(struct sst_dsp *sst);
bool is_skl_dsp_running(struct sst_dsp *ctx); bool is_skl_dsp_running(struct sst_dsp *ctx);
unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx); unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx);
......
...@@ -569,7 +569,7 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq, ...@@ -569,7 +569,7 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
sst->fw_ops = skl_fw_ops; sst->fw_ops = skl_fw_ops;
return 0; return skl_dsp_acquire_irq(sst);
} }
EXPORT_SYMBOL_GPL(skl_sst_dsp_init); EXPORT_SYMBOL_GPL(skl_sst_dsp_init);
......
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