From patchwork Fri Sep 21 13:22:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Singh X-Patchwork-Id: 10610025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8332B112B for ; Fri, 21 Sep 2018 13:23:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 652BC2DAB2 for ; Fri, 21 Sep 2018 13:23:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5932B2DABA; Fri, 21 Sep 2018 13:23:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B55DA2DAB2 for ; Fri, 21 Sep 2018 13:23:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728384AbeIUTMJ (ORCPT ); Fri, 21 Sep 2018 15:12:09 -0400 Received: from mail-by2nam03on0071.outbound.protection.outlook.com ([104.47.42.71]:40208 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727392AbeIUTMJ (ORCPT ); Fri, 21 Sep 2018 15:12:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NX9R8T1arf5VGyM4jMLNKLOwuRwq2nNpNYzB91AKS3M=; b=fCsd8QCxheTpoGv6eba0BIu28Fc3YBtNfhFO5fYj9k5i8NwYt4urNP0UQvsiw+gQXzoWY9FjQ+pH57w7e0s9uojdURCRsoM6+NTWSuaFHoHLh3ywsZYo0YZ3v/p3uSaMuuj2czsotBTGXerdeKW8BZpRu0m2ei8mummNMXc6Hec= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Sandeep.Singh@amd.com; Received: from andbang2.amd.com (202.56.249.162) by MWHPR12MB1661.namprd12.prod.outlook.com (2603:10b6:301:11::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Fri, 21 Sep 2018 13:23:09 +0000 From: Sandeep Singh To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, mathias.nyman@intel.com Cc: Sandeep Singh , Nehal Shah , Shyam Sundar S K Subject: [PATCH] xhci: Add check for invalid byte size error when UAS devices are connected. Date: Fri, 21 Sep 2018 18:52:29 +0530 Message-Id: <1537536150-11721-1-git-send-email-Sandeep.Singh@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: PN1PR0101CA0009.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::19) To MWHPR12MB1661.namprd12.prod.outlook.com (2603:10b6:301:11::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36b9de12-37f4-486c-b59a-08d61fc56108 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:MWHPR12MB1661; X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1661;3:ofWTVbdx3xio6SeRuekm4Z9VFpV0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aBDTSnq79bu8mgfj6A8td4eI7JJ4Q4D8t17YHBW2RERFFEYJ+GYvqhDsqkDLKCoAmnNEEIJKq7dpN6ybJopT7tC2AZWVbimdzcRa2s89rMWbFxLoiz4wQlkslgKAIYM+cnauQf/syZDY8vcgHZSFJgXVKTrLp/yo1Gk+BYvWDnH3VJwJxPoaRlnj4UM18D8SFGCnwIyUcdsTbgQNATlCO2/h0cMAu1veTqsy86ZgXEAYY4GfdfOteirpI5XVBLGnNcTCsra7ESuEJFEHjP3NAOjK/lOP4t6altKPJtl09QMDfxpbn0zF6;4:YWLdm+/b5F0WDx0qWqDkDr72FaQDwY2TjSxgR3sM/0xRcP5aCWKvckb32G5GydFE6OFYGYy1DvmI9r3Y7qvArXVkTurUQIOfpbwbeWR/8M+tXFmJpV4Ri5aaELXDY6sqoSed85IwPSTU6jePl4zhMRJKBoMzaYB8C70WS8aAMcX3Fdrxs25LhRGrHLbXGMjiDQAdNOEUSkbmrJr6dVVwC3e2R/Yy65S7KLKU0cYBc1zXsaX7S0y0m0FtZNWG4spFeksVomoatjHH7vIsB0K13bBoMB8nzkPe04M3dbqq46XGXM7zb6EygVxWjmrWHZe1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051);SRVR:MWHPR12MB1661;BCL:0;PCL:0;RULEID:;SRVR:MWHPR12MB1661; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(366004)(199004)(189003)(53936002)(5660300001)(4326008)(68736007)(2906002)(36756003)(47776003)(105586002)(106356001)(3846002)(6116002)(53416004)(25786009)(66066001)(6486002)(16586007)(54906003)(316002)(51416003)(7696005)(52116002)(72206003)(478600001)(956004)(476003)(97736004)(2616005)(305945005)(48376002)(486006)(50466002)(7736002)(50226002)(16526019)(186003)(81166006)(8676002)(26005)(575784001)(86362001)(8936002)(6666003)(1857600001)(81156014)(386003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR12MB1661;H:andbang2.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1661;23:eUXyCyGLpXI4HpUsgxxQDtK3/AdActqepcV7tTzL0nNsWX+aTM9AB3W99/f8BzAKcK9EkV31meacOaaWBucr3prD4zRwibczVznlzYf8abPkbBI1XLe3MClf/acdUjEu60kQDJIQzHgIBLIvPnLtRo9qubKnjRaKdpijuDyBrsbFH4mIk+62Boy3PZ721P1z7Hb9SEf3/0rLB8Rwp8MKkRL9NuPslgLgHDYzzVQ7In4qWPuWIhrfirzODrY/4JE2wleAOC8gtIjOk3s9Ig0Qo/KErOR5gqmXqtr8KUQZjeoQmMTIn301RldVzvehp29MNurRKuFiqoWC+Hg+EC2CnbuG14O7o5qc9GtzF1TrCHPlWeYdnvmh0Pv3Pq2NBh55IUJtanOYw/HqeRHCfhvnKy2MwXZfuwE9EdnUoI50uevFw7KSX7fdgE7jQ4vaPFuInagXQQRLJ6nlNCIeXQnPaURESH+nP6zJMNJ5zYnQIRGexfzPKVS3ZCVCMShzO3NPj/4neKLgmjklM33ysOC94z392l1RuY4Atr+kdlWXhAs4mBdYDVgtkGn/sw0JCwN8UY4ahnYHfScZkZS9V71+T2SNC6y5hRgD2JqR/GNMu/J0s/xQMzV+dWXmPbh1uxwd+visFuuqCsb9th3TkXkJEAfk1bTHgHFnFwHZRAM9Sv2PZmKKGgg7JPK2zsYdfo7KxMlJj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XfgQMM55ncTYHnKVlp2vNXsU0qqh5DmbVwaX8w6Wv3RePU3+1GCfuYI0SLmQAHIhTzqBhgP3furhz2Zh85OVjAeH58Y3o47xIKy6ZGr6lItWZpnVqd0MbjwGqwXus0/md+efStFVSv8OMeaShQSGJ3/F9Z2WH+9qclhz+Je0g/hVOEfg4YmzEgYD4rMQGKoxIojSNVg378QZV1Dw6oJcDIEfe/XQv36vmqvbJ8Ro4tt2YZ3jOsiIf/wypAY5lPdbvnGuarStjo0iwYCQ02gvNsY5d+kPusskFDp69vfc+R0sw==;5:E2HWmMQDPD7JIS2alvy9mcZTKMBR0UgSdKqlYWLgD32K4nlOdpuUDf7wVk5aK1M8tKdhXdQoLSyIVkJz8U9RaaAouo8uKBZLjNcEIt/sB0VM0kbITYwI9dLHIL624eNDv04cjk04ds9ZAfpRF8D6OLXGgtPmMOZYOqzrAJN/IlI=;7:V9DL+XL2ledPkm/R95gl9PwtYdsQUY2tz5cidaJw7M3uyDx15eyK/hdHGiufGGe1NH49MVtf3NWgXq9SwichaHJHXn5maW7oXfeScS68zt9JQGq61v3BgWGXkXuI+PfdYUHjichRTWHMjRIh/byvjZu4jKghOn2viYmXMIsKy5LJW23F70XgPHtLZ7hXZaMlMVEwLPuV+coDPztXoyTejXLjeAKgEhO74urcteEZRaUphi6QQnie1g7r+TJ1UIXo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR12MB1661;20:4/BEUs2aLj0hpInmbdq3p7xIDUKIml2g1khxv9vjzd0ycRHSc/par7mSaNvcAtVrw3J8rVr0lGUDnFA8CygINYfrh2ITF+s036T2TRme0Miw3XX7wNn1mrzIHl/SgkvbQXip5in5lS+aJXvY9/DAC1gtp8Dclqyils9XB7B1fE6z2yyrHjx3qHFum0Bs2Ho9zQOI8NH7DY+JB+uSC2I++5gEvjr188bb2NAPoLV+TX0TLcjYaZYpa/oXyzU8RvVv X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 13:23:09.0071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36b9de12-37f4-486c-b59a-08d61fc56108 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1661 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sandeep Singh Observed "TRB completion code (27)" error which corresponds to Stopped - Length Invalid error(xhci spec section 4.17.4) while connecting USB to SATA bridge. Looks like this case was not considered when the following patch[1] was committed. Hence adding this new check which can prevent the invalid byte size error. [1] ade2e3a xhci: handle transfer events without TRB pointer Signed-off-by: Sandeep Singh cc: Nehal Shah cc: Shyam Sundar S K --- drivers/usb/host/xhci-ring.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index f0a99aa..8ba2cbc 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2246,6 +2246,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, goto cleanup; case COMP_RING_UNDERRUN: case COMP_RING_OVERRUN: + case COMP_STOPPED_LENGTH_INVALID: goto cleanup; default: xhci_err(xhci, "ERROR Transfer event for unknown stream ring slot %u ep %u\n",