From patchwork Wed Sep 16 12:57:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 1365263 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=EkdqzzK/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BrzzC0zV5z9sS8 for ; Wed, 16 Sep 2020 22:33:26 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 15D0D8235C; Wed, 16 Sep 2020 14:31:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="EkdqzzK/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8C12382356; Wed, 16 Sep 2020 14:31:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0616.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::616]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0DB6C8234F for ; Wed, 16 Sep 2020 14:31:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F0+q6egm41GTE8ZMyQmjvOIMyXsXDXRTPN6/Ler8DF1k872Uljok7/s77kJC6DmTlYXwXMOxkhztwquvvOKEi0dgGVfm0hVzB5K4QpW5IV/qIx7p+WHXFRrK5YiJEO/iIAgxgWlpGUnszvn68Fboai4HqCQgkitAu1SVL8xg1ou3Whhy2sruuvjcxf/2DjkiA3Cyg/XysnRuGb0Za5QlNij0fps77UR3DNCC3BTGBVqzsD059nPPlRHvEoQysJlcCY4ChB9FxYfPyco3i/bzyPwXHKPzkKXYHHYSYUPYaTGKqlkyfYKn+9OUCPJDWO+rYsegdZLxINBN83Xig+sqnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i+4/xpn54VNIsYzAwqKoXMA9fm5T5UhRXgydJCsxoqk=; b=eB2eQ+1Y9cJhPqGMZk1hmpSXg2VCykq77Tw+b9nMC7ygG0/txrAbWmdvWoCgEzKdp5DIq9PRW0gC47+Fc8xH2iCVU8bcn3xrMgKwITPzj1twP0HNWhufNfgSvIPcZ7ZyDCDgfPR6IvX+Ys1bk1+inPsA/tNq7OXFZ7wfXUSYcHSOf8Dmp5nnG72McFwaOWxLD/LqMCldBRDksO31USZeWaK+qMZD9jg4+x8jdrMmVsRXAAE4QsjhKTb/LvqXoZwCsZnqQJWmcLO4vsIzypSicfmh4Uaf4hztwY5x/Tkv0RpNKSK9YzDh767mhP4yJPKXvztSFDNDajXTNV2U0sMuGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i+4/xpn54VNIsYzAwqKoXMA9fm5T5UhRXgydJCsxoqk=; b=EkdqzzK/B+5gFyBE54sChUtrXvBcwSaClqV1uIX1xik4hIhhxrO+LLOhcVgUrFK6dTfyUMrabfemGlQuzy0IjiosTgMIyjCuSPL55OEWhNYdIDpZNO3AdOMcw42JPzeZXtLn/Fpl+AtlaBEWkfiv2e80gO3Os/cjGMmIxeSLC+Y= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=none action=none header.from=nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB3PR0402MB3915.eurprd04.prod.outlook.com (2603:10a6:8:e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Wed, 16 Sep 2020 12:31:28 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::39ff:13b4:4f28:1413%10]) with mapi id 15.20.3370.019; Wed, 16 Sep 2020 12:31:28 +0000 From: peng.fan@nxp.com To: sbabic@denx.de, marex@denx.de Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Ye Li , Peter Chen , Peng Fan Subject: [PATCH 09/13] usb: ehci-mx6: Fix USB QTD data buffer error Date: Wed, 16 Sep 2020 20:57:01 +0800 Message-Id: <20200916125705.4341-10-peng.fan@nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916125705.4341-1-peng.fan@nxp.com> References: <20200916125705.4341-1-peng.fan@nxp.com> X-ClientProxiedBy: SGBP274CA0023.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::35) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SGBP274CA0023.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b0::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.13 via Frontend Transport; Wed, 16 Sep 2020 12:31:26 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c3102c12-f348-4349-46b7-08d85a3c6f61 X-MS-TrafficTypeDiagnostic: DB3PR0402MB3915: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LOGFnGY0JKnpfelbHDKXXe0OHsBn2CYSISFOuzO3PyJK7GzUi9Z1C4771jr4WeYwNTVFZ8Rrutph3LTFMv0NDPLyqYKTpF228F3ZyhYynx9yThRC8YgB/P3XDBJzb5JSuGxeJmUzxm/GLSaxBdVDk48c1ei7bSj21V8YQOEuVEclXdKlCSzxWMFuD56Z5HS3I/8QjGn8SdWAiiSstH5iHPeHUS8jskDTHIEbXQO0Z1liu2dxsDVrGDomKUUR/ECZb78Cpy1oegSmPs06pNomO/SAYxAyRnxPpTOE+bRJAO7PvKPCd4WfRRa2cRd9d9MwHfHm22NefuiDsiKsKio0yA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(186003)(16526019)(6512007)(8936002)(54906003)(36756003)(6486002)(2906002)(1076003)(6506007)(478600001)(2616005)(956004)(5660300002)(6666004)(83380400001)(52116002)(316002)(86362001)(4326008)(26005)(66476007)(8676002)(9686003)(66946007)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: f6Yr0At7b4RZu5DbvCWHPb+H3KJlXTNNH1VwbmrS1vAwUjYLEMYWbBnwbdNybGOP4Fw4RgXnWZEbDrxyXJpT4qYtPxhiqHaSiXpGKwTiqF0fUJmNDS3Oj0WTjReFg5+1hr7TdllkzMOS5h513AIT/xRddELRAcI+hZ/ndnoQZQjIwFyPPX8gTP5d5nseFjxDtVIRJ6fB/OwjReaYR6t6gu9Gem/9DKS61C2mJfAoy+Z7x3rRbb/FnzZcNtthEVQ1HDwatooVF2oDvSiP+adxDyo6sKqI5an1pq7QY83aGEo4kI6FrG6CqBU8gVh1rPksspnsrYlUkruqeLe7Wfrc9QgRGjYURZTqS571TKFSUt/SgsOfvG85ecBPHY+LYheGPwD95GGxTCvL6k2TdD1xkEt/VWXM9iWH+eJ5We2Sd6A0VGT2I57x9o1i12DX0VsSayYIR8tGZGc7tZeMqMmFdEfGNODzDMDBlzuM+buRioLV53yFubK1bRnnjD9YtJEs4eWTdJIwe7nFLcS0FhqkllbfYskuQt5ltlcyZKL+ey6HV0YJldoAjzsSYkNV/AeECzMUrwAANZpaW8pXtl1xMBxuAYHWHRj1hbmwQpYMch7oZvLXJWHo6emn/xe1bVFUUDqxvNwEYv86uCFi9hgccQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3102c12-f348-4349-46b7-08d85a3c6f61 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Sep 2020 12:31:28.8247 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RSbNevIjayN3dAt5xrzfoH3ApljWyuen8ySDlXMgd3KKuBJwIBMP19XTuCQ+exvJzg7xNbmdwib1z/jI1a/vvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3915 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Ye Li Some iMX6 platforms will meet "EHCI timed out on TD" when reading or writing data to USB disk. The root cause is last QTD reports data buffer error. Accroding to RM, this event indicates that an overrun of incoming data or a underrun of outgoing data has occurred for this transaction. This would generally be caused by the host controller not being able to access required data buffers in memory within necessary latency requirements. Follow kernel's method to fix the issue by disabling stream mode Signed-off-by: Ye Li Reviewed-by: Peter Chen Signed-off-by: Peng Fan --- drivers/usb/host/ehci-mx6.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c index de0b0c3156..aa0c1c355d 100644 --- a/drivers/usb/host/ehci-mx6.c +++ b/drivers/usb/host/ehci-mx6.c @@ -488,6 +488,11 @@ int ehci_hcd_init(int index, enum usb_init_type init, board_ehci_power(index, (type == USB_INIT_DEVICE) ? 0 : 1); if (type != init) return -ENODEV; + + if (is_mx6dqp() || is_mx6dq() || is_mx6sdl() || + ((is_mx6sl() || is_mx6sx()) && type == USB_INIT_HOST)) + setbits_le32(&ehci->usbmode, SDIS); + if (type == USB_INIT_DEVICE) return 0; @@ -542,6 +547,10 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev) } #endif + if (is_mx6dqp() || is_mx6dq() || is_mx6sdl() || + ((is_mx6sl() || is_mx6sx()) && type == USB_INIT_HOST)) + setbits_le32(&ehci->usbmode, SDIS); + if (type == USB_INIT_DEVICE) return 0;