Messages in this thread | | | Date | Tue, 21 Oct 2008 23:47:28 +0100 | From | Alan Cox <> | Subject | Re: [PATCH 5/7] kgdboc, tty: use tty open to start low level drivers |
| |
On Tue, 21 Oct 2008 14:14:51 -0500 Jason Wessel <jason.wessel@windriver.com> wrote:
> This patch adds two new hooks to the tty layer in tty_io.c to allow
Gak
> A few minor changes were needed in tty_io.c to deal with the fact that > the inode and fpath.dentry were NULL with the generic flip structure.
Gak and more gak
> + tty = tty_driver_lookup_tty(driver, NULL, tty_line); > + if (!tty) { > + tty = tty_init_dev(driver, tty_line, 0); > + inc_tty = 0; > + } > + (*filp)->private_data = tty; > + ret = tty->ops->open(tty, *filp);
Digging deep into tty innards (some of which btw are going to change)
> + unlock_kernel(); > + } else { > + tty = tty_driver_lookup_tty(driver, NULL, tty_line); > + if (!tty) { > + tty = tty_init_dev(driver, tty_line, 0); > + inc_tty = 0; > + } > + (*filp)->private_data = tty; > + ret = tty->ops->open(tty, *filp);
and with the error paths wrong
This is to put it bluntly just horrible.
Really kgdb, console and other boot processes need an abstraction for tty device ports at the device (not ldisc) level and until that work is done there is no acceptable way to sort this out. Merging gunk like this will simply make the existing mess worse and provide more crap that will make it harder to fix properly.
All this stuff needs revisiting when every tty device side object in the kernel contains a struct tty_port, until then it's a nasty (perhaps neccessary for the moment) hack that belongs out of tree.
Alan
| |