Loading drivers/tty/tty_buffer.c +2 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <linux/module.h> #include <linux/ratelimit.h> #define TTY_MAX_BUF 131072 /** * tty_buffer_free_all - free buffers used by a tty * @tty: tty to free from Loading Loading @@ -61,7 +62,7 @@ static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size) { struct tty_buffer *p; if (port->buf.memory_used + size > 65536) if (port->buf.memory_used + size > TTY_MAX_BUF) return NULL; p = kmalloc(sizeof(struct tty_buffer) + 2 * size, GFP_ATOMIC); if (p == NULL) Loading drivers/usb/gadget/f_serial.c +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <linux/uaccess.h> #include <linux/fs.h> #include <linux/usb/composite.h> #include <linux/tty.h> #include "usb_gadget_xport.h" Loading Loading @@ -1268,6 +1269,7 @@ static void gser_ioctl_set_transport(struct f_gser *gser, if (transport == GSERIAL_SET_XPORT_TYPE_TTY) { new_transport = USB_GADGET_XPORT_TTY; pr_debug("%s: Switching modem transport to TTY.", __func__); gser->port.flags |= ASYNC_LOW_LATENCY; } else if (transport == GSERIAL_SET_XPORT_TYPE_SMD) { new_transport = USB_GADGET_XPORT_SMD; pr_debug("%s: Switching modem transport to SMD.", __func__); Loading drivers/usb/gadget/u_serial.c +9 −0 Original line number Diff line number Diff line Loading @@ -880,6 +880,11 @@ static int gs_open(struct tty_struct *tty, struct file *file) if (port->port_usb) { struct gserial *gser = port->port_usb; if (gser->flags & ASYNC_LOW_LATENCY) { pr_debug("%s: Setting to low latency", __func__); tty->port->low_latency = 1; } pr_debug("gs_open: start ttyGS%d\n", port->port_num); gs_start_io(port); Loading Loading @@ -1505,6 +1510,10 @@ int gserial_connect(struct gserial *gser, u8 port_num) */ if (port->port.count) { pr_debug("gserial_connect: start ttyGS%d\n", port->port_num); if (gser->flags & ASYNC_LOW_LATENCY) { pr_debug("%s: Setting to low latency", __func__); gser->ioport->port.tty->port->low_latency = 1; } gs_start_io(port); if (gser->connect) gser->connect(gser); Loading drivers/usb/gadget/u_serial.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ struct gserial { struct usb_ep *in; struct usb_ep *out; unsigned long flags; /* REVISIT avoid this CDC-ACM support harder ... */ struct usb_cdc_line_coding port_line_coding; /* 9600-8-N-1 etc */ u16 serial_state; Loading Loading
drivers/tty/tty_buffer.c +2 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <linux/module.h> #include <linux/ratelimit.h> #define TTY_MAX_BUF 131072 /** * tty_buffer_free_all - free buffers used by a tty * @tty: tty to free from Loading Loading @@ -61,7 +62,7 @@ static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size) { struct tty_buffer *p; if (port->buf.memory_used + size > 65536) if (port->buf.memory_used + size > TTY_MAX_BUF) return NULL; p = kmalloc(sizeof(struct tty_buffer) + 2 * size, GFP_ATOMIC); if (p == NULL) Loading
drivers/usb/gadget/f_serial.c +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <linux/uaccess.h> #include <linux/fs.h> #include <linux/usb/composite.h> #include <linux/tty.h> #include "usb_gadget_xport.h" Loading Loading @@ -1268,6 +1269,7 @@ static void gser_ioctl_set_transport(struct f_gser *gser, if (transport == GSERIAL_SET_XPORT_TYPE_TTY) { new_transport = USB_GADGET_XPORT_TTY; pr_debug("%s: Switching modem transport to TTY.", __func__); gser->port.flags |= ASYNC_LOW_LATENCY; } else if (transport == GSERIAL_SET_XPORT_TYPE_SMD) { new_transport = USB_GADGET_XPORT_SMD; pr_debug("%s: Switching modem transport to SMD.", __func__); Loading
drivers/usb/gadget/u_serial.c +9 −0 Original line number Diff line number Diff line Loading @@ -880,6 +880,11 @@ static int gs_open(struct tty_struct *tty, struct file *file) if (port->port_usb) { struct gserial *gser = port->port_usb; if (gser->flags & ASYNC_LOW_LATENCY) { pr_debug("%s: Setting to low latency", __func__); tty->port->low_latency = 1; } pr_debug("gs_open: start ttyGS%d\n", port->port_num); gs_start_io(port); Loading Loading @@ -1505,6 +1510,10 @@ int gserial_connect(struct gserial *gser, u8 port_num) */ if (port->port.count) { pr_debug("gserial_connect: start ttyGS%d\n", port->port_num); if (gser->flags & ASYNC_LOW_LATENCY) { pr_debug("%s: Setting to low latency", __func__); gser->ioport->port.tty->port->low_latency = 1; } gs_start_io(port); if (gser->connect) gser->connect(gser); Loading
drivers/usb/gadget/u_serial.h +2 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ struct gserial { struct usb_ep *in; struct usb_ep *out; unsigned long flags; /* REVISIT avoid this CDC-ACM support harder ... */ struct usb_cdc_line_coding port_line_coding; /* 9600-8-N-1 etc */ u16 serial_state; Loading