Re: [PATCH 01/10] TTY: serial, cleanup include file

From: Alan Cox
Date: Wed Nov 09 2011 - 16:47:57 EST


> ...instead of taking and dropping a reference in both uart_insert_char
> and uart_push_chars there. But it may be as well an overkill, as this
> stuff is not time critical. So any opinions? (If not I will proceed
> without ticketing having tty_port_tty_get/put in every call. Like I
> have it now.)

The cure for this is different (and a spot more invasive)

We need to move the tty_buffer objects into the tty_port. At that point
the lifetime becomes

create device (and tty_port struct)
request_irq

lifetime of physical port (ttys come and go)

free_irq
free tty_port
done

and the locking goes away. On the flush_to_ldisc side we know the port
physically exists because the work queue for the ldisc is killed and we
wait for it when we kill off the port (we may need a spot more checking
there)

This needs every tty of all kinds to have a tty_port even if isn't used
for anything else. That also cleans a ton of stuff up because then we
can always put the tty_port in tty->private_data which means we can
clean up some of the glue further.

Alan
--
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/