From patchwork Thu Jul 13 13:35:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 107681 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp2281330obm; Thu, 13 Jul 2017 06:36:30 -0700 (PDT) X-Received: by 10.80.222.138 with SMTP id c10mr2944510edl.97.1499952990525; Thu, 13 Jul 2017 06:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499952990; cv=none; d=google.com; s=arc-20160816; b=RF9M2S0oc1DRiGmbdRMDgzBWJV7pGTJ8MCvLOS7ruyDLuWUMQoiZJdgYw60aq+Moo9 ZYjP4DVucKw2oYC0M4ovXT01iPA9QQrbKnSY2Zc/mUHTSZXRv/MU2mv0EfK705OeNuCU 2oR/1fsoSRIXxVr0QEAar/whNGcQgyxCVlgWcy/QPrSfaSh6rDWBEtVInFQWUsUreNSC pNPmiLA7UQhWkigZkGx5qpix7dAficwBbpMFLNig+4il7xpBkUKLG0N2ELTF/neVgDag zjttGmfXVLKCVGLJWvHj/yW1cQRJ47zip6UE1qUobuQgYN0xlT327LxCPFic+8lgH/JR CFbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=XOC3iNLwe/63u25pMOltAQbKL7PmCiMGcncU1N9fxAg=; b=0YlsdvyzK2XMBpSAtee1i5xQB8R15zW8X7TGv3Cscagt11Ui9vL1eOKl3ssdMsPgG7 ixPToG3X1CCKEN5VTO7wJmsn+YGUnnh+2aZtAMgYUrU5jgwvDSsvyMR/WnOp0JTf066B dmV8DpnjhIlMnp7YPYLS+L5v6zlgZEca316u24bLA+NTIO9g0hZIFnb+iVdZhr0vxshR GGS7d0CODWD9EUZ/Ccza8I5fi2L22VQSBH7ICSUUJm6OmZdjxLIblBqXCEHODhlcbwTK 5mT0LZ6fDu/AGfShlgPFRzVm1JHhNPibk87ZkN2QtcCvrxN70QB4o4qxRDXZFZ0wCglB 8eLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=RVQOx/qI; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id x60si4432469ede.333.2017.07.13.06.36.30; Thu, 13 Jul 2017 06:36:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=RVQOx/qI; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 05575C21E4D; Thu, 13 Jul 2017 13:36:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 673FDC21DF8; Thu, 13 Jul 2017 13:36:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C4CB3C21DF8; Thu, 13 Jul 2017 13:36:23 +0000 (UTC) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lists.denx.de (Postfix) with ESMTPS id 4A5ACC21DD7 for ; Thu, 13 Jul 2017 13:36:22 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id v6DDZXPP008781; Thu, 13 Jul 2017 22:35:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v6DDZXPP008781 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1499952938; bh=dYjt9Hou2uwCjzKcXkRoOIFMEDa7z63WGPobPyL6XZE=; h=From:To:Cc:Subject:Date:From; b=RVQOx/qIBsHveDqp6o/NFecR6OS6wydfp14/zom4XQnLZH8OFG4JWw9yoM50NOsY8 oiX9cKsxKXwvy8PxkW7P6kRIJzIv8k0mBYcxC4C7PlDv9QNWffnR6sIu5psIdPADw3 qwCdJ45+92AMxG9rhdZJV8LkHcBymFK/w+lvmAM9eFS0nCgmMz1P4CtxnRmOlJcKzu Fw4Lw5GcZ0PH5F6rneJfbl+DVVNWXF9XsUm7RJ2bJhXlebz9g1JUJ3b3YW0WXUauk2 +cENo36tyThHWezNUIeSPWi3DhZhUSy7gkHF9+exJjFH2Qe/oPZYwoaZDyLRgHa0Eo hDJSQ7ZJxr/sw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 13 Jul 2017 22:35:31 +0900 Message-Id: <1499952931-19122-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Marek Vasut , Michal Simek Subject: [U-Boot] [PATCH] usb: fix usb_stor_read/write on DM X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Prior to DM, we could not enable different types of USB controllers at the same time. DM was supposed to loosen the limitation. We can compile drivers, but not working. For example, if EHCI is enabled, xHCI fails as follows: => usb read 82000000 0 2000 USB read: device 0 block # 0, count 8192 ... WARN halted endpoint, queueing URB anyway. Unexpected XHCI event TRB, skipping... (3fb54010 00000001 13000000 01008401) BUG: failure at drivers/usb/host/xhci-ring.c:489/abort_td()! BUG! ### ERROR ### Please RESET the board ### The cause of the error seems #ifdef CONFIG_USB_EHCI_HCD in common/usb_storage.c To fix the problem, align USB_MAX_XFER_BLK to the lowest common denominator if CONFIG_DM is defined. Signed-off-by: Masahiro Yamada --- common/usb_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/usb_storage.c b/common/usb_storage.c index df0b05730879..fa0cf68c3353 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -100,7 +100,7 @@ struct us_data { trans_cmnd transport; /* transport routine */ }; -#ifdef CONFIG_USB_EHCI_HCD +#if !defined(CONFIG_DM_USB) && defined(CONFIG_USB_EHCI_HCD) /* * The U-Boot EHCI driver can handle any transfer length as long as there is * enough free heap space left, but the SCSI READ(10) and WRITE(10) commands are