Re: [PATCH] Input: gtco - bounds check collection indent level

2019-07-13 Thread Dmitry Torokhov
On Thu, Jul 11, 2019 at 03:22:32PM -0700, Grant Hernandez wrote: > The GTCO tablet input driver configures itself from an HID report sent > via USB during the initial enumeration process. Some debugging messages > are generated during the parsing. A debugging message indentation > counter is not bo

[PATCH v2 0/5] usb: gadget: u_serial: Fix and cleanup

2019-07-13 Thread Ladislav Michl
Following patchset makes console work (patch 1 and 4) for an AT91SAM9G20 board connected to xhci_hcd and does some cleanup. Tested with "console=ttyS0,115200n8 console=ttyGS0" on kernel command line and following inittab: console::respawn:/sbin/getty -L 115200 ttyS0 vt100 console::respawn:/sbin/get

[PATCH v2 2/5] usb: gadget: u_serial: Remove console specific alloc/free req functions

2019-07-13 Thread Ladislav Michl
Driver already contains request allocation and deallocation functions, so use them also for console_req. Signed-off-by: Ladislav Michl --- Changes: - v2: Move locking changes into separate patch drivers/usb/gadget/function/u_serial.c | 28 ++ 1 file changed, 2 insertio

[PATCH v2 1/5] usb: gadget: u_serial: Fix console_req complete event race

2019-07-13 Thread Ladislav Michl
gs_complete_out might be called before con_lock following usb_ep_queue is locked, which prevents any future output on the console. Fix that by resetting req_busy only if usb_ep_queue fails. While there also put variable access we are racing with connection/disconnection events under con_lock as wel

[PATCH v2 3/5] usb: gadget: u_serial: Fix console_req access race

2019-07-13 Thread Ladislav Michl
console_req is always null when calling gs_console_connect, so remove check and put access under con_lock as we are racing with gs_console_thread. Signed-off-by: Ladislav Michl --- Changes: - v2: New patch drivers/usb/gadget/function/u_serial.c | 22 +++--- 1 file changed, 11

[PATCH v2 4/5] usb: gadget: u_serial: Fix starving write

2019-07-13 Thread Ladislav Michl
Writing to ttyGS unconnected to host currently fills port_write_buf which then causes gs_write_room to return 0 and boot hangs waiting for connection. Fix that by dropping previsous data if free space in port_write_buf reaches treshold and host is unconnected. Signed-off-by: Ladislav Michl --- C

[PATCH v2 5/5] usb: gadget: u_serial: Use bool for req_busy

2019-07-13 Thread Ladislav Michl
Let's make code more consistent by using bool for req_busy as it is done for similar variables in struct gs_port. Signed-off-by: Ladislav Michl --- Changes: - v2: None drivers/usb/gadget/function/u_serial.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/driver