Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Nov 2016 20:32:17 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        Oleksandr Tymoshenko <gonzo@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r308424 - head/sys/arm/broadcom/bcm2835
Message-ID:  <c7cd871d-9007-6de4-7063-2680e259713f@selasky.org>
In-Reply-To: <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org>
References:  <201611071738.uA7HceYu045944@repo.freebsd.org> <f8169b11-56d8-4566-f9e9-e387dd9b939e@selasky.org> <680D84F2-65BF-48DD-8D11-311B1F65A634@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/07/16 20:23, Oleksandr Tymoshenko wrote:
>
>> On Nov 7, 2016, at 10:27 AM, Hans Petter Selasky <hps@selasky.org> wrote:
>>
>> On 11/07/16 18:38, Oleksandr Tymoshenko wrote:
>>> +		bcm2835_audio_unlock(sc);
>>> +		cv_signal(&sc->worker_cv);
>>
>>
>> Shouldn't cv_signal() be done locked, so that you don't loose any transactions? CV's only wakeup the treads that are sleeping right there and then.
>
> Hi Hans,
>
> In this case it doesn’t matter. bcm2835_audio_xxx lock functions are used to keep channel state consistent. The actual audio hw reprogramming happens in worker thread which only picks up latest state of the virtual channel, there is no need to run every transaction in sequence.
>

Hi,

It is not about running in sequence, but that if the worker thread is 
not sleeping, but on the way to sleep, it will never get woken up unless 
you use proper locks here!

--HPS




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c7cd871d-9007-6de4-7063-2680e259713f>