From patchwork Mon Jul 3 06:12:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 106878 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp5401502qge; Sun, 2 Jul 2017 23:12:39 -0700 (PDT) X-Received: by 10.80.183.4 with SMTP id g4mr13962168ede.138.1499062359196; Sun, 02 Jul 2017 23:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499062359; cv=none; d=google.com; s=arc-20160816; b=1FlnHMfm5y999dpigxRnAjJSDAml3/SHTuj7deNbm/c6MIcc8T0ozvuG/6pOP79Cic QESCQfISOteNwSK/LQL2AdMiyAiNvZjuud3SFE/SuIVj0qPfN/Iec1L6NUeQuwCmGKCk JZykgLjdkvzinmX8PChn8aGxNJN0DrvKODmyc6gH1XNHouPQW4//d1Pn2vtcnR7lD4RS VRbJpON+n6fB/Khuydu9WPERpttb2ycVv8l/hV8qYybaX6eO8Qfh3KIrjUEHtj8R4l98 F6stHjHSANkq5wfjNrcLcRsZFHFJOzs1YnsQGYiLI/OnoxqYC4B+e6fYheGat2FCuoJg vokg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :to:message-id:date:from:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=btPKuctvvGALJVWzYqm8QROj66wZUDTS5TbR1b0TELM=; b=DxkVnWh9xO3jHrkPCdE3uQbPrAANw8MguiUYzME7BizTEq5I92mtv5UrTNFGRFSQdx IjD8tVX4eWvaGmPMzCds2zbYl5SWcchd14URUJN1lQWhbtXa+rVIzeL8ucWFdToEqb5r FOCt0gvB5W7TtITp4+4JL+esZXxm8QV0Od28QnkY6dKJiFrbct0t+Agth4qsGD9agaJS EsMeUt1tvxTEgvB4XYx09UIQBzmzC/VYW9ud5eiXVqoLw1FLWHD19p6iwzVw0KQU+WFG 3FdSxKMVKmtWYVGiw7B0+JQHAJFlj46oHS79494mhYvpVMfI/IbYXctkzif61IC80TqP KDgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=wtO+aZ5Q; 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 w35si12209523eda.64.2017.07.02.23.12.38; Sun, 02 Jul 2017 23:12:39 -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=wtO+aZ5Q; 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 B90A8C21D6B; Mon, 3 Jul 2017 06:12:36 +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 0A0AFC21C2A; Mon, 3 Jul 2017 06:12:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D64F3C21C2A; Mon, 3 Jul 2017 06:12:33 +0000 (UTC) Received: from conssluserg-05.nifty.com (conssluserg-05.nifty.com [210.131.2.90]) by lists.denx.de (Postfix) with ESMTPS id 074F1C21BE6 for ; Mon, 3 Jul 2017 06:12:31 +0000 (UTC) Received: from mail-yw0-f176.google.com (mail-yw0-f176.google.com [209.85.161.176]) (authenticated) by conssluserg-05.nifty.com with ESMTP id v636CAUX019602 for ; Mon, 3 Jul 2017 15:12:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com v636CAUX019602 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1499062331; bh=lDYau82xT90UEEofFlMLn/FIB1KA+im2PefMMWYRTi0=; h=From:Date:Subject:To:From; b=wtO+aZ5Q1PL2Qjie+YAnm6t5DrlDN0pyculKgeZsJje429g/JTrMda3u6daKpvGd6 HQxe8duPDjs//iIPGYbvLbR+fEDZiFh5C2uJUKWSmSoh5LNd0aijBU3J4U4Mreko1C GajgKEMd1C7hUhagib49rc+5IyGCailrZgqfmMxWJeNF17B7zODVHsH4Kn/+7GPvIU qq/vXaW2MdsnuAbjrsbQyU/bLdN+na/O8Ly1zmcnMRJB8e2oUHA+aNdtGiN4ZB5HH+ Qjbyh1lpefgCRsQ8NisPPQW5TP4eEUVPRiq/4i0yfJSxHrYGxcrkjAusxZuGzR+s4+ E3SQvABmYafjw== X-Nifty-SrcIP: [209.85.161.176] Received: by mail-yw0-f176.google.com with SMTP id l21so58768436ywb.1 for ; Sun, 02 Jul 2017 23:12:11 -0700 (PDT) X-Gm-Message-State: AKS2vOzSY+KzkVLNHKVjTtXA2zXPHnVrR8v0TKoGZJfdNVtDQUSzop9u LP9HYosBcy3/jETY5dJvY8NDAs+kkA== X-Received: by 10.13.212.206 with SMTP id w197mr27884231ywd.63.1499062330046; Sun, 02 Jul 2017 23:12:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.49.9 with HTTP; Sun, 2 Jul 2017 23:12:09 -0700 (PDT) From: Masahiro Yamada Date: Mon, 3 Jul 2017 15:12:09 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Marek Vasut , U-Boot Mailing List , Simon Glass Subject: [U-Boot] CONFIG_USB_EHCI_HCD breaks xHCI drivers even 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hi Marek, Simon. Basically, Driver Mode allows us to enable multiple drivers without affecting each other because drivers are configured in probe functions instead of compile-time configuration by #ifdef:s With DM, I think it is legitimate to enable EHCI and xHCI at the same time, but it is not actually true. If CONFIG_USB_EHCI_HCD is disabled, xHCI drivers work fine, but with CONFIG_USB_EHCI_HCD enabled, xHCI drivers go wrong as follows: => fatload usb 0 82000000 Image reading Image WARN halted endpoint, queueing URB anyway. Unexpected XHCI event TRB, skipping... (3fb54090 00000001 13000000 01008401) BUG: failure at /home/masahiro/workspace/u-boot-yamada/drivers/usb/host/xhci-ring.c:489/abort_td()! BUG! ### ERROR ### Please RESET the board ### Here, "Image" is larger than 10MB. I narrowed down the cause of the problem in the following code in common/usb_storage.c #ifdef 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 * limited to 65535 blocks. */ #define USB_MAX_XFER_BLK 65535 #else #define USB_MAX_XFER_BLK 20 #endif Of course, this ifdef is not acceptable in Driver Model, so we need to fix it somehow. I am not familiar with that part at all, but I just aligned the value to the lowest common denominator (20) as follows: static struct us_data usb_stor[USB_MAX_STOR_DEV]; With with, both EHCI and xHCI seem to work but I am not sure if this is the right way to fix the problem. Thought? diff --git a/common/usb_storage.c b/common/usb_storage.c index 03171f74cb02..b6d16e3dead3 100644 --- a/common/usb_storage.c +++ b/common/usb_storage.c @@ -100,16 +100,7 @@ struct us_data { trans_cmnd transport; /* transport routine */ }; -#ifdef 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 - * limited to 65535 blocks. - */ -#define USB_MAX_XFER_BLK 65535 -#else #define USB_MAX_XFER_BLK 20 -#endif #ifndef CONFIG_BLK