Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbdIKKAp (ORCPT ); Mon, 11 Sep 2017 06:00:45 -0400 Received: from mail-dm3nam03on0056.outbound.protection.outlook.com ([104.47.41.56]:7552 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751151AbdIKKAn (ORCPT ); Mon, 11 Sep 2017 06:00:43 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=nxp.com; From: To: CC: Mathias Nyman , Greg Kroah-Hartman , "open list:USB XHCI DRIVER" , open list Subject: [PATCH 2/2] usb: host: Implement workaround for Erratum A-009668 Date: Mon, 11 Sep 2017 17:43:27 +0800 Message-ID: <20170911094327.38520-1-yinbo.zhu@nxp.com> X-Mailer: git-send-email 2.14.1 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131495976414217597;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(50944005)(50986999)(1076002)(7049001)(6666003)(106466001)(8656003)(47776003)(68736007)(105606002)(5660300001)(50466002)(498600001)(5003940100001)(551934003)(104016004)(33646002)(36756003)(86362001)(54906002)(48376002)(85426001)(97736004)(81166006)(81156014)(86152003)(2876002)(8936002)(4326008)(53936002)(2906002)(50226002)(2351001)(356003)(77096006)(189998001)(305945005)(6916009)(110136004)(8676002)(6200100001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB3319;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD010;1:Vl46u0seoEjdCVGj2zSnbMPI1oS/GfQWzIMgj5GG2Csq85M7E4SQ3lzMHvg7cpsQoIwgrVVxnmrF9yME+YpmFeJj20HGc9/6okCtrOlrkr++5EzmqkjVd0fLXiTgxglt MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e54eb6b-9b49-43f1-057d-08d4f8fbf607 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR03MB3319; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB3319;3:Dby24Z4Rqiy5FcTBcQpoaYfumGcg+ShGIwWvxGRhvzB3MNolAGWSdON8m1LYesfUm3UE5HaU5quwLJK6vVSzq7kBUy2uqSHDcyzOEhorDAAaDHd+ElttxCYAjoWH+7uemz2ooPLEHSL0/up2jHA20Y+9fd64biig7BPTfl304tMfBIuj3alAuH4HO2tm3BhaYdxN4ITHjEwQa3gK1vCojYhj/JaFf92QtJtJEiSuYe8LKNXx6sviddZ0jfN844XvqV3vf5dn2ewvEUo+BN4I8GBaamDQNYzmHtEA5m1BAkr1m36WfXcX1/MrBeXIV9Kc7zLCKdphg4IR1MVKFFN2WIcstVqGXacE19EoyxqhYJM=;25:OT4K2yLPe8oMlXLJBVhF/6KSCOV+VhGj7oFXjL1i9GWxrzc3Fn2BYTU2ZblgT9tE8c3BuZVIj93b4j8JRw20uf/KtkhTEC5HZ1RJN56KsecPUPR/T3PCaP1aDNPdQQgExuLYoT9sjw8LQZt/mVZHDxQ62MxbDaNytZLKldZYlq5MJhoIHDu/S9NtzAS5uThxT4ka8jD4n72UE7f4SDUwX9vKiqUyBmUrtwDfN2gwHoCOfHBJdI9sNh02XS7BGEft8Ibe11LTsL53uDj3/chapcfC7WU36/pCX4n/ikM/CUhRuKrizquq7W9DFYzTmky5B4eiKE5eE1zvtCuj3VA38g== X-MS-TrafficTypeDiagnostic: CY4PR03MB3319: X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB3319;31:DlZ1bDqIQw8Mth7Zon+lxqpL4fnFmNssWBdN5BoIzPu8+PgwZ/yS8oIXHwlaATmMALkeDyjsACfL1PheqzbE1WDLsFYBLfkRd+eGQriE1ghfdc5x/NZf4pQbLY7BtvTiPAzC2jnX/zF7i6QoFQu9ViUZh2fFnaPbXKWT+KW+q3K9czYQb/X5TWbQ2g+E4XeoPnA1HqiPw/eLLmzNstpuoM7Ca1dXG/OjMoajs7AIXTs=;4:d1ru5RiQWt9SzM02Q2RJ7OCpg9BeFIigjBYfV/6CE1lBjjMrKNCz9Y7956vOuU5WuBy05QFiQpxQ2TEz/1sr+MPXPTxtmKm9qackdDP0L4UAGwtpeqjheRCDxGtb9kh8epjbXswZW0dH7O9QVJ0TU20lXx4tCf8D73g5RolFKBwKvv5J7CrDj6XL8leDtB5c/cxLmmOZ5Tx+rMf++ChbjPZ7WTnBlleEDqzkJf52Qezw51pmWTcoNgz0HSWmT7KegEd0jq/3cF2olz7+vrX4UP6w471dSl0kjzT3a1KvzkA= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123565025)(20161123561025)(20161123556025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR03MB3319;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR03MB3319; X-Forefront-PRVS: 04270EF89C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB3319;23:WV+IYiwxOgZyfNicksm4kIeeEE32JmeLp1EhSnpeO?= =?us-ascii?Q?sV4X8Q3gDzpSAyROIUNUmCqO/S6Pli8Yuu38XYRJEsA6PV1sRnfJT+TH6Gje?= =?us-ascii?Q?0qG2Bcnc9/cnOQo4bYNrWSVRjXxW5xKxuDBW6kYtIq6yB3YSATv9s9w0G9tM?= =?us-ascii?Q?W2bvLzUT8hZHZ+inA4LmwzQNocxb8cDEOwSeqgUNwokCJMXl+UHPQ7a+CElm?= =?us-ascii?Q?jwEc+7mPS4e5OyKQBeE7OwWq0b8d0ExORhaBba0qIViUgfo0qdQR2Y+Neyfq?= =?us-ascii?Q?yMQjQ4jxHuYLk4G3tD2zKHd8+EFpC0oBQ9z3sb+3z25A6pyPCMgLdXxHEPc6?= =?us-ascii?Q?TINttIeqJKu6iXVPM5o7T1ltyDCi0SBV4kmDoZHNHUnzaHuCYLbJ0XeSa2eq?= =?us-ascii?Q?Z3qFsbYaMbn7key9bMqGElanx8+J+hWpT7wd3k9gn/vydPcfUDyQ8WGlFty9?= =?us-ascii?Q?+dZ87EK8xkSf26KUpzDmzdv8FJFDumWjQUhKg2E1f0+jcwRb+c9vkk6A+TGg?= =?us-ascii?Q?70lrfChSzjrRdToR6KxPSSPgvZBD6f635E/7aIIAXchNtX/Lcm5cEWKornxw?= =?us-ascii?Q?1EXp+bKuITe8guMgGVa3fRDGjqMy4//nBrVBixnkBCpLTIP/8PpPJI1nSmsF?= =?us-ascii?Q?9Vh0bVZZnsBJXtDC9yzasZCEgLxF+A2aVBBD4Bj/v6WEqgHkyla2MkB6Spo3?= =?us-ascii?Q?3DkchxZu0oebh7UswUSzwaB+hVkBdMvp/17gv3XXn7bX7auDSAJU8qGZz/jP?= =?us-ascii?Q?N7hKto51LKkN9DQdHOlkeJO0guNagEje0SYOf3oDIv1VgcVl2eYGWsUva5Os?= =?us-ascii?Q?qGX9zBbwvp41Hu4dO/lpJZzT80nhQGZ/ZGZSCKzcpyTi49OzpZ2GIWL6o8zc?= =?us-ascii?Q?aIaYIUwY3KNye5xo3R0N9ItzfuAaUmkHd6jragXDSXQJT8GADElqX8kU6US+?= =?us-ascii?Q?AWXAua/kv4vs6U5X2Fuln1rls6VGNznXGVf6TbzafLQ1PXbHpe99ABeZgKm5?= =?us-ascii?Q?cyJJWvQM8bN+6nKoLnp7D9XXLworuu64bnh1VivXaZPdUpqLR33XFMOmoGKQ?= =?us-ascii?Q?Ro6TttxwlfrWkxqhTSyVd7np76baJoXd3QYIHxxo4iJ62jZQbg0c9pus7wNg?= =?us-ascii?Q?/Jf5W678zx3ootWuXRgHKmXzibUOD97bHSI+oevbnI9sNtoON+nQpUBWfTtJ?= =?us-ascii?Q?h44KIPufBdONrS3vbaN31dQ/iE7Y9rkTVQU4Brhdv8d+Tn806JikAqFog=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB3319;6:kkkPGxKKMtYtN8tnxxUw3s4urtRYbr+Db4GPRRV/nZiBRVnTV9MwwRRs4+FiplAk1C2mb8drJFZTfsRu/tPL5kWWt2BfKOC52na/ud1lKmr0eIlaEBbPNZZRYAtcBElmbsYnx/X0RmI3roDEiK3/5W95c7h+eRwIsrgg7UrJXpY0lumpEn10gim61VDhpKGsRMHoZkFuq4BOfOknGfjJTu9vLHYAR869eN2EazoT66PTRuncd6mf10WK7Z1q9cjqcAgzUknMSma/jXExskv4krM/X5Bfmp4zCqWYSrrYguJrXmjSsIpqRUk/pTBb0Gq3bYsJy/+gELD2QUoeB11ohg==;5:dplwbnNOGBrvyh1YABx5XhskAeEG88hP52Cz4jYooERF76Icku4qVGxFE7qQm/1Z+0uBr+sNSq/tWXbYTiinVhsKGsixvMEBV6fOUxe0FmcsWMxnDb769gWF5yVa4xBOPkeQ9m5mchJ+oxbYdfZl/A==;24:z6Hwctdh1dhDDToB+xRVBJOevaFuMA0LwEhsNr79bRQ5A5W8eqgRaqJ40D1bVuH8RVayvQ6EZbusHdcngNyDKjswbqMVpwlJlSnBuMZlsyw=;7:MS6dkXXB9e3RoaSdScvSsiXiZwo/LuUFQIpThVdibfS2DRUcPBErpx5VYmz4xSDn4KwmuanhvlqPQGyX/T6edIc/3Ktf9CRHaVbThl1KSkZGCsAlKe8AdNAd35rAVnL+QfpZ2S+ckY+Tjga4c0YcvyQAqcqfzm1uYGxgeAfBaq/Rf2MY7kxnmnmi25SqIqZdSqVsYdn9vT+8wkNu6L5viOwW5HBYla3aLFl/TGglmQQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2017 10:00:41.2501 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB3319 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2722 Lines: 70 From: "yinbo.zhu" Description: This issue is observed in USB 2.0 mode when the USB 3.0 host controller is connected to a FS/LS device via a hub. The host controller issues start-split (SSPLIT) and complete-split (CSPLIT) tokens to accomplish a split-transaction. A split-transaction consists of a SSPLIT token, token/data packets, CSPLIT token and token/data/handshake packets. A SSPLIT token is issued by the host controller to the hub followed by token/data/handshake packets. The hub then relays the token/data/handshake packets to the FS /LS device. Sometime later, the host controller issues a CSPLIT token followed by the same token/data/handshake packets to the hub to complete the split-transaction. As an example scenario, when the xHCI driver issues an Address device command with BSR=0, the host controller sends SETUP(SET_ADDRESS) tokens on the USB as part of splittransactions. If the host controller receives a NYET response from the hub for the CSPLIT SETUP token, it means that the split-transaction has not yet been completed or the hub is not able to handle the split transaction. In such a case, the host controller keeps retrying the splittransactions until such time an ACK response is received from the hub for the CSPLIT SETUP token. If the split-transactions do not complete in a time bound manner, the xHCI driver may issue a Stop Endpoint Command. The host controller does not service the Stop Endpoint Command and eventually the xHCI driver times out waiting for the Stop Endpoint Command to complete. Impact: Stop Endpoint Command does not complete. Workaround: Instead of issuing a Stop Endpoint Command, issue a Disable Slot Command with the corresponding slot ID. Alternately, you can issue an Address Device Command with BSR=1. Signed-off-by: yinbo.zhu --- drivers/usb/host/xhci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 35f7821bc8b2..62d6135ad428 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1517,6 +1517,18 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) urb->dev->slot_id, ep_index, 0); xhci_ring_cmd_db(xhci); } + + /* + *A-009668: Stop Endpoint Command does not complete. + *Workaround: Instead of issuing a Stop Endpoint Command, + *issue a Disable Slot Command with the corresponding slot ID. + *Alternately, you can issue an Address Device Command with + *BSR=1 + */ + if (urb->dev->speed <= USB_SPEED_HIGH) { + xhci_queue_slot_control(xhci, command, TRB_DISABLE_SLOT, + urb->dev->slot_id); + } } done: spin_unlock_irqrestore(&xhci->lock, flags); -- 2.14.1