Message ID | s5h7evuxdop.wl-tiwai@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Oct 17, 2017 at 12:37:42PM +0200, Takashi Iwai wrote: > Kuninori Morimoto wrote: > > I'm happy to solve this issue, but I'm not good at DPCM. > > If you can give me some help/advice, I can debug it. Honestly I'm not super good with DPCM either, Liam wrote that code and I've never needed to delve too aggressively into it. > It seems that the whole disconnect call can be dropped for the BE, as > it does nothing practically for the register callback, either. That feels like it's going to blow up on us at some point... it's probably right for most things though.
Hi Takashi-san > > It seems that the whole disconnect call can be dropped for the BE, as > > it does nothing practically for the register callback, either. > > That feels like it's going to blow up on us at some point... it's > probably right for most things though. Wow !! Perfect !! I tested your new "internal PCM" patch, and at least my kernel panic issue on DPCM was solved ! Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> # I din't know that "internal" option was for DPCM backend PCM... Best regards --- Kuninori Morimoto
On Wed, 18 Oct 2017 04:08:44 +0200, Kuninori Morimoto wrote: > > > Hi Takashi-san > > > > It seems that the whole disconnect call can be dropped for the BE, as > > > it does nothing practically for the register callback, either. > > > > That feels like it's going to blow up on us at some point... it's > > probably right for most things though. > > Wow !! Perfect !! > > I tested your new "internal PCM" patch, and at least my kernel panic issue > on DPCM was solved ! > > Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> OK, I'll keep the branch not merged to for-next yet for a while in case we find any other breakage. The plan is to merge these changes for 4.15, so this will happen in a few days. > # I din't know that "internal" option was for DPCM backend PCM... That needs more documentation... thanks, Takashi
Hi Takashi > > I tested your new "internal PCM" patch, and at least my kernel panic issue > > on DPCM was solved ! > > > > Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > OK, I'll keep the branch not merged to for-next yet for a while in > case we find any other breakage. The plan is to merge these changes > for 4.15, so this will happen in a few days. Thanks !! Best regards --- Kuninori Morimoto
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 7eadb7fd8074..1b073ed0b1f9 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -775,6 +775,9 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device, .dev_register = snd_pcm_dev_register, .dev_disconnect = snd_pcm_dev_disconnect, }; + static struct snd_device_ops internal_ops = { + .dev_free = snd_pcm_dev_free, + }; if (snd_BUG_ON(!card)) return -ENXIO; @@ -801,7 +804,8 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device, if (err < 0) goto free_pcm; - err = snd_device_new(card, SNDRV_DEV_PCM, pcm, &ops); + err = snd_device_new(card, SNDRV_DEV_PCM, pcm, + internal ? &internal_ops : &ops); if (err < 0) goto free_pcm; @@ -1099,8 +1103,6 @@ static int snd_pcm_dev_register(struct snd_device *device) if (snd_BUG_ON(!device || !device->device_data)) return -ENXIO; pcm = device->device_data; - if (pcm->internal) - return 0; mutex_lock(®ister_mutex); err = snd_pcm_add(pcm); @@ -1159,12 +1161,10 @@ static int snd_pcm_dev_disconnect(struct snd_device *device) snd_pcm_stream_unlock_irq(substream); } } - if (!pcm->internal) { - pcm_call_notify(pcm, n_disconnect); - } + + pcm_call_notify(pcm, n_disconnect); for (cidx = 0; cidx < 2; cidx++) { - if (!pcm->internal) - snd_unregister_device(&pcm->streams[cidx].dev); + snd_unregister_device(&pcm->streams[cidx].dev); free_chmap(&pcm->streams[cidx]); } mutex_unlock(&pcm->open_mutex);