[patch 6/6] staging: speakup: Migrate acntsa, bns, dectlk and txprt to ttyio
okash.khawaja at gmail.com
Thu Mar 30 11:34:56 EDT 2017
On Thu, Mar 30, 2017 at 4:19 PM, Samuel Thibault
<samuel.thibault at ens-lyon.org> wrote:
> Okash Khawaja, on jeu. 30 mars 2017 15:45:08 +0100, wrote:
>> - in spk_ttyio_in:
>> - countdown for SPK_SERIAL_TIMEOUT usecs - similar to
>> spk_serial_in - and check for atomic_read(&buf_free) == 0
> Such busy polling will be way less acceptable than down_timeout :)
> And all the more so since it does not actually try to give CPU to the
> part of the kernel which will provide the character, while down_timeout
> exactly does that.
Of course. I misread the code in down_timeout() which uses spinlock
which made me think it's busy waiting.
>> seems to be a somewhat less acceptance for timeout while acquiring
>> locks. For example in case of mutex_lock_timeout:
> Here we are not acquiring a lock: the down_timeout call is used to
> try to consume a character
Yes I can see now that we utilise waiting feature of semaphore here.
More information about the Speakup