From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753315AbbCPCxt (ORCPT ); Sun, 15 Mar 2015 22:53:49 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36363 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060AbbCPCxm (ORCPT ); Sun, 15 Mar 2015 22:53:42 -0400 Message-ID: <550645B2.1090202@gmail.com> Date: Mon, 16 Mar 2015 10:53:38 +0800 From: Peter Hung User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Johan Hovold CC: 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 V8 02/10] USB: f81232: implement RX bulk-in EP References: <1424944936-7117-1-git-send-email-hpeter+linux_kernel@gmail.com> <1424944936-7117-3-git-send-email-hpeter+linux_kernel@gmail.com> <20150314114845.GC9442@localhost> In-Reply-To: <20150314114845.GC9442@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Johan Hovold 於 2015/3/14 下午 07:48 寫道: > On Thu, Feb 26, 2015 at 06:02:08PM +0800, Peter Hung wrote: >> - if (!urb->actual_length) >> + if ((urb->actual_length < 2) || (urb->actual_length % 2)) >> return; > > Not parsing short data (e.g. not divisible by 2) is OK I guess. You > could also just discard the last odd byte, but that's up to you. > > Either way, I think you should add a dev_warn here rather than just > silently drop it. With F81232, when it first submit with interrupt URB, it will response once with 1 bytes data. The data is hw current LSR, but it useless on open. It's should necessary with receiving data. When the device is working good, it's should acked with even size data. To avoid confusing to user, I'll keep it without warning message. Thanks -- With Best Regards, Peter Hung