From patchwork Fri Sep 21 01:48:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 10608931 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 17AC46CB for ; Fri, 21 Sep 2018 01:51:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1740D2DFCD for ; Fri, 21 Sep 2018 01:51:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AF4D2DFE1; Fri, 21 Sep 2018 01:51:23 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 A7BAD2DFCD for ; Fri, 21 Sep 2018 01:51:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388875AbeIUHhs (ORCPT ); Fri, 21 Sep 2018 03:37:48 -0400 Received: from mail-eopbgr10059.outbound.protection.outlook.com ([40.107.1.59]:26876 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725869AbeIUHhs (ORCPT ); Fri, 21 Sep 2018 03:37:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PH2A5IN3wDfdfWfJecppxDWHQgqdv0N1ITYeKziqcpo=; b=PErIb1i9lYo0iZzjMmGTa5boD115x6u7Howf2mZ9+m690zOJ2/A5u7km/4nz9YC5CiK5tAvWYAp8mE1fab6uqYqSnniAsl4Jf+Yyz5UGwg58enYgLobC4jJPdX2PHfvTzhGBJTFXZygwJnWqk1740XXf6JDXn6JVp3XSWcQaCzg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peter.chen@nxp.com; Received: from b29397-desktop.ap.freescale.net (119.31.174.66) by VI1PR04MB5326.eurprd04.prod.outlook.com (2603:10a6:803:60::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 01:50:29 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, linux-imx@nxp.com, jun.li@nxp.com, Peter Chen Subject: [PATCH 0/3] usb: host: xhci: fix oops and timeout when removing hcd Date: Fri, 21 Sep 2018 09:48:42 +0800 Message-Id: <20180921014845.14560-1-peter.chen@nxp.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0P153CA0022.APCP153.PROD.OUTLOOK.COM (2603:1096:203:18::34) To VI1PR04MB5326.eurprd04.prod.outlook.com (2603:10a6:803:60::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b62fba3b-abce-4016-3bf7-08d61f649e02 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:VI1PR04MB5326; X-Microsoft-Exchange-Diagnostics: 1;VI1PR04MB5326;3:pftSgoLgQZBYo7ZIslR7wFHAGFVv+TJ2qbHdzTZ+1gsNGuV4jxJJRgUOPPiNf1Jh8Fd5d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MZ570NWXKVTuzHK/MCmU2n5IUxfruc01zZArlRlYYrWWP2gnx9dBngAgsEyl5CQblV2jH36MpVObf0s8N+EKlxOlU1qA6+Pq3W0MmqEF1UJ6m45uZ5+X84EKy4aVeCxbV9loWv26dPcpiXDvdee1Q1Fd5uiF/GcOeGirV4PFg2P4TlDpI0zuykL6aSOVM+Wfjxj6V74mSgjXYKwbsAbZSgsnwCqsEEcOfj9tPWPmVc7mj6oH6piUiDXDYxIhPMALb+JWDr8fxWgz1CO+w0EEFen7B;4:SurKEP7PDD2VevBG+GdUrNjmjDaob6yR8BRYD0hgz9ULTAuuwvIRvlvPIkpmxAA0Rwx3oHs8Muul+iToCypprmosQczgF8UzdN3sjMiuhWP5rKrPwXBa8/KU/qYimQma4vrPl2OmVHm0ehmo8yOiyPPsO42zodGwIC4eiMyWVkswCKU76qStZjOKdmJCiUbY3opkW8UrHChreAcfRO9/UPp7moDldFz2goSPOxcRGti1ni5TsZTLCe1/SXsyOnjwXgc47R3P0DzyXxXlMMC3YQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051);SRVR:VI1PR04MB5326;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB5326; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(136003)(39860400002)(366004)(346002)(376002)(396003)(189003)(199004)(52116002)(81156014)(3846002)(8676002)(51416003)(2906002)(81166006)(386003)(2616005)(50226002)(316002)(6506007)(486006)(476003)(8936002)(956004)(6116002)(44832011)(6512007)(50466002)(6486002)(4326008)(105586002)(53936002)(305945005)(48376002)(7736002)(2351001)(26005)(186003)(106356001)(16526019)(5660300001)(36756003)(66066001)(16586007)(47776003)(6916009)(86362001)(97736004)(68736007)(1076002)(478600001)(2361001)(25786009)(6666003);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5326;H:b29397-desktop.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;VI1PR04MB5326;23:VodEymnFdZsApcw1FZ8L5YMKowLbmo+DD2aCiEHO4ROTlIOU9xTj3ZyROXNzjSdFzMxN6XTtRSn6omE5rjnqRO8IWjuFNV+hJDIkLlDPFRcFJxjFJ8vw9BOQvhvUGSw5Fsz4KbGcqBm1PPSkjBWMldX48U5ezLBDRjmcmKrPGmP6k/75MGBkwvbHSCz+U044l690fObn0tV4gBIgbytl/WlZXoEwMMlAXvjuwSeOJ047gjivp5eDj4LMJp+KIQt7irbQTseFh0iX66kimHHGwl66Sp084AWcuhftIFCXT8r45sKCG/mipV6jtHdKzYRsfaOVMTWpQ2BgRjeVcvpakensNfkW2eK94fdL60OHq6NCkHM6y0DUmrPUuAcSvHrr1upWddnCZeU0jwrR3ki7LgUetzRgjzfJfkmKC589S7JTYwLQVuGnkGcWPCtS0pRC3R7GFm6BndYJ8TM+rFbAT/e9UfdBaSJPd7JTB6NY30noHJ03ImtmfnMfqaE6p4eh/4OZwcV5+bc2wTtWx+oSsPBIMSGvKWG+GDERTI6tLvagxDtutE2w0mtRsKw1jmtv8p+T9tF9mi/lCZJAs1k2zjCXUiW9hFxH5KbdKTmZ8iCS5+rUqi9hQOnRG0GZI8dArygazU5ThCji0X/Dn3p8s4hgJPj6o33VXEKSYamnxEMmmqX2WQFPzW67QP7mhhe1luL0jED7oPlJHOMDcmJM1wE1O/9phojwx0qMC6NRij3ejTe8gATzS0GC+LuLcLdXHW/lSJEk70iWDk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Fhx/408wbSAcVNpOmML8Qm9Tdc3je2mt15jqS73FAti2AnDzQAIUgwYFjfj5nw8S8oPIbdH+pRvrS8zMpOB2L7BnSdK889g5VCCMObmcZlec9mXX70DP7ZGStZGb5zzzlbDFAWBJ6NU7p5Uea8urykBjVRxPUXBBLBTOn05xLkQQmMY0EPq+iPc8AkvqiviRAqHSslHsyxmjarLefuWG6Gic2DiWCl+3yWTSqmSBjAQ==;5:/WZeLCZ7/eiE3TpwQYFMKHxOudPkc7f7o+xrch2n32YpTCBEEqlt6DQ5FoQHrY00V+rlmi72QDYndQuDcuNOzTROAcsr5K79E6Wy7CtPVXAQ4jwmqYHXQ+QnNsevx4Fz47LLx5GdRuSuJ8o0v6JT5q52nqeIqDRtpHC+TJur1wo=;7:q/wjd3BS72YD+1yGLeF66lRabPsyMeDgagmCaowAo4arFfG9Tr7KvARbSXAdwvrxu0/sSFeVQabZXR0bcCLzg36H39fqy0HTVy1k6lTQJH5hj018UCCJYtBe8ra1TyKlcmY7AATSppVLy6wY+TOrmGdFBm+rk+30Miy7SPP0KkadfJpaoPbfX73nx7qSWsuHgZp4AJ53+mIP6VKzd5pVgHUBqvLw6n/7o8ywdjnAfCGkktQB3w23m5WDKpMoH/CZ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 01:50:29.9203 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b62fba3b-abce-4016-3bf7-08d61f649e02 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5326 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 Hi Mathias, I have run out this issue for v4.14 kernel, but the problem should exist at mainline kernel too, the USB3 interrupt may occur after USB3 HCD structure has removed, and cause oops at xhci_irq. The 2nd and 3rd patches are needed if we return early at xhci_irq when we are removing HCD. Peter Chen (3): usb: host: xhci: fix oops when removing hcd usb: host: xhci: return -ESHUTDOWN when removing hcd usb: host: xhci: return early for xhci_urb_dequeue when removing hcd drivers/usb/host/xhci-ring.c | 3 ++- drivers/usb/host/xhci.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-)