From patchwork Mon Mar 4 08:42:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vasilyev X-Patchwork-Id: 224649 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E197C2C0587 for ; Mon, 4 Mar 2013 20:13:22 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 08BA94A01C; Mon, 4 Mar 2013 10:13:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eYI9PbFcOL3E; Mon, 4 Mar 2013 10:13:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 999564A01F; Mon, 4 Mar 2013 10:13:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 91C7B4A01F for ; Mon, 4 Mar 2013 10:13:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BcsMrJD8PgRx for ; Mon, 4 Mar 2013 10:13:14 +0100 (CET) X-Greylist: delayed 1420 seconds by postgrey-1.27 at theia; Mon, 04 Mar 2013 10:13:12 CET X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ia0-f177.google.com (mail-ia0-f177.google.com [209.85.210.177]) by theia.denx.de (Postfix) with ESMTPS id 0EDC94A01C for ; Mon, 4 Mar 2013 10:13:12 +0100 (CET) Received: by mail-ia0-f177.google.com with SMTP id o25so4535576iad.22 for ; Mon, 04 Mar 2013 01:13:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=fXc+zx94jhAWi6RFtNxXBk52XigNVlEClGpxIaQvr8Q=; b=GLewlpM/+hRkBa95fCedQoBclcjOhbPuj51X1T2SnXnUgE6V9ZXKMAlJkB1BHkM5QJ JD6HnGk48bet5hQIsV0SukwGZZkM8UiOHh3eGUHLUfd2sZKOcU8j/DnuHR2/+DJKcjKA Ud/a0U2r8LEvRxJQ8mjxGUhARGrC0QZoq1o6My0CYGD6gbH8KiVAFIfDPW+yD0UzSIvg hscQqQOWXiay2644x5aLRQOCW1Fk93hdHOSns5Ft+r4Z/o/K1vWT3WJDorO9EFiNJ/zd H/G3fl/ccx4v4SUiC5dc/iX9YPvU/Dfef2rEYrUeUlwJXwGw9lu/aM6bBVF03O2hTbDd nENQ== MIME-Version: 1.0 X-Received: by 10.50.178.33 with SMTP id cv1mr1779684igc.4.1362386532788; Mon, 04 Mar 2013 00:42:12 -0800 (PST) Received: by 10.42.210.70 with HTTP; Mon, 4 Mar 2013 00:42:12 -0800 (PST) In-Reply-To: References: Date: Mon, 4 Mar 2013 12:42:12 +0400 Message-ID: From: Anton Vasilyev To: u-boot@lists.denx.de X-Content-Filtered-By: Mailman/MimeDel 2.1.11 Cc: marex@denx.de Subject: Re: [U-Boot] problem with USB storage STALL status X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hello, Separating DATA phase and STATUS phase by mdelay(1) helps me solve current problem. &actlen, USB_CNTL_TIMEOUT*5); I din't find any explanation for this delay in USB specification, but at Linux Kernel I found similar separation (drivers/usb/storage.c): /* Some USB-IDE converter chips need a 100us delay between the * command phase and the data phase. Some devices need a little * more than that, probably because of clock rate inaccuracies. */ diff --git a/common/usb_storage.c b/common/usb_storage.c index fb322b4..ea88536 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -740,6 +740,7 @@ static int usb_stor_BBB_transport(ccb *srb, struct us_data *us) st: retry = 0; again: + mdelay(1); USB_STOR_PRINTF("STATUS phase\n"); result = usb_bulk_msg(us->pusb_dev, pipein, csw, UMASS_BBB_CSW_SIZE,