From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbbC0QRk (ORCPT ); Fri, 27 Mar 2015 12:17:40 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:33365 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbbC0QRi (ORCPT ); Fri, 27 Mar 2015 12:17:38 -0400 Date: Fri, 27 Mar 2015 17:17:32 +0100 From: Johan Hovold To: Peter Hung Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, tom_tsai@fintek.com.tw, peter_hong@fintek.com.tw, Peter Hung Subject: Re: [PATCH V9 02/10] USB: f81232: implement RX bulk-in EP Message-ID: <20150327161732.GG24950@localhost> References: <1426585708-6382-1-git-send-email-hpeter+linux_kernel@gmail.com> <1426585708-6382-3-git-send-email-hpeter+linux_kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426585708-6382-3-git-send-email-hpeter+linux_kernel@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 17, 2015 at 05:48:20PM +0800, Peter Hung wrote: > The F81232 bulk-in is RX data + LSR channel, data format is > [LSR+Data][LSR+Data]..... , We had implemented in f81232_process_read_urb(). > > Signed-off-by: Peter Hung > static void f81232_process_read_urb(struct urb *urb) > { > struct usb_serial_port *port = urb->context; > - struct f81232_private *priv = usb_get_serial_port_data(port); > unsigned char *data = urb->transfer_buffer; > - char tty_flag = TTY_NORMAL; > - unsigned long flags; > - u8 line_status; > - int i; > + char tty_flag; > + unsigned int i; > + u8 lsr; > > - /* update line status */ > - spin_lock_irqsave(&priv->lock, flags); > - line_status = priv->modem_status; > - priv->modem_status &= ~UART_STATE_TRANSIENT_MASK; > - spin_unlock_irqrestore(&priv->lock, flags); > + /* It's had 1-byte packet on open, the data is current LSR. but > + * in this situation, the byte useless for open. > + */ I'll change this comment to /* * When opening the port we get a 1-byte packet with the current LSR, * which we discard. */ before applying. Let me know if I managed to get it wrong. > > - if (!urb->actual_length) > + if ((urb->actual_length < 2) || (urb->actual_length % 2)) > return; I'll apply the whole series now. Thanks again for fixing up this driver! Johan