Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp240947imm; Tue, 19 Jun 2018 20:13:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFd4CUJF4TJHmCc9uOtbcgXmNgnVZ5crg5wzygugqXxmP7pukIC1bjEh5gcHu6yTMdyug3 X-Received: by 2002:a63:9345:: with SMTP id w5-v6mr17452675pgm.212.1529464420366; Tue, 19 Jun 2018 20:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529464420; cv=none; d=google.com; s=arc-20160816; b=nhDeGi+LmEh6ud5N9hhEOrjLIDvto1NCPC90rantm/nRVibBVEeQlmXqd1S+QGa4Xz A0u7dsG2f+D2CK+eSENInsqZ0eC3p0TQ4ZF25VCg9d6j2Mjc9wtqVJWIup712wc6LetT abe2aci+kOJrSdbapgwOyZPbGFW7W/yPLA3/Gcg+CLW+Ox8vL2DXSrWoLveU1C87zDpn 6qMgA6NkVGD0EHgQX/HYZ2msgxYdJ84cdlxVH55kI2cV134Y9I5LIOKd6GhJTmkAjzUU TQ07EmjvEAETlD06t7mLYcL2ROoiS+20RNUMEmU+d2ez8srAAaY9uWRZW4xepPbVAVOa edjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :cc:subject:from:to:dkim-signature:arc-authentication-results; bh=qLEqlNs2Tsej1THZNjXmq4yOTu9boAp9mTua8EpvQ5o=; b=02ODAMyodAicz51StLylEguXbQATAP36NU34diqa5miGpiPXS4S90Xq8/GsZljVAUh ltQLOwu0LmqeU8NSiWqCB7dQX+kbg49UPff/c8yH3BGtSRkshW43Yp1mGKvSZIY+rH1b KVJbCjc+WBbC2RDmyFs9CNW1ceyJLJsnFjXDwnygdlJNr/5PM9deNf/LzQEvhxl2MP4a T/A9SDGIJxOt3JYFG7/yQ3xFADUQIL+rLWu891ruC7Y/pTsOY2z3YNfZZlR11wHzFsID tRAJGP7xzw7pleVB1DNazfzc5Z/cYcwK3kY5VYWAGqjEmF/JP1qodCgnPWnU6Q+ifCf6 odtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eeuvBCGI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d125-v6si1003387pgc.94.2018.06.19.20.13.25; Tue, 19 Jun 2018 20:13:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eeuvBCGI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754219AbeFTDMq (ORCPT + 99 others); Tue, 19 Jun 2018 23:12:46 -0400 Received: from mail-pl0-f42.google.com ([209.85.160.42]:37839 "EHLO mail-pl0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbeFTDMo (ORCPT ); Tue, 19 Jun 2018 23:12:44 -0400 Received: by mail-pl0-f42.google.com with SMTP id 31-v6so930974plc.4; Tue, 19 Jun 2018 20:12:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:cc:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=qLEqlNs2Tsej1THZNjXmq4yOTu9boAp9mTua8EpvQ5o=; b=eeuvBCGIPKXljkHUilFlh9vCk+bZHK8fzU39b146cm2lr/EBlATw4ce93AXOXxYibd sfdyloFwTUaItn7QSqaF1N3iBdA8Q34+VoDDB6YfYTqmvQv4Zt5YH6MCzeLkWCKrW9/i SmvhjEE+RjDf28pOc/tf7Kk3nYmS1RGT57UNqjf1Y6jHMMDT5rciUOFxXQVsCTOgynwb 70kw+Sl1dcm/+g2yzkP2/1QpbhwKeuueGP7jBxKGlpCEa2c1rpkgbcJjqNXGWHqrg80t r/QfvIzKTcZSrTo0LjJC+yj965aIijuNeFroF1+WyewPip0tzKBcjNTgGr8uoDvjhEdA 8dPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:cc:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=qLEqlNs2Tsej1THZNjXmq4yOTu9boAp9mTua8EpvQ5o=; b=M+7rUWUA81Jq2MP8pvsFv0kw7/jWvVXDeIJ3MZBp2zdtmYYGqKMsRmBp0ZSDLAzcvY 3zruofpgS7TckrcHPLRq4V4ArD2VFj3RfFCD8ZAmj3LRn3KDNOrx+AYXjO3A0ZXC6XDD mwKbCP312cQTkXy5/1gcArmvaHsnz7YVISlycEYwMSYzrvimr+e65KrL5iVb5Dv7ChFS Q5Wsxr/ZeAs9Bh/g8WRFXbEyGN3XSox9gNofkRCW2Sb4f8PJbLR63b67IyLAKi85FlJo eNC5yVNrGoU2pKJjzRaNOFOk8KLy5SecmiAWVHumTiAoozRdz6vCn2TcPqKI0dwYeo1h pTYA== X-Gm-Message-State: APt69E1jlbKX/JC8vGcBvPM5A2uR0j4/qpNbBRvL/w1o4HUttkm7hn9Z Ykl1yfzs1R9fAuHMApDlRKrCh9uU X-Received: by 2002:a17:902:6105:: with SMTP id t5-v6mr21803105plj.138.1529464363846; Tue, 19 Jun 2018 20:12:43 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.11? ([2402:f000:1:1501:200:5efe:a66f:460b]) by smtp.gmail.com with ESMTPSA id a10-v6sm985500pgw.90.2018.06.19.20.12.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 20:12:43 -0700 (PDT) To: mathias.nyman@intel.com, gregkh@linuxfoundation.org From: Jia-Ju Bai Subject: [BUG] usb: xhci: Two possible sleep-in-atomic-context bugs Cc: linux-usb@vger.kernel.org, Linux Kernel Mailing List Message-ID: Date: Wed, 20 Jun 2018 11:12:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver may sleep with holding a spinlock. The function call paths (from bottom to top) in Linux-4.16.7 are: [FUNC] schedule drivers/base/power/runtime.c, 741: schedule in rpm_resume drivers/base/power/runtime.c, 1322: rpm_resume in pm_runtime_forbid drivers/usb/host/xhci-hub.c, 647: pm_runtime_forbid in xhci_enter_test_mode drivers/usb/host/xhci-hub.c, 632: _raw_spin_lock_irqsave in xhci_enter_test_mode [FUNC] schedule drivers/base/power/runtime.c, 570: schedule in rpm_suspend drivers/base/power/runtime.c, 434: rpm_suspend in rpm_idle drivers/base/power/runtime.c, 1343: rpm_idle in pm_runtime_allow drivers/usb/host/xhci-hub.c, 670: pm_runtime_allow in xhci_exit_test_mode drivers/usb/host/xhci-hub.c, 1387: xhci_exit_test_mode in xhci_hub_control drivers/usb/host/xhci-hub.c, 1038: _raw_spin_lock_irqsave in xhci_hub_control These bugs are found by my static analysis tool (DSAC-2) and checked by my code review. I do not know how to correctly fix these bugs, so I just report them. Best wishes, Jia-Ju Bai