lkml.org 
[lkml]   [2009]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] usb_serial: only allow sysrq on a console port
Date
On Sun 5 Jul 2009 14:17, Alan Cox pondered:
> > If Jason's patch is necessary () - should this be fixed up for
> > standard UARTs too?
>
> I think so yes, although I'd not realised it wasn't protected currently
> ?

Hmm - try as I may - I can't get this to fail - so it must be protected
somewhere....

Ahh---

It is in include/linux/serial_core.h:uart_handle_break() - never checked the
header for the magic before I bugged you... sorry about that...

> > The above patch would sync the (seemlying duplicated) code between
> > drivers/usb/serial/generic.c and include/linux/serial_core.h
>
> There is a lot of near duplicate code like this. That is one reason for
> adding struct tty_port. In theory both could be collapsed into
>
> int tty_port_handle_sysrq(struct tty_port *port, unsigned int ch)
> {
> }
>
> at this point as both USB and serial layer UARTs now have a port object.
> That would just need port->sysrq collapsing into the tty_port.
> port->console sort of already is.

It appears that the usb serial doesn't handle breaks like serial_core does. (I
don't see any support for SAK in usb_serial either?)

Maybe _that_ is the real problem that Jason is trying to work around???


> > drivers/usb/serial/generic.c
> > int usb_serial_handle_sysrq_char(struct usb_serial_port *port,
> unsigned int ch)
> > {
> > if (port->sysrq && port->console) {
> > if (ch && time_before(jiffies, port->sysrq)) {
> > handle_sysrq(ch,
> tty_port_tty_get(&port->port));
> > port->sysrq = 0;
> > return 1;
>
> That also looks wrong - tty_port_tty_get takes a tty kref. I will check
> that Monday and look at collapsing these int one as you note.



\
 
 \ /
  Last update: 2009-07-06 06:39    [W:0.068 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site