Re: [PATCH 3/7] ark3116: (3rd try) Replace cmget

From: Bart Hartgers
Date: Sun Oct 25 2009 - 15:56:44 EST


2009/10/25 Oliver Neukum <oliver@xxxxxxxxxx>:
> Am Sonntag, 25. Oktober 2009 18:51:00 schrieb bart.hartgers@xxxxxxxxx:
>> +ÂÂÂÂÂÂÂ/* read modem status */
>> +ÂÂÂÂÂÂÂunsigned status = atomic_read(&priv->msr);
>> +ÂÂÂÂÂÂÂ/* modem control is output */
>> +ÂÂÂÂÂÂÂunsigned ctrl = atomic_read(&priv->mcr);
>
> What is the sense of having two atomic variables?
> You can get races where one is changed but the other is not.
>
> Â Â Â ÂRegards
> Â Â Â Â Â Â Â ÂOliver
>
>

Hi Oliver,

I don't think so. The two values are not really related.

These are two separate things: mcr (modem control reg) is ultimately
changed by whatever has the serial port open, msr (modem status
register) represents the status of the handshaking lines, and is
changed (via the interrupt urb callback) by hardware.

Groeten,
Bart

--
Bart Hartgers - New e-mail: bart.hartgers@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/