[alsa-devel] [PATCH 1/2] ALSA: hdac: add link pm and ref counting

Vinod Koul vinod.koul at intel.com
Mon May 2 11:02:00 CEST 2016


On Fri, Apr 29, 2016 at 11:05:51AM +0200, Takashi Iwai wrote:
> > +int snd_hdac_ext_bus_link_get(struct hdac_ext_bus *ebus,
> > +				struct hdac_ext_link *link)
> > +{
> > +	int ret = 0;
> > +
> > +	spin_lock(&ebus->lock);
> > +
> > +	/*
> > +	 * if we move from 0 to 1, count will be 1 so power up this link
> > +	 * as well, also check the dma status and trigger that
> > +	 */
> > +	if (++link->ref_count == 1) {
> > +		if (!ebus->cmd_io) {
> > +			snd_hdac_bus_init_cmd_io(&ebus->bus);
> 
> Calling this function inside a spinlock is wrong.
> It should be mutex instead.

Yes I looked at it's usage, we should do a mutex here, will send an update

-- 
~Vinod


More information about the Alsa-devel mailing list