Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: Mark Brown <broonie@kernel.org>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-renesas-soc@vger.kernel.org,
	Vinod Koul <vinod.koul@intel.com>, Simon <horms@verge.net.au>
Subject: Re: Question about struct snd_soc_dai() :: cpu_dai->codec
Date: Thu, 04 Aug 2016 14:27:36 +0200	[thread overview]
Message-ID: <s5hy44c7m87.wl-tiwai@suse.de> (raw)
In-Reply-To: <a9071ad9-ea67-1bce-27cf-3f2ac21b6456@sakamocchi.jp>

On Thu, 04 Aug 2016 14:12:09 +0200,
Takashi Sakamoto wrote:
> 
> On Aug 4 2016 19:28, Mark Brown wrote:
> > On Thu, Aug 04, 2016 at 12:17:57PM +0900, Takashi Sakamoto wrote:
> >> On Jul 30 2016 07:08, Mark Brown wrote:
> > 
> >>> The card should be deinstantiated and reinstantiated whenever a
> >>> component driver unbinds and rebinds (respectively).  You'd need to
> >>> completely deregister the card to change the list of things it's
> >>> expecting currently.
> > 
> >> In a point of application interfaces, I guess that current implementation of
> >> ALSA soc part includes a bug that it's possible to unload codec or component
> >> modules when any ALSA character devices are opened. The framework has no
> >> codes to manage reference counting of character devices or loaded codecs,
> >> components.
> > 
> > Yes, exactly - we don't cope very well with that situation and we really
> > ought to but since it's hard to trigger without trying in practice it's
> > never been a priority.
> 
> Ugly... completely ugly idea for user space applications and operating
> system... It's better for developers for ALSA soc part to pay enough
> attention not only to their hardwares but also to application interfaces.
> 
> Please assume that a loaded module for SoC's sound interface which
> supports Jack detection, and pulseaudio runs on the system. Then,
> typically, the process listen to ALSA ctrl character device for Jack
> detection.
> 
> In this case, when modules for codec or component are unloaded, what
> happends?

You can't unload.  The module unload is already protected by the
proper module refcounting.

> In worst case, pulseaudio process can kill the system in a
> system call path or something else, because the modules for SoC's sound
> interface is still loaded and userspace applications can execute system
> calls via ALSA character devices.
> 
> It should be forbidden to build ALSA soc part as loadable kernel
> modules. It's really danger...

The only danger is about the dynamic unbinding, and it has nothing to
do with the module.  And, protecting the sysfs unbind itself is
trivial, too: as I already suggested, we can put the flags in
appropriate places.


Takashi

  reply	other threads:[~2016-08-04 12:27 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26  5:41 Question about struct snd_soc_dai() :: cpu_dai->codec Kuninori Morimoto
2016-07-27  3:21 ` [alsa-devel] " Vinod Koul
2016-07-27  3:42   ` Kuninori Morimoto
2016-07-27  5:57   ` Takashi Iwai
2016-07-27  6:36     ` Kuninori Morimoto
2016-07-27 17:21     ` Vinod Koul
2016-07-27 18:04       ` Mark Brown
2016-07-27 18:11         ` Takashi Iwai
2016-07-27 18:22           ` Mark Brown
2016-07-27 20:22             ` Takashi Iwai
2016-07-28  3:46               ` Vinod Koul
2016-07-28 20:33                 ` Lars-Peter Clausen
2016-07-28 20:42                   ` Takashi Iwai
2016-07-28 20:43                     ` Lars-Peter Clausen
2016-07-28 20:44                   ` Mark Brown
2016-07-29  0:30                   ` Takashi Sakamoto
2016-07-29  9:07                     ` Lars-Peter Clausen
2016-07-29 16:07                       ` Vinod Koul
2016-07-29 20:41                         ` Takashi Iwai
2016-07-29 21:45                           ` Takashi Sakamoto
2016-07-29 22:08                             ` Mark Brown
2016-08-04  3:17                               ` Takashi Sakamoto
2016-08-04 10:28                                 ` Mark Brown
2016-08-04 12:12                                   ` Takashi Sakamoto
2016-08-04 12:27                                     ` Takashi Iwai [this message]
2016-08-04 13:39                                       ` Takashi Sakamoto
2016-08-04 13:52                                         ` Takashi Iwai
2016-07-28 20:24 ` [alsa-devel] " Lars-Peter Clausen
2016-07-29  2:24   ` Kuninori Morimoto
2016-07-29  9:01     ` Lars-Peter Clausen
2016-07-29 14:41       ` Mark Brown
2016-08-01  3:45         ` Kuninori Morimoto
2016-08-02  6:47           ` Kuninori Morimoto
2016-08-03 19:32             ` Lars-Peter Clausen
2016-08-04  2:38               ` Kuninori Morimoto
2016-08-04  8:21                 ` Lars-Peter Clausen
2016-08-04 20:56                   ` Mark Brown
2016-08-05  7:29                   ` Kuninori Morimoto
2016-08-04 20:37                 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hy44c7m87.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=o-takashi@sakamocchi.jp \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox