From: Takashi Iwai Subject: Re: [RFC] alsa-kernel, make control.c suspend aware Date: Fri, 03 Mar 2006 18:45:28 +0100 Message-ID: References: <20060302001859.58bd93af.pochini@shiny.it> <20060302230720.669b348f.pochini@shiny.it> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20060302230720.669b348f.pochini@shiny.it> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Giuliano Pochini Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Thu, 2 Mar 2006 23:07:20 +0100, Giuliano Pochini wrote: > > On Thu, 02 Mar 2006 11:58:39 +0100 > Takashi Iwai wrote: > > > At Thu, 2 Mar 2006 00:18:59 +0100, > > Giuliano Pochini wrote: > > > > > > First attempt to add code that prevents someone to access the hardware via > > > control interface when the card is suspended. > > > > > > I put the code in snd_ctl_elem_read_user() instead of snd_ctl_elem_read() > > > because /pci/hda/hda_codec.c:snd_hda_resume_ctls() calls the latter from the > > > resume callback. I had no time to check other things, consider it mostly > > > untested. > > > > Looks fine. We need also power_lock() around ioctls, too? > > My driver doesn't use the ioctl interface, but if we want to make ti work > always, I think so. > > ->put() and ->get() are called directly only from > core/control.c:snd_ctl_elem_read() and core/control.c:snd_ctl_elem_write(). > If we put snd_power_wait() in snd_ctl_elem_read/write() all their current > and future callers are protected, but /hda/hda_codec.c deadlocks in the > resume function (it's the only one). Otherwise, we can put snd_power_wait() > in snd_ctl_elem_read/write_user() and in _snd_ioctl32_ctl_elem_value(). > Which choice ? Do we duplicate power_wait or do we change hda_intel ? I think it's better to set snd_power_lock() only for user-accessor. Yes, get and put callbacks are only for read/write callbacks, but there is still info callback. So, we need to put power lock to snd_ctl_elem_user_info(), too. Takashi ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642