Messages in this thread | | | Date | Wed, 3 Nov 2010 10:34:58 +0000 | From | Alan Cox <> | Subject | Re: open() on /dev/tty takes 30 seconds on 2.6.36 |
| |
> I hope Alan can figure out if it's either safe to drop both here, or if we > might be able to call uart_close without tty_lock() held in the first place.
That was always my intention and why I moved it to tty_port. I think it is safe to do that, but as far as I can tell the port mutex is assumed held by the low level drivers during the uart ops calls some of the time.
Safest is probably to drop the tty lock before we take the port mutex and take it again when we exit.
The tty_port fields are protected by the port mutex/lock
The uport methods by the uport lock
The only two points of concern I see are updating of closing_wait as it is read (no big deal), and the nasty - which is tty_ldisc_flush. I am not sure what assumptions lurk in the ldisc flush paths but I think it's ok.
uart_wait_until_sent will also need to not take the tty lock at that point to fix it properly.
| |