Skip to content

Commit 8e9d8e1

Browse files
Subhransu S. Prustybroonie
authored andcommitted
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: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Pawse, GuruprasadX <guruprasadx.pawse@intel.com> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com> Acked-By: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 87684d3 commit 8e9d8e1

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎sound/soc/intel/skylake/bxt-sst.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
595595
INIT_DELAYED_WORK(&skl->d0i3.work, bxt_set_dsp_D0i3);
596596
skl->d0i3.state = SKL_DSP_D0I3_NONE;
597597

598-
return 0;
598+
return skl_dsp_acquire_irq(sst);
599599
}
600600
EXPORT_SYMBOL_GPL(bxt_sst_dsp_init);
601601

‎sound/soc/intel/skylake/cnl-sst.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
458458
cnl->boot_complete = false;
459459
init_waitqueue_head(&cnl->boot_wait);
460460

461-
return 0;
461+
return skl_dsp_acquire_irq(sst);
462462
}
463463
EXPORT_SYMBOL_GPL(cnl_sst_dsp_init);
464464

‎sound/soc/intel/skylake/skl-sst-dsp.c‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,16 +435,22 @@ struct sst_dsp *skl_dsp_ctx_init(struct device *dev,
435435
return NULL;
436436
}
437437

438+
return sst;
439+
}
440+
441+
int skl_dsp_acquire_irq(struct sst_dsp *sst)
442+
{
443+
struct sst_dsp_device *sst_dev = sst->sst_dev;
444+
int ret;
445+
438446
/* Register the ISR */
439447
ret = request_threaded_irq(sst->irq, sst->ops->irq_handler,
440448
sst_dev->thread, IRQF_SHARED, "AudioDSP", sst);
441-
if (ret) {
449+
if (ret)
442450
dev_err(sst->dev, "unable to grab threaded IRQ %d, disabling device\n",
443451
sst->irq);
444-
return NULL;
445-
}
446452

447-
return sst;
453+
return ret;
448454
}
449455

450456
void skl_dsp_free(struct sst_dsp *dsp)

‎sound/soc/intel/skylake/skl-sst-dsp.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ int skl_cldma_wait_interruptible(struct sst_dsp *ctx);
206206
void skl_dsp_set_state_locked(struct sst_dsp *ctx, int state);
207207
struct sst_dsp *skl_dsp_ctx_init(struct device *dev,
208208
struct sst_dsp_device *sst_dev, int irq);
209+
int skl_dsp_acquire_irq(struct sst_dsp *sst);
209210
bool is_skl_dsp_running(struct sst_dsp *ctx);
210211

211212
unsigned int skl_dsp_get_enabled_cores(struct sst_dsp *ctx);

‎sound/soc/intel/skylake/skl-sst.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
569569

570570
sst->fw_ops = skl_fw_ops;
571571

572-
return 0;
572+
return skl_dsp_acquire_irq(sst);
573573
}
574574
EXPORT_SYMBOL_GPL(skl_sst_dsp_init);
575575

0 commit comments

Comments
 (0)