Re: [linux-usb-devel] Serial-Core: USB-Serial port current issues.

From: Paul Fulghum
Date: Wed Jul 05 2006 - 09:41:47 EST


Luiz Fernando N. Capitulino wrote:
| take mutex
| take port lock
| again:
| save local copy of icount
| release port lock
| get_mctrl
| take port lock
| if (icount changed)
| goto again
| update tty->hw_stopped
| release port lock
| release mutex

Well, I think it'd work. But how can we keep track of 'icount'?
Should the driver add 1 if it updates 'tty->hw_stopped'?

The only thing about icount that needs to be
tracked is that it changes, which indicates
an interrupt might have changed hw_stopped.
If icount changes at all, invalidate the last
reading of the state and do it again. The way
icount is incremented is not changed.

Like I said, it is really ugly. I was just looking
for a way of allowing get_mctrl to sleep if necessary.

--
Paul Fulghum
Microgate Systems, Ltd.
-
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/