From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753440AbbCPIwZ (ORCPT ); Mon, 16 Mar 2015 04:52:25 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:33816 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751430AbbCPIwW (ORCPT ); Mon, 16 Mar 2015 04:52:22 -0400 Date: Mon, 16 Mar 2015 09:52:08 +0100 From: Johan Hovold To: Peter Hung Cc: Johan Hovold , 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 Message-ID: <20150316085208.GA14918@localhost> 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> <550645B2.1090202@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <550645B2.1090202@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 Mon, Mar 16, 2015 at 10:53:38AM +0800, Peter Hung wrote: > 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. Ok, thanks for clarifying that. > To avoid confusing to user, I'll keep it without warning message. Yes, skip the warning, but could you a short comment about this (e.g. the 1-byte packet on open) before you do the size check? Thanks, Johan