From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754401Ab1JNIv3 (ORCPT ); Fri, 14 Oct 2011 04:51:29 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:50713 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754228Ab1JNIv1 convert rfc822-to-8bit (ORCPT ); Fri, 14 Oct 2011 04:51:27 -0400 MIME-Version: 1.0 In-Reply-To: References: <20111012141724.GA17414@suse.de> <20111012203337.GA14572@suse.de> <79856.1318571233@turing-police.cc.vt.edu> Date: Fri, 14 Oct 2011 09:51:26 +0100 Message-ID: Subject: Re: [Patch] Increase USBFS Bulk Transfer size From: James Courtier-Dutton To: Markus Rechberger Cc: Valdis.Kletnieks@vt.edu, USB list , LKML , Greg KH , Alan Stern Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14 October 2011 07:23, Markus Rechberger wrote: > On Fri, Oct 14, 2011 at 7:47 AM,   wrote: >> On Fri, 14 Oct 2011 05:42:44 +0200, Markus Rechberger said: >> >>> The inflexible device which uses 24064 bytes works with all other >>> Operating systems by using that value >>> and gives exactly the same results with other transfer sizes than that. >> >> -ENOPARSE.  If it's inflexible, > > the particular device in question is inflexible yes. > Here is what I think the actual situation is. Your transfers over the USB are done in 512 Bytes chunks. If the device wishes to send 512 bytes, it sends one chunk. If the device wishes to send 513 bytes, it sends only one chunk, missing one byte. if the device wishes to send 1023 bytes, it sends only one chunk, missing 511 bytes. if the device wishes to send 1024 bytes, it sends two chunks, missing 0 bytes. So, the device is sending 1 too few chunks unless the bytes size exactly matches the chunk size * n. Another constraint is the device sends multiples of 188 bytes. So, unless we can find a lowest common multiple of 188 and 512, there is no transfer size that will work with this device. The LCM is 24064 and this is the only value that will work with this device. Conclusion: The hardware on the Linux PC and the kernel on the Linux PC are working correctly. Your external USB device has an off-by-one error in its hardware/embedded software and the hardware/embedded software manufacturer is not prepared to fix it. Workaround in software: Increase MAX from 16384 to 24064 or above. My own feeling, throw away this faulty bit of hardware and use a different part. The hardware is not compatible with USB standards. Kind Regards James